Reverse Engineering RET Homepage RET Members Reverse Engineering Projects Reverse Engineering Papers Reversing Challenges Reverser Tools RET Re-Search Engine Reverse Engineering Forum Reverse Engineering Links

Go Back   Reverse Engineering Team Board > Reverse Engineering Board > .NET Reverse Engineering
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 10-05-2009, 03:33 PM
ExeLord ExeLord is offline
Junior Member
Join Date: Oct 2009
Posts: 1
Default What cause reflector to raise exception on this IL

I have target which is obfuscated and all strings are encrypted with simple encryption routine, here is string decryption function:

.method privatescope hidebysig static string ᐁ(string) cil managed
    .maxstack 4
    .locals init (
        [0] char[] chArray,
        [1] int32 num)
    L_0000: ldarg.0 
    L_0001: call instance char[] [mscorlib]System.String::ToCharArray()
    L_0006: dup 
    L_0007: stloc.0 
    L_0008: dup 
    L_0009: ldlen 
    L_000a: conv.i4 
    L_000b: dup 
    L_000c: ldc.i4.0 
    L_000d: bgt.s L_001b
    L_000f: pop 
    L_0010: newobj instance void [mscorlib]System.String::.ctor(char[])
    L_0015: call string [mscorlib]System.String::Intern(string)
    L_001a: ret 
    L_001b: ldc.i4.m1 
    L_001c: add 
    L_001d: dup 
    L_001e: stloc.1 
    L_001f: ldloc.0 
    L_0020: ldloc.1 
    L_0021: ldelem.u2 
    L_0022: ldc.i4 0x1469
    L_0027: sub 
    L_0028: conv.u2 
    L_0029: stelem.i2 
    L_002a: ldloc.0 
    L_002b: ldloc.1 
    L_002c: br.s L_000b
when I try to decompile it with reflector, it will raise an exception, here is reflector exception info:

Translation failure in 'ᐁ.ᐁ(String) : String' in 'Telligent.Registration, Version=5.0.40702.0, Culture=neutral, PublicKeyToken=null'.



Expression stack is empty at offset 001D.


   at ឺ.ᜀ()
   at ឺ.ᜀ(BinaryOperator A_0)
   at ឺ.᜘()
   at ឺ.ᜊ(Int32 A_0)
   at ឺ.ᜋ(Int32 A_0)
   at ឺ.ᜂ(Int32 A_0, Int32 A_1)
   at ឺ.ᜀ(IMethodDeclaration A_0, IMethodBody A_1)
   at ឤ.ᜀ(IMethodDeclaration A_0)
   at ឥ.ᜁ(IMethodDeclaration A_0)
   at ᝎ.ᜀ(Boolean A_0, Boolean A_1, Boolean A_2)

.NET Reflector
.NET Framework 2.0.50727.3074
Microsoft Windows NT 6.0.6001 Service Pack 1
Culture: en-US (en-US)
why it cause reflector decompiler to raise exception ?

I can send target assemlby if needed.
Reply With Quote
Old 10-05-2009, 03:41 PM
Kurapica Kurapica is offline
Senior Member
Join Date: May 2006
Location: Archives
Posts: 357

this exception is usually raised when the control-flow of the code is obfuscated.
Life can only be understood backwards but It must be read forwards.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.