好友
阅读权限10
听众
最后登录1970-1-1
|
1.查壳。
UPX的,ESP定律脱壳,REC修复。
2.Microsoft Visual C++ 6.0写的,运行下。
出现窗口几秒后自动退出。应该有自校验。
3。自校验有几种常用方法。
1.校检自身大小。看一下脱壳前的大小为:313344字节转16进制为4C800,脱壳后
958464字节转16进制为EA000。
用W32Dasm载入脱壳后的文件搜索4C800或0004C800.找不到相关有用的地址。
2.跟踪退出函数。下ExitProcess、PostQuitMessage,TerminateProcess等函数断点,堆栈返回后,查找关键点。
经测试下TerminateProcess函数能中断来。
BP TerminateProcess。F9运行。中断下来
0012FAA4 0040A47F /CALL 到 TerminateProcess 来自 123_.0040A47A 从这里我们可以看出TerminateProcess的调用地方是在0040A47A
0012FAA8 000002F4 |hProcess = 000002F4 (window)
0012FAAC 00000000 \ExitCode = 0
0012FAB0 0012FB3C
0012FAB4 00491870 123_.00491870
在OD中CTRL+G,输入0040A47A:
0040A46D |. 68 00000000 push 0
0040A472 |. FF75 FC push [local.1]
0040A475 |. B8 21000000 mov eax,21
0040A47A |. E8 D8630100 call 123_.00420857 这里调用。向上找首部
0040A47F |. 3965 F4 cmp [local.3],esp
0040A482 |. 74 0D je short 123_.0040A491
0040A424 /$ 55 push ebp 这个,注意信息栏的内容
0040A425 |. 8BEC mov ebp,esp
0040A427 |. 81EC 18000000 sub esp,18
0040A42D |. C745 FC 00000>mov [local.1],0
0040A434 |. C745 F8 00000>mov [local.2],0
0040A43B |. 8965 F4 mov [local.3],esp
0040A43E |. FF75 08 push [arg.1]
信息栏的内容:
Local Call from 00409F83
我们在内容上右击,“前往CALL来自00409F83”
00409F49 |. E8 21690100 call 123_.0042086F
00409F4E |. 83C4 18 add esp,18
00409F51 |. 833D F8C44B00>cmp dword ptr ds:[4BC4F8],0
00409F58 0F85 2A000000 jnz 123_.00409F88
00409F5E |. E8 29000000 call 123_.00409F8C
00409F63 |. 8965 FC mov [local.1],esp
00409F66 |. B8 1C000000 mov eax,1C
00409F6B |. E8 E7680100 call 123_.00420857
00409F70 |. 3965 FC cmp [local.1],esp
00409F73 |. 74 0D je short 123_.00409F82
00409F75 |. 68 06000000 push 6
00409F7A |. E8 D2680100 call 123_.00420851
00409F7F |. 83C4 04 add esp,4
00409F82 |> 50 push eax ; /Arg1
00409F83 |. E8 9C040000 call 123_.0040A424 ; \123_.0040A424 就是这里了,最终会调用TerminateProcess,向上看是从哪里跳过来
00409F88 |> 8BE5 mov esp,ebp
00409F8A |. 5D pop ebp
00409F8B \. C3 retn
可以看出,00409F83处的CALL最终呼叫TerminateProcess退出,所以只要使000409F58处的跳转实现即可,将00409F58的跳转JMP后保存,测试运行正常。
还可以利用第三方软件辅助查找关键的地方。很多软件利用CRC或者MD5实现磁盘文件校验或者内存映像校验等,对此类软件我们可以利用算法识别工具找到密码学算法和核心,然后层层向上,找到最初的调用地方更改其流程方向。
先用PEID的插件kanal分析。可以看出,软件有CRC ,MD5.有个CRC32:0040AE40
CTRL+G搜索0040AE40
0040AE40 |? 2083 B8ED6801 and byte ptr ds:[ebx+168EDB8],al 找到的地方在这里,上拉找到这个CALL的首部
0040AE46 |? 0300 add eax,dword ptr ds:[eax]
0040AE48 |? 806A 00 FF sub byte ptr ds:[edx],0FF
0040AE4C |?^ 75 E0 jnz short 123_.0040AE2E
0040AE4E |. 68 02000000 ||push 2
0040AE53 |. BB 300D4200 ||mov ebx,123_.00420D30
0040AE58 |. E8 EE590100 ||call 123_.0042084B
0040AE5D |. 83C4 1C ||add esp,1C
0040AE60 |. 8945 F4 ||mov [local.3],eax
0040ACEF /$ 55 push ebp 到这里,看OD的提示栏:Local Call from 0040AC85,从0040AC85跳转来的
0040ACF0 |. 8BEC mov ebp,esp
0040ACF2 |. 81EC 34000000 sub esp,34
0040ACF8 |. C745 FC 00000>mov [local.1],0
0040ACFF |. C745 F8 00000>mov [local.2],0
0040AD06 |. C745 F4 00000>mov [local.3],0
0040AD0D |. 68 08040000 push 408
0040AD12 |. E8 285B0100 call 123_.0042083F
右击,“前往JMP 来自0040AC85”
来到后再向上找
0040AA59 /$ 55 push ebp
0040AA5A |. 8BEC mov ebp,esp
0040AA5C |. 81EC 34000000 sub esp,34
0040AA62 |. C745 FC 00000>mov [local.1],0
0040AA69 |. C745 F8 00000>mov [local.2],0
0040AA70 |. C745 F4 00000>mov [local.3],0
0040AA77 |. C745 F0 00000>mov [local.4],0
0040AA7E |. C745 EC 00000>mov [local.5],0
0040AA85 |. C745 E8 00000>mov [local.6],0
0040AA8C |. 68 01030080 push 80000301
注意信息提示:Local Calls from 0040A60B, 0040B2A0, 004181B9, 0041896C
右击,“前往JMP 来自0040A60B”
0040A4D3 /. 55 push ebp
0040A4D4 |. 8BEC mov ebp,esp
0040A4D6 |. 81EC 10000000 sub esp,10
0040A4DC |. 6A 00 push 0
0040A4DE |. 68 01000000 push 1
0040A4E3 |. 6A FF push -1
0040A4E5 |. 6A 1A push 1A
0040A4E7 |. 68 9E720106 push 601729E
0040A4EC |. 68 9D720152 push 5201729D
0040A4F1 |. E8 79630100 call 123_.0042086F
0040A4F6 |. 83C4 18 add esp,18
0040A4F9 |. EB 10 jmp short 123_.0040A50B
0040A4FB |. 56 4D 50 72 6>ascii "VMProtect begin",0
0040A50B |> 68 04C54B00 push 123_.004BC504
0040A510 |. 8B0424 mov eax,dword ptr ss:[esp]
0040A513 |. 8B00 mov eax,dword ptr ds:[eax]
0040A515 |. 8B00 mov eax,dword ptr ds:[eax]
0040A517 |. FF50 08 call dword ptr ds:[eax+8]
0040A51A |. 85C0 test eax,eax
0040A51C |. 0F84 2D000000 je 123_.0040A54F
0040A522 |. 68 04C54B00 push 123_.004BC504
0040A527 |. 8B0424 mov eax,dword ptr ss:[esp]
0040A52A |. 8B00 mov eax,dword ptr ds:[eax]
0040A52C |. 8B00 mov eax,dword ptr ds:[eax]
0040A52E |. FF50 10 call dword ptr ds:[eax+10]
0040A531 |. 68 04C54B00 push 123_.004BC504
0040A536 |. 8B0424 mov eax,dword ptr ss:[esp]
0040A539 |. 8B00 mov eax,dword ptr ds:[eax]
0040A53B |. 8B00 mov eax,dword ptr ds:[eax]
0040A53D |. FF50 14 call dword ptr ds:[eax+14]
0040A540 |. 68 04C54B00 push 123_.004BC504
0040A545 |. 8B0424 mov eax,dword ptr ss:[esp]
0040A548 |. 8B00 mov eax,dword ptr ds:[eax]
0040A54A |. 8B00 mov eax,dword ptr ds:[eax]
0040A54C |. FF50 18 call dword ptr ds:[eax+18]
0040A54F |> 68 04C54B00 push 123_.004BC504
0040A554 |. 8B0424 mov eax,dword ptr ss:[esp]
0040A557 |. 8B00 mov eax,dword ptr ds:[eax]
0040A559 |. 8B00 mov eax,dword ptr ds:[eax]
0040A55B |. FF50 0C call dword ptr ds:[eax+C]
0040A55E |. 6A 00 push 0
0040A560 |. 6A 00 push 0
0040A562 |. 6A 00 push 0
0040A564 |. 68 01000000 push 1
0040A569 |. BB 10114200 mov ebx,123_.00421110
0040A56E |. E8 D8620100 call 123_.0042084B
0040A573 |. 83C4 10 add esp,10
0040A576 |. B8 928B4900 mov eax,123_.00498B92 ; ASCII "7815696ECBF1C96E6894B779456D330E8ffa03da3984a947de1b07af57eecccf"
0040A57B |. 8945 FC mov [local.1],eax
0040A57E |. 8D45 FC lea eax,[local.1]
0040A581 |. 50 push eax
0040A582 |. 68 08C54B00 push 123_.004BC508
0040A587 |. 8B0424 mov eax,dword ptr ss:[esp]
0040A58A |. 8B00 mov eax,dword ptr ds:[eax]
0040A58C |. 8B00 mov eax,dword ptr ds:[eax]
0040A58E |. FF50 08 call dword ptr ds:[eax+8]
0040A591 |. 8945 F8 mov [local.2],eax
0040A594 |. 8B5D FC mov ebx,[local.1]
0040A597 |. 85DB test ebx,ebx
0040A599 |. 74 09 je short 123_.0040A5A4
0040A59B |. 53 push ebx
0040A59C |. E8 A4620100 call 123_.00420845
0040A5A1 |. 83C4 04 add esp,4
0040A5A4 |> 8B45 F8 mov eax,[local.2]
0040A5A7 |. A3 F8C44B00 mov dword ptr ds:[4BC4F8],eax
0040A5AC |. 68 01030080 push 80000301
0040A5B1 |. 6A 00 push 0
0040A5B3 |. 68 F4010000 push 1F4
0040A5B8 |. 68 01030080 push 80000301
0040A5BD |. 6A 00 push 0
0040A5BF |. 68 64000000 push 64
0040A5C4 |. 68 02000000 push 2
0040A5C9 |. BB B0114200 mov ebx,123_.004211B0
0040A5CE |. E8 78620100 call 123_.0042084B
0040A5D3 |. 83C4 1C add esp,1C
0040A5D6 |. 6A 00 push 0
0040A5D8 |. 50 push eax
0040A5D9 |. 6A FF push -1
0040A5DB |. 6A 08 push 8
0040A5DD |. 68 AB720116 push 160172AB
0040A5E2 |. 68 9D720152 push 5201729D
0040A5E7 |. E8 83620100 call 123_.0042086F
0040A5EC |. 83C4 18 add esp,18
0040A5EF |. EB 0E jmp short 123_.0040A5FF
0040A5F1 |. 56 4D 50 72 6>ascii "VMProtect end",0
0040A5FF |> C745 FC 00000>mov [local.1],0
0040A606 |. 6A 00 push 0 ; /Arg2 = 00000000
0040A608 |. FF75 FC push [local.1] ; |Arg1
0040A60B |. E8 49040000 call 123_.0040AA59 ; \123_.0040AA59
来到这里,中间是加密的地方。把0040A4F9 |. EB 10 jmp short 123_.0040A50B修改为jmp 0040A5FF。跳过加密的地方。保存,测试可运行。 |
免费评分
-
查看全部评分
|