好友
阅读权限10
听众
最后登录1970-1-1
|
本帖最后由 zhaohj 于 2016-12-26 16:03 编辑
我把试验品的过程写一下:
OEP:004016e9
过程:
1:代码段设置内存写入断点,F9运行,弹出对话框,点确定
2:中断后取消内存写入断点,来到
005AC849 8906 mov dword ptr ds:[esi],eax
005AC84B 896C24 40 mov dword ptr ss:[esp+0x40],ebp
005AC84F 8B6F 04 mov ebp,dword ptr ds:[edi+0x4]
005AC852 894424 34 mov dword ptr ss:[esp+0x34],eax
005AC856 894E 04 mov dword ptr ds:[esi+0x4],ecx
005AC859 8B47 08 mov eax,dword ptr ds:[edi+0x8]
005AC85C 8956 08 mov dword ptr ds:[esi+0x8],edx
005AC85F 895424 3C mov dword ptr ss:[esp+0x3C],edx
005AC863 8B5424 40 mov edx,dword ptr ss:[esp+0x40]
005AC867 894C24 38 mov dword ptr ss:[esp+0x38],ecx
005AC86B 8B4F 0C mov ecx,dword ptr ds:[edi+0xC]
005AC86E 894424 2C mov dword ptr ss:[esp+0x2C],eax
005AC872 8B4424 48 mov eax,dword ptr ss:[esp+0x48]
005AC876 8956 0C mov dword ptr ds:[esi+0xC],edx
005AC879 83C4 10 add esp,0x10
005AC87C 74 01 je short Win32_Bo.005AC87F
005AC87E 83C7 10 add edi,0x10
3:搜索特征码 5F 5B 8B 45 F8 5E C9 C2 04 00,找到
0040C658 5F pop edi ; Win32_Bo.00401010
0040C659 5B pop ebx
0040C65A 8B45 F8 mov eax,dword ptr ss:[ebp-0x8]
0040C65D 5E pop esi ; Win32_Bo.00401010
0040C65E C9 leave
0040C65F C2 0400 retn 0x4
在retn处设置F2下断,F9运行,断下后取消F2断点
4:搜索特征码5F 5E 5B 1B C0 F7 D0 25 ?? ?? ?? ?? C9 C2 08 00,找到
0040DB6E 5F pop edi ; Win32_Bo.0040C1F2
0040DB6F 5E pop esi ; Win32_Bo.0040C1F2
0040DB70 5B pop ebx ; Win32_Bo.0040C1F2
0040DB71 1BC0 sbb eax,eax
0040DB73 F7D0 not eax
0040DB75 25 AF044100 and eax,0x4104AF
0040DB7A C9 leave
0040DB7B C2 0800 retn 0x8
再retn处设置F2断点,
向上翻,找到
0040D8B4 83C0 04 add eax,0x4
0040D8B7 8945 F0 mov dword ptr ss:[ebp-0x10],eax
0040D8BA 8B45 F4 mov eax,dword ptr ss:[ebp-0xC]
0040D8BD 3B05 00674200 cmp eax,dword ptr ds:[0x426700] ; kernel32.75E80000
0040D8C3 0F85 EF000000 jnz Win32_Bo.0040D9B8 //改成JMP
0040D8C9 B8 6BE995C6 mov eax,0xC695E96B
0040D8CE 3BD0 cmp edx,eax
0040D8D0 0F87 88000000 ja Win32_Bo.0040D95E
0040D8D6 74 7F je short Win32_Bo.0040D957
0040D8D8 81FA 6381D90F cmp edx,0xFD98163
0040D8DE 74 70 je short Win32_Bo.0040D950
0040D8E0 81FA 9EF9FB36 cmp edx,0x36FBF99E
再向上翻,找到
0040D7DA 395D F4 cmp dword ptr ss:[ebp-0xC],ebx
0040D7DD 8B16 mov edx,dword ptr ds:[esi]
0040D7DF 8955 08 mov dword ptr ss:[ebp+0x8],edx ; Win32_Bo.00407478
0040D7E2 75 1E jnz short Win32_Bo.0040D802 //改成JMP
0040D7E4 81FA 7ED8EC73 cmp edx,0x73ECD87E
0040D7EA 75 07 jnz short Win32_Bo.0040D7F3
0040D7EC BB AF044100 mov ebx,Win32_Bo.004104AF
0040D7F1 EB 30 jmp short Win32_Bo.0040D823
0040D7F3 81FA 83B9BA78 cmp edx,0x78BAB983
0040D7F9 75 07 jnz short Win32_Bo.0040D802
0040D7FB BB EB044100 mov ebx,Win32_Bo.004104EB
0040D800 EB 21 jmp short Win32_Bo.0040D823
0040D802 25 00020000 and eax,0x200
0040D807 50 push eax
0040D808 68 1ABD4100 push Win32_Bo.0041BD1A ; jmp 到 kernel32.GetModuleHandleA
F9运行,取消F2断点,数据窗口来到00407000,查看IAT
00407000 75174DE0 GDI32.GetDeviceCaps
00407004 75175689 GDI32.DeleteObject
00407008 751754F4 GDI32.CreateCompatibleDC
0040700C 75175F48 GDI32.CreateCompatibleBitmap
00407010 75174F70 GDI32.SelectObject
00407014 7517B64F GDI32.Rectangle
00407018 751A3E0D GDI32.CreateHatchBrush
0040701C 751752D8 GDI32.SetBkColor
00407020 751A48F6 GDI32.Ellipse
00407024 751758B3 GDI32.DeleteDC
00407028 75175EA5 GDI32.BitBlt
0040702C 75174EB8 GDI32.GetStockObject
00407030 00000000
00407034 75E91916 kernel32.GetStringTypeW
00407038 75E91789 kernel32.LCMapStringW
0040703C 75E918FE kernel32.MultiByteToWideChar
00407040 75EBBC39 kernel32.LCMapStringA
00407044 75EAD5CD kernel32.GetLocaleInfoA
00407048 75E942FF kernel32.VirtualProtect
ok,IAT很完整
F7单步走,来到004016e9,这个就是OEP
|
|