View Single Post
  #1  
Old 02-26-2019, 13:05
WhoCares's Avatar
WhoCares WhoCares is offline
who cares
 
Join Date: Jan 2002
Location: Here
Posts: 410
Rept. Given: 10
Rept. Rcvd 17 Times in 15 Posts
Thanks Given: 42
Thanks Rcvd at 155 Times in 61 Posts
WhoCares Reputation: 17
Reflector gets wrong decompiling result?

same dll and same function body, different decompiling results for Reflector, dotPeek, dnSpy(all are latest versions).

Reflector
Code:
    private uint e(byte[] a, ref int b)
    {
        b += 4;
        return BitConverter.ToUInt32(a, b);
    }
dotPeek, dnSpy
Code:
  private uint e(byte[] a, ref int b)
  {
    int uint32 = (int) BitConverter.ToUInt32(a, b);
    b += 4;
    return (uint) uint32;
  }
IL of function body
Code:
  .method private hidebysig instance unsigned int32
    e(
      unsigned int8[] a,
      int32& b
    ) cil managed
  {
    .maxstack 8

    IL_0000: ldarg.1      // a
    IL_0001: ldarg.2      // b
    IL_0002: ldind.i4
    IL_0003: call         unsigned int32 [mscorlib]System.BitConverter::ToUInt32(unsigned int8[], int32)
    IL_0008: ldarg.2      // b
    IL_0009: ldarg.2      // b
    IL_000a: ldind.i4
    IL_000b: ldc.i4.4
    IL_000c: add
    IL_000d: stind.i4
    IL_000e: ret

  } // end of method e
__________________
AKA Solomon/blowfish.
Reply With Quote
The Following User Says Thank You to WhoCares For This Useful Post:
chants (02-26-2019)