先从上下载基于win32的upx加密程序。
用vc6.0编写一个基于对话框的MFC程序,默认的框架就OK了。
为upx创建快捷方式到sendto文件夹,即添加到右键菜单。
对程序进行加密。
1.使用esp定律
1 00439DF7 8D4424 80 lea eax,dword ptr ss:[esp-80]2 00439DFB 6A 00 push 03 00439DFD 39C4 cmp esp,eax4 00439DFF ^ 75 FA jnz short test.00439DFB5 00439E01 83EC 80 sub esp,-806 00439E04 - E9 3DF5FCFF jmp test.00409346
这样,就直接跳到oep了。
2.内存镜像法:
先在程序的.rsrc上下断,运行
跳到00439d92,然后单步跟踪就可以了。
1 00439D92 FF96 B09D0300 call dword ptr ds:[esi+39DB0] ; kernel32.LoadLibraryA 2 00439D98 95 xchg eax,ebp 3 00439D99 8A07 mov al,byte ptr ds:[edi] 4 00439D9B 47 inc edi 5 00439D9C 08C0 or al,al 6 00439D9E ^ 74 DC je short test.00439D7C 7 00439DA0 89F9 mov ecx,edi 8 00439DA2 79 07 jns short test.00439DAB 9 00439DA4 0FB707 movzx eax,word ptr ds:[edi]10 00439DA7 47 inc edi11 00439DA8 50 push eax12 00439DA9 47 inc edi13 00439DAA B9 5748F2AE mov ecx,AEF2485714 00439DAF 55 push ebp15 00439DB0 FF96 B49D0300 call dword ptr ds:[esi+39DB4]16 00439DB6 09C0 or eax,eax17 00439DB8 74 07 je short test.00439DC118 00439DBA 8903 mov dword ptr ds:[ebx],eax19 00439DBC 83C3 04 add ebx,420 00439DBF ^ EB D8 jmp short test.00439D9921 00439DC1 FF96 C49D0300 call dword ptr ds:[esi+39DC4]22 00439DC7 8BAE B89D0300 mov ebp,dword ptr ds:[esi+39DB8]23 00439DCD 8DBE 00F0FFFF lea edi,dword ptr ds:[esi-1000]24 00439DD3 BB 00100000 mov ebx,100025 00439DD8 50 push eax26 00439DD9 54 push esp27 00439DDA 6A 04 push 428 00439DDC 53 push ebx29 00439DDD 57 push edi30 00439DDE FFD5 call ebp31 00439DE0 8D87 07020000 lea eax,dword ptr ds:[edi+207]32 00439DE6 8020 7F and byte ptr ds:[eax],7F33 00439DE9 8060 28 7F and byte ptr ds:[eax+28],7F34 00439DED 58 pop eax35 00439DEE 50 push eax36 00439DEF 54 push esp37 00439DF0 50 push eax38 00439DF1 53 push ebx39 00439DF2 57 push edi40 00439DF3 FFD5 call ebp41 00439DF5 58 pop eax42 00439DF6 61 popad43 00439DF7 8D4424 80 lea eax,dword ptr ss:[esp-80]44 00439DFB 6A 00 push 045 00439DFD 39C4 cmp esp,eax46 00439DFF ^ 75 FA jnz short test.00439DFB47 00439E01 83EC 80 sub esp,-8048 00439E04 - E9 3DF5FCFF jmp test.00409346