资源中包含两个GZ压缩过的DLL,一个是32位一个是64位,按上面提取出资源中的GZIP压缩过的32位DLL,如下:
nintexcore.rar
这个DLL信息如下:
The Export Tables (interpreted .rdata section contents)
Export Flags 0
Time/Date stamp 4e70231c
Major/Minor 0/0
Name 0001d116 MSILJITTER.dll
Ordinal Base 1
Number in:
Export Address Table 00000003
[Name Pointer/Ordinal] Table 00000003
Table Addresses
Export Address Table 0001d0f8
Name Pointer Table 0001d104
Ordinal Table 0001d110
Export Address Table -- Ordinal Base 1
[ 0] +base[ 1] 11320 Export RVA
[ 1] +base[ 2] 11451 Export RVA
[ 2] +base[ 3] 11433 Export RVA
[Ordinal/Name Pointer] Table
[ 1] _1
[ 2] _AtExit
[ 0] _Initialize
查看_Initialize函数的代码,由上面的.net代码可知,函数参数为methodhandle:
10011320: e9 2b 20 00 00 jmp 0x10013350
10013350: 55 push %ebp
10013351: 8b ec mov %esp,%ebp
10013353: 83 ec 4c sub $0x4c,%esp
10013356: 53 push %ebx
10013357: 56 push %esi
10013358: 57 push %edi
10013359: e9 26 c1 01 00 jmp 0x1002f484
1002f484: 68 47 89 02 10 push $0x10028947
1002f489: e9 5e 3e ff ff jmp 0x100232ec
100232ec: 60 pusha
100232ed: 9c pushf
100232ee: fc cld
100232ef: e8 00 00 00 00 call 0x100232f4
100232f4: 5f pop %edi
100232f5: 81 ef f4 32 02 10 sub $0x100232f4,%edi
100232fb: 8b c7 mov %edi,%eax
100232fd: 81 c7 00 30 02 10 add $0x10023000,%edi
10023303: 3b 47 2c cmp 0x2c(%edi),%eax
10023306: 75 02 jne 0x1002330a
10023308: eb 36 jmp 0x10023340
1002330a: 89 47 2c mov %eax,0x2c(%edi)
1002330d: b9 a8 00 00 00 mov $0xa8,%ecx
10023312: eb 0d jmp 0x10023321
10023314: eb 06 jmp 0x1002331c
10023316: 01 44 8f 58 add %eax,0x58(%edi,%ecx,4)
1002331a: eb 04 jmp 0x10023320
1002331c: 01 44 8f 48 add %eax,0x48(%edi,%ecx,4)
10023320: 49 dec %ecx
10023321: 0b c9 or %ecx,%ecx
10023323: 75 ef jne 0x10023314
10023325: 83 7f 44 00 cmpl $0x0,0x44(%edi)
10023329: 74 15 je 0x10023340
1002332b: 8b 77 44 mov 0x44(%edi),%esi
1002332e: 03 f0 add %eax,%esi
10023330: eb 09 jmp 0x1002333b
10023332: 8b 1e mov (%esi),%ebx
10023334: 03 d8 add %eax,%ebx
10023336: 01 03 add %eax,(%ebx)
10023338: 83 c6 04 add $0x4,%esi
1002333b: 83 3e 00 cmpl $0x0,(%esi)
1002333e: 75 f2 jne 0x10023332
10023340: 8b 74 24 24 mov 0x24(%esp),%esi
10023344: 8b de mov %esi,%ebx
10023346: 03 f0 add %eax,%esi
10023348: b9 01 00 00 00 mov $0x1,%ecx
1002334d: 33 c0 xor %eax,%eax
1002334f: f0 0f b1 4f 30 lock cmpxchg %ecx,0x30(%edi)
10023354: 75 f7 jne 0x1002334d
10023356: ac lods %ds:(%esi),%al
10023357: 66 52 push %dx
10023359: b2 e9 mov $0xe9,%dl
1002335b: 28 d0 sub %dl,%al
1002335d: e9 d8 23 00 00 jmp 0x1002573a
1002aca1: 68 6e ad 02 10 push $0x1002ad6e
1002aca6: e9 41 86 ff ff jmp 0x100232ec
1002acab: 68 1e ae 02 10 push $0x1002ae1e
1002acb0: e9 37 86 ff ff jmp 0x100232ec
1002acb5: 68 d7 ae 02 10 push $0x1002aed7
1002acba: e9 2d 86 ff ff jmp 0x100232ec
1002acbf: 68 b5 af 02 10 push $0x1002afb5
1002acc4: e9 23 86 ff ff jmp 0x100232ec
1002acc9: 68 28 b0 02 10 push $0x1002b028
1002acce: e9 19 86 ff ff jmp 0x100232ec
1002acd3: 68 ab b1 02 10 push $0x1002b1ab
1002acd8: e9 0f 86 ff ff jmp 0x100232ec
1002acdd: 68 89 b2 02 10 push $0x1002b289
1002ace2: e9 05 86 ff ff jmp 0x100232ec
看到这,怎么看起来有点象虚拟机解码来着,不看了。如果您想进一步跟踪了解,请先看这一篇文章:
http://www.cnblogs.com/rick/archive/2007/08/04/843297.html
我查看字符串信息发现:
DbgBreakPoint
DbgUiRemoteBreakin
illy.dll
_Disassembleback
GetFileVersion
GetRequestedRuntimeInfo
GetCORVersion
mscoree.dll
bad allocation
Memory allocation failed for IP_ADAPTER_ADDRESSES struct
getJit
ninjatrader.exe
2.0.50727.
2.0.50727.3068 (QFE.050727-3000)
2.0.50727.3053 (netfxsp.050727-3000)
\StringFileInfo\040904b0\FileVersion
clrjit.dll
RuntimeLog
HH'h'mm'm'ss's'
dd'd'MM'm'yyyy'y'
Pc@xB
iphlpapi.dll
dbghelp.dll
MSILJITTER.dll
_AtExit
_Initialize
$pXz?
h:\Dev\cs\Libraries\MSILJitter\bin\Release\Win32\CliSecureRT.pdb
GetCORSystemDirectory
这上面有一个ninjatrader.exe,看名字跟忍者切水果一样,百度了一下是一个股票软件,软件由.NET编写。由此我猜想作者可能是ninjatrader公司的职员。(人老了就容易八卦了~~~)
总结一下,这个DLL由加密过的.net程序调用,并对.net函数体进行解码。这个DLL是MSVC写的本机代码,具体的解码过程可以由OLLDBG载入主程序并下断点在载入新DLL来进行进一步跟踪来得到。
另外字符串中有illy.dll这个东东,百度了一下,在52pojie上找到相关描述:
Author: Ufo-Pu55y
Features:
-Auto-Hook on compileMethod()
-Shows the IL code of each method
-Break on jitted method (native code)
-All dumped methods (e.g. once shown in dump window) remain in BP window
-Manually dump IL code (In context menu of dump windows > Dump selection)
原来是一个JIT层IL代码DUMPER。这是否说明在这个DLL中对ILLY进行了检测。
如果要写脱壳机,那么必须跟踪出解码过程,有兴趣的朋友可以进一步跟踪DLL解密过程。
今天按壳名谷歌了一下,发现早有高手破解过此壳并贴出了自己的分析过程,传送门:
http://bbs.pediy.com/showthread.php?t=38238
脱壳后的文件:
Nintex.rar
上传的附件: