PDA

View Full Version : Obfuscated DLL?!


Zarathos
05-17-2009, 05:16 PM
Hi all!

I'm trying to reverse this very small DLL (http://www.zarathos.net/PlayUO.Terrain.dll), but I'm getting a strange error.
In both HighMeshProvider and MediumMeshProvider classes, at the beginning of "void Sample" method, .NET Reflector print me the following line:
// This item is obfuscated and can not be translated.

Dis# outputs exactly the same code without any kind of warning about obfuscated things... but with the same odd MSIL instructions at the end.
I've also tried to use some .NET deobfuscators found through Google in order to get rid of this problem... but all of them didn't found any obfuscated thing and returned me the same file without changes.

Anyway, I really can't find a way to reverse the last part of this function... looks very very strange!
Does anyone has any clue about?

Thanks!

Kurapica
05-18-2009, 04:18 AM
Ignore that message, the code is fully clear and nothing is missing.

Zarathos
05-18-2009, 06:27 AM
Oh... ok! Thank you very much for this answer.
Anyway, what I don't get is the final part oh those methods... looks very strange. Can anyone help me rebuilding it correctly?

int num9 = pInput[5] - pInput[10];

if (num9 < 0)
num = -num9;

int num10 = pInput[6] - pInput[9];

if (num10 < 0)
num2 = -num10;

if ((num < 11) && (num2 < 11))
SampleDefault(pInput, pOutput);
else if (num < num2)
SampleSplitVertical(pInput, pOutput);
else
SampleSplitHorizontal(pInput, pOutput);

L_02ce: ldarg.1
L_02cf: ldc.i4.s 20
L_02d1: conv.i
L_02d2: add
L_02d3: ldind.i4
L_02d4: ldarg.1
L_02d5: ldc.i4.s 40
L_02d7: conv.i
L_02d8: add
L_02d9: ldind.i4
L_02da: sub
L_02db: stloc.s num9
L_02dd: ldloc.s num9
L_02df: ldc.i4.0
L_02e0: bge.s L_02e6
L_02e2: ldloc.s num9
L_02e4: neg
L_02e5: stloc.0
L_02e6: ldarg.1
L_02e7: ldc.i4.s 0x18
L_02e9: conv.i
L_02ea: add
L_02eb: ldind.i4
L_02ec: ldarg.1
L_02ed: ldc.i4.s 0x24
L_02ef: conv.i
L_02f0: add
L_02f1: ldind.i4
L_02f2: sub
L_02f3: stloc.s num10
L_02f5: ldloc.s num10
L_02f7: ldc.i4.0
L_02f8: bge.s L_02fe
L_02fa: ldloc.s num10
L_02fc: neg
L_02fd: stloc.1
L_02fe: ldloc.0
L_02ff: ldc.i4.s 11
L_0301: bge.s L_0311
L_0303: ldloc.1
L_0304: ldc.i4.s 11
L_0306: bge.s L_0311
L_0308: ldarg.0
L_0309: ldarg.1
L_030a: ldarg.2
L_030b: call instance void PlayUO.Terrain.HighMeshProvider::SampleDefault(int 32*, float32*)
L_0310: ret
L_0311: ldloc.0
L_0312: ldloc.1
L_0313: bge.s L_031e
L_0315: ldarg.0
L_0316: ldarg.1
L_0317: ldarg.2
L_0318: call instance void PlayUO.Terrain.HighMeshProvider::SampleSplitVertic al(int32*, float32*)
L_031d: ret
L_031e: ldarg.0
L_031f: ldarg.1
L_0320: ldarg.2
L_0321: call instance void PlayUO.Terrain.HighMeshProvider::SampleSplitHorizo ntal(int32*, float32*)
L_0326: ret

Thanks again in advance!