Hey, Jb,

I find issue with your fix for
Mono.Cecil.Metadata.UserStringsHeap.ReadStringAt:

string ReadStringAt (int offset)
{
  int length = Utilities.ReadCompressedInteger (this.Data, offset, out
offset) - 1;
  if (length < 1)
   return string.Empty;
  if ((length & 1) != 0)
   length--; //<------- here, we lost last byte of the string
  ......
}

Maybe you think the last byte is useless because it should be unicode,
but I find it is important.

For example, in method BoojobNet.Code.8e2b8b29d41c1929:

with current ceceil version we get instructions:
46           L_0057:    ldstr   "䃈䟪令嗟峤掹櫢燔"
47           L_005c:    ldc.i4  0x26f24085
48           L_0061:    call    System.String
BoojobNet.About.d4485e5ae14ac128::cc381ffa3ede662f(System.String,System.Int32)
the decoded string is "CheckCod"

however the correct one should be:
46           L_0057:    ldstr   "䃈䟪令嗟峤掹櫢燔磒"  <--- which I append 0 to last byte
47           L_005c:    ldc.i4  0x26f24085
48           L_0061:    call    System.String
BoojobNet.About.d4485e5ae14ac128::cc381ffa3ede662f(System.String,System.Int32)
the decoded string is "CheckCode"

So the last byte of obfuscated string cannot be discarded.

Regards,
Wicky Hu

On Nov 6, 9:42 am, Wicky <[EMAIL PROTECTED]> wrote:
> Hey, Jb,
>
> I just tried the SVN version and it's fixed.
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to