When the name of psd is chinese string, the ReadPascalString method of BinaryReverseReader class use "new String(c)" will be random code.
The old code is:
public String ReadPascalString()
{
Byte stringLength = base.ReadByte();
Char[] c = base.ReadChars(stringLength);
if ((stringLength % 2) == 0) base.ReadByte();
return new String(c);
}
it should change to :
public String ReadPascalString()
{
try
{
byte stringLength = base.ReadByte();
byte[] c = base.ReadBytes(stringLength);
if ((stringLength % 2) == 0)
base.ReadByte();
return Encoding.GetEncoding("GBK").GetString(c);
}
catch (Exception)
{
return string.Empty;
}
}