我很熟练的OD,不到10秒,不!是5秒,一个断点,两下F8,于是我到了OEP,LOAD直接DUMP发现竟然是4KB,我晕了.....
直接拿WINHEX,从内存提出来LOADPE重建搞定.发现这样的脱壳不完美首先运行不起来.而且后来修复后,运行,
发现也不正常,于是我用UPX -D么想到提示:
//-----------------------------------------------------------------------------------------------
E:\软件加密解密\脱壳工具\UPX\upx303w>upx -d gameguard.des
Ultimate Packer for eXecutables
Copyright (C) 1996 - 2008
UPX 3.03w Markus Oberhumer, Laszlo Molnar & John Reiser Apr 27th 2008
File size Ratio Format Name
-------------------- ------ ----------- -----------
upx: gameguard.des: CantUnpackException: file is modified/hacked/protected; take
care!!!
3:
//--------------------------------------------------------------------------------------------
00422C24 8B02 mov eax, dword ptr [edx] ; edx = code address
00422C26 83C2 04 add edx, 4 ; edx += 4
00422C29 8907 mov dword ptr [edi], eax ; edi =code address
00422C2B 83C7 04 add edi, 4 ; edi += 4
00422C2E 83E9 04 sub ecx, 4 ; ecx -= 4
00422C31 ^ 77 F1 ja short 00422C24 ; ecx > 0 ->loop
00422C33 01CF add edi, ecx ; edi += ecx
经过上面三段后,代码已经被解开了,现在需要做什么呢?我们来看看就知道了,毕竟我还在看.可以看到的是,前面的代码
计算不是很难的,如果两段一样的代码它就直接复制一下了.估计应该是API了吧.
4:
//-------------------------------------------------------------------------------------------
00422C3A 5E pop esi
00422C3B 89F7 mov edi, esi ; esi = code begin address
00422C3D B9 37060000 mov ecx, 637 ; ecx = 637
00422C42 8A07 mov al, byte ptr [edi] ; edi = code address
00422C44 47 inc edi ; edi ++
00422C45 2C E8 sub al, 0E8 ; al - e8
00422C47 3C 01 cmp al, 1 ; al > 1 ->loop
00422C49 ^ 77 F7 ja short 00422C42 ; 寻找是CALL或JMP指令
00422C4B 803F 07 cmp byte ptr [edi], 7 ; [edi] ? 7
00422C4E ^ 75 F2 jnz short 00422C42 ; !=7 ->jmp
00422C50 8B07 mov eax, dword ptr [edi] ; call xxxx read xxxx->eax
00422C52 8A5F 04 mov bl, byte ptr [edi+4] ; [edi + 4] ->bl
00422C55 66:C1E8 08 shr ax, 8 ; ax >> 8
00422C59 C1C0 10 rol eax, 10 ; eax ROL 10
00422C5C 86C4 xchg ah, al
00422C5E 29F8 sub eax, edi ; eax -edi
00422C60 80EB E8 sub bl, 0E8 ; bl -e8
00422C63 01F0 add eax, esi ; eax + esi
00422C65 8907 mov dword ptr [edi], eax ; eax ->call xxxx write xxxx
00422C67 83C7 05 add edi, 5 ; edi + 5
00422C6A 89D8 mov eax, ebx ; eax =ebx
00422C6C ^ E2 D9 loopd short 00422C47 ; 计算地址修改CALL和JMP
5:
//--------------------------------------------------------------------------------------------------
00422C6E 8DBE 00000200 lea edi, dword ptr [esi+20000] ; esi + 20000 esi = code begin
; address 到了输入表函数名部分
00422C74 8B07 mov eax, dword ptr [edi] ; eax = [edi]
00422C76 09C0 or eax, eax
00422C78 74 45 je short 00422CBF ; eax = 0 -> jmp
00422C7A 8B5F 04 mov ebx, dword ptr [edi+4]
00422C7D 8D8430 602B0200 lea eax, dword ptr [eax+esi+22B60] ; dll name address
00422C84 01F3 add ebx, esi
00422C86 50 push eax ; dll name
00422C87 83C7 08 add edi, 8
00422C8A FF96 D82B0200 call dword ptr [esi+22BD8] ; load dll
00422C90 95 xchg eax, ebp
00422C91 8A07 mov al, byte ptr [edi]
00422C93 47 inc edi ; edi ++
00422C94 08C0 or al, al ; al | al
00422C96 ^ 74 DC je short 00422C74
00422C98 89F9 mov ecx, edi ; edi = fun address
00422C9A 79 07 jns short 00422CA3
00422C9C 0FB707 movzx eax, word ptr [edi]
00422C9F 47 inc edi
00422CA3 57 push edi ; edi = fun name
00422CA4 48 dec eax ; eax --
00422CA5 F2:AE repne scas byte ptr es:[edi]
00422CA7 55 push ebp ; dll HANDLE
00422CA8 FF96 DC2B0200 call dword ptr [esi+22BDC]
00422CAE 09C0 or eax, eax
00422CB0 74 07 je short 00422CB9
00422CB2 8903 mov dword ptr [ebx], eax ; ebx = IAT address
00422CB4 83C3 04 add ebx, 4
00422CB7 ^ EB D8 jmp short 00422C91 ; 循环处理函数