某程序的脫殼,程序就不介紹 工具ollydbg lordpe
載入程序//ep - 00401000 s> B8 88696E00 mov eax,6E6988
- 00401005 50 push eax
- 00401006 64:FF35 00000000 push dword ptr fs:[0]
- 0040100D 64:8925 00000000 mov dword ptr fs:[0],esp
- 00401014 33C0 xor eax,eax
- 00401016 8908 mov dword ptr ds:[eax],ecx
- 00401018 50 push eax
- 00401019 45 inc ebp
- 0040101A 43 inc ebx
- 0040101B 6F outs dx,dword ptr es:[edi]
- 0040101C 6D ins dword ptr es:[edi],dx
- 0040101D 70 61 jo short 00401080 ; ss225.00401080
- 0040101F 637432 00 arpl word ptr ds:[edx+esi],si
- 00401023 8E13 mov ss,word ptr ds:[ebx]
- 00401025 FC cld
- 00401026 C6 ??? ; Unknown command
- 00401027 1E push ds
復(fù)制代碼 ctrl+g VirtualAlloc F2下段F9運(yùn)行 ALT+f9返回 - 006E69E1 5A pop edx ; ss225.00400000
- 006E69E2 8BF8 mov edi,eax
- 006E69E4 50 push eax
- 006E69E5 52 push edx ; ntdll.KiFastSystemCallRet
- 006E69E6 8B33 mov esi,dword ptr ds:[ebx]
- 006E69E8 8B43 20 mov eax,dword ptr ds:[ebx+20]
- 006E69EB 03C2 add eax,edx ; ntdll.KiFastSystemCallRet
- 006E69ED 8B08 mov ecx,dword ptr ds:[eax]
- 006E69EF 894B 20 mov dword ptr ds:[ebx+20],ecx ; kernel32.7C809AB9
- 006E69F2 8B43 1C mov eax,dword ptr ds:[ebx+1C]
- 006E69F5 03C2 add eax,edx ; ntdll.KiFastSystemCallRet
- 006E69F7 8B08 mov ecx,dword ptr ds:[eax]
- 006E69F9 894B 1C mov dword ptr ds:[ebx+1C],ecx ; kernel32.7C809AB9
- 006E69FC 03F2 add esi,edx ; ntdll.KiFastSystemCallRet
- 006E69FE 8B4B 0C mov ecx,dword ptr ds:[ebx+C]
- 006E6A01 03CA add ecx,edx ; ntdll.KiFastSystemCallRet
- 006E6A03 8D43 1C lea eax,dword ptr ds:[ebx+1C]
- 006E6A06 50 push eax
復(fù)制代碼 ctrl+F Call Edi f2下段運(yùn)行到此 - 006E6A26 FFD7 call edi ; ntdll.7C930738
- 006E6A28 8985 3F130010 mov dword ptr ss:[ebp+1000133F],eax
- 006E6A2E 8BF0 mov esi,eax
- 006E6A30 8B4B 14 mov ecx,dword ptr ds:[ebx+14]
- 006E6A33 5A pop edx ; ss225.00400000
- 006E6A34 EB 0C jmp short 006E6A42 ; ss225.006E6A42
- 006E6A36 03CA add ecx,edx ; ntdll.KiFastSystemCallRet
- 006E6A38 68 00800000 push 8000
- 006E6A3D 6A 00 push 0
- 006E6A3F 57 push edi ; ntdll.7C930738
- 006E6A40 FF11 call dword ptr ds:[ecx]
- 006E6A42 8BC6 mov eax,esi
- 006E6A44 5A pop edx ; ss225.00400000
復(fù)制代碼 F7跟進(jìn) ctrl+f mov ecx,dword ptr ds:[esi+34] 下f2斷點(diǎn)運(yùn)行到此 - 00FF1064 8B4E 34 mov ecx,dword ptr ds:[esi+34]
- 00FF1067 85C9 test ecx,ecx
- 00FF1069 0F84 89000000 je 00FF10F8
- 00FF106F 034E 08 add ecx,dword ptr ds:[esi+8] ; ss225.00400000
- 00FF1072 51 push ecx
- 00FF1073 56 push esi
- 00FF1074 E8 47060000 call 00FF16C0
- 00FF1079 85C0 test eax,eax
- 00FF107B 74 7B je short 00FF10F8
- 00FF107D 8B95 BE1A0010 mov edx,dword ptr ss:[ebp+10001ABE]
- 00FF1083 8B8D C21A0010 mov ecx,dword ptr ss:[ebp+10001AC2]
- 00FF1089 85C9 test ecx,ecx
- 00FF108B 75 08 jnz short 00FF1095
- 00FF108D 8D8D 4E1E0010 lea ecx,dword ptr ss:[ebp+10001E4E]
- 00FF1093 EB 2D jmp short 00FF10C2
- 00FF1095 F7C1 00000080 test ecx,80000000
- 00FF109B 74 1E je short 00FF10BB
- 00FF109D 52 push edx ; ss225.00400000
- 00FF109E 81E1 FFFFFF7F and ecx,7FFFFFFF
- 00FF10A4 51 push ecx
復(fù)制代碼 程序運(yùn)行到 00FF1067 85C9 test ecx,ecx 00FF1069 /0F84 89000000 je 00FF10F8 強(qiáng)制跳轉(zhuǎn)
ecx=0024D000 清0 0024d000為ravsize 后面要用到
ctrl+g VirtualFree F9運(yùn)行1次 alt+f9返回 - 00FF1145 FF95 691F0010 call dword ptr ss:[ebp+10001F69] ; kernel32.VirtualFree
- 00FF114B 8B46 0C mov eax,dword ptr ds:[esi+C] //返回到此
- 00FF114E 03C7 add eax,edi ; ss225.00400000
- 00FF1150 5D pop ebp
- 00FF1151 5E pop esi
- 00FF1152 5F pop edi ; ss225.00400000
- 00FF1153 5B pop ebx
- 00FF1154 C3 retn
復(fù)制代碼 F8繼續(xù)跟蹤 - 006E6A28 8985 3F130010 mov dword ptr ss:[ebp+1000133F],eax ; ss225.0062D7E8
- 006E6A2E 8BF0 mov esi,eax ; ss225.0062D7E8
- 006E6A30 8B4B 14 mov ecx,dword ptr ds:[ebx+14]
- 006E6A33 5A pop edx ; ss225.00400000
- 006E6A34 EB 0C jmp short 006E6A42 ; ss225.006E6A42
- 006E6A36 03CA add ecx,edx ; ntdll.KiFastSystemCallRet
- 006E6A38 68 00800000 push 8000
- 006E6A3D 6A 00 push 0
- 006E6A3F 57 push edi
- 006E6A40 FF11 call dword ptr ds:[ecx] ; ntdll.7C92DA54
- 006E6A42 8BC6 mov eax,esi
- 006E6A44 5A pop edx ; ss225.00400000
- 006E6A45 5E pop esi ; ss225.00400000
- 006E6A46 5F pop edi ; ss225.00400000
- 006E6A47 59 pop ecx ; ss225.00400000
- 006E6A48 5B pop ebx ; ss225.00400000
- 006E6A49 5D pop ebp ; ss225.00400000
- 006E6A4A - FFE0 jmp eax //飛向光明 ss225.0062D7E8
復(fù)制代碼 - 0062D7E8 55 push ebp //oep
- 0062D7E9 8BEC mov ebp,esp
- 0062D7EB 83C4 F0 add esp,-10
- 0062D7EE B8 98CF6200 mov eax,62CF98
- 0062D7F3 E8 C09BDDFF call 004073B8 ; ss225.004073B8
- 0062D7F8 A1 D4A16300 mov eax,dword ptr ds:[63A1D4]
- 0062D7FD 8B00 mov eax,dword ptr ds:[eax]
- 0062D7FF E8 C8A3E5FF call 00487BCC ; ss225.00487BCC
- 0062D804 8B0D 409F6300 mov ecx,dword ptr ds:[639F40] ; ss225.0064CCE8
- 0062D80A A1 D4A16300 mov eax,dword ptr ds:[63A1D4]
- 0062D80F 8B00 mov eax,dword ptr ds:[eax]
- 0062D811 8B15 78C96000 mov edx,dword ptr ds:[60C978] ; ss225.0060C9C4
- 0062D817 E8 C8A3E5FF call 00487BE4 ; ss225.00487BE4
- 0062D81C A1 D4A16300 mov eax,dword ptr ds:[63A1D4]
- 0062D821 8B00 mov eax,dword ptr ds:[eax]
- 0062D823 E8 3CA4E5FF call 00487C64 ; ss225.00487C64
- 0062D828 E8 7B73DDFF call 00404BA8 ; ss225.00404BA8
- 0062D82D 8D40 00 lea eax,dword ptr ds:[eax]
復(fù)制代碼 ollydump插件dump lorppe修改ravsize= 0024d000 到這里應(yīng)該是完美脫殼了 ,但運(yùn)行脫殼的程序 一閃退出了 說明程序有自效驗(yàn) - 0061C27A /74 14 je short 0061C290 ; ss225.0061C290
- 0061C27C |8B45 F4 mov eax,dword ptr ss:[ebp-C] ; kernel32.7C839AA8
- 0061C27F |E8 247CDEFF call 00403EA8 ; ss225.00403EA8
- 0061C284 |A1 D4A16300 mov eax,dword ptr ds:[63A1D4]
- 0061C289 |8B00 mov eax,dword ptr ds:[eax]
- 0061C28B |E8 C0BAE6FF call 00487D50 ; ss225.00487D50
- 0061C290 \33C0 xor eax,eax ; ss225.0062D7E8
- 0061C292 5A pop edx ; kernel32.7C816FD7
- 0061C293 59 pop ecx ; kernel32.7C816FD7
- 0061C294 59 pop ecx ; kernel32.7C816FD7
- 0061C295 64:8910 mov dword ptr fs:[eax],edx ; ntdll.KiFastSystemCallRet
- 0061C298 68 ADC26100 push 61C2AD
- 0061C29D 8B45 F4 mov eax,dword ptr ss:[ebp-C] ; kernel32.7C839AA8
- 0061C2A0 E8 037CDEFF call 00403EA8 ; ss225.00403EA8
- 0061C2A5 C3 retn
- 0061C2A6 ^ E9 B583DEFF jmp 00404660 ; ss225.00404660
- 0061C2AB ^ EB F0 jmp short 0061C29D ; ss225.0061C29D
- 0061C2AD A1 D4A16300 mov eax,dword ptr ds:[63A1D4]
- 0061C2B2 8B00 mov eax,dword ptr ds:[eax]
- 0061C2B4 E8 EFB7E6FF call 00487AA8 ; ss225.00487AA8
- 0061C2B9 8B45 FC mov eax,dword ptr ss:[ebp-4]
- 0061C2BC 80B8 94110200 00 cmp byte ptr ds:[eax+21194],0
- 0061C2C3 75 0C jnz short 0061C2D1 ; ss225.0061C2D1
- 0061C2C5 A1 D4A16300 mov eax,dword ptr ds:[63A1D4]
- 0061C2CA 8B00 mov eax,dword ptr ds:[eax]
- 0061C2CC E8 7FBAE6FF call 00487D50 ; ss225.00487D50
復(fù)制代碼 修改 0061C27A 74為eb 0061C2C3 75為eb 保存文件脫殼去效驗(yàn)完成 ,感謝所有幫助過我的人
[ 本帖最后由 夜涼如水 于 2008-4-17 11:30 編輯 ] |