VC6源代码是:
#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
MessageBox (NULL, TEXT ("Hello, Windows 98!"), TEXT ("HelloMsg"), 0) ;
return 0 ;
}
以上是一个非常简单的源代码,然后我把他编译生成EXE文件后 用OD把汇编后看到的代码好多我搞不清哪些是要的,哪些不需要的.请帮我大致讲一下,如何才能确认以上的源代码与反汇编后的代码对应起来,
004010C0 >/$ 55 push ebp
004010C1 |. 8BEC mov ebp, esp
004010C3 |. 6A FF push -1
004010C5 |. 68 30014200 push 00420130
004010CA |. 68 A42C4000 push 00402CA4 ; SE 处理程序安装
004010CF |. 64:A1 0000000>mov eax, dword ptr fs:[0]
004010D5 |. 50 push eax
004010D6 |. 64:8925 00000>mov dword ptr fs:[0], esp
004010DD |. 83C4 A4 add esp, -5C
004010E0 |. 53 push ebx
004010E1 |. 56 push esi
004010E2 |. 57 push edi
004010E3 |. 8965 E8 mov dword ptr [ebp-18], esp
004010E6 |. FF15 94514200 call dword ptr [<&KERNEL32.GetVersion>] ; kernel32.GetVersion
004010EC |. A3 E0354200 mov dword ptr [4235E0], eax
004010F1 |. A1 E0354200 mov eax, dword ptr [4235E0]
004010F6 |. C1E8 08 shr eax, 8
004010F9 |. 25 FF000000 and eax, 0FF
004010FE |. A3 EC354200 mov dword ptr [4235EC], eax
00401103 |. 8B0D E0354200 mov ecx, dword ptr [4235E0]
00401109 |. 81E1 FF000000 and ecx, 0FF
0040110F |. 890D E8354200 mov dword ptr [4235E8], ecx
00401115 |. 8B15 E8354200 mov edx, dword ptr [4235E8]
0040111B |. C1E2 08 shl edx, 8
0040111E |. 0315 EC354200 add edx, dword ptr [4235EC]
00401124 |. 8915 E4354200 mov dword ptr [4235E4], edx
0040112A |. A1 E0354200 mov eax, dword ptr [4235E0]
0040112F |. C1E8 10 shr eax, 10
00401132 |. 25 FFFF0000 and eax, 0FFFF
00401137 |. A3 E0354200 mov dword ptr [4235E0], eax
0040113C |. 6A 00 push 0 ; /Arg1 = 00000000
0040113E |. E8 7D190000 call 00402AC0 ; \HelloMsg.00402AC0
00401143 |. 83C4 04 add esp, 4
00401146 |. 85C0 test eax, eax
00401148 |. 75 0A jnz short 00401154
0040114A |. 6A 1C push 1C
0040114C |. E8 FF000000 call 00401250
00401151 |. 83C4 04 add esp, 4
00401154 |> C745 FC 00000>mov dword ptr [ebp-4], 0
0040115B |. E8 F0150000 call 00402750
00401160 |. FF15 90514200 call dword ptr [<&KERNEL32.GetCommandLineA>] ; [GetCommandLineA
00401166 |. A3 2C4F4200 mov dword ptr [424F2C], eax
0040116B |. E8 C0130000 call 00402530
00401170 |. A3 C4354200 mov dword ptr [4235C4], eax
00401175 |. E8 A60E0000 call 00402020
0040117A |. E8 510D0000 call 00401ED0
0040117F |. E8 AC080000 call 00401A30
00401184 |. C745 D0 00000>mov dword ptr [ebp-30], 0
0040118B |. 8D4D A4 lea ecx, dword ptr [ebp-5C]
0040118E |. 51 push ecx ; /pStartupinfo
0040118F |. FF15 8C514200 call dword ptr [<&KERNEL32.GetStartupInfoA>] ; \GetStartupInfoA
00401195 |. E8 760C0000 call 00401E10
0040119A |. 8945 9C mov dword ptr [ebp-64], eax
0040119D |. 8B55 D0 mov edx, dword ptr [ebp-30]
004011A0 |. 83E2 01 and edx, 1
004011A3 |. 85D2 test edx, edx
004011A5 |. 74 0D je short 004011B4
004011A7 |. 8B45 D4 mov eax, dword ptr [ebp-2C]
004011AA |. 25 FFFF0000 and eax, 0FFFF
004011AF |. 8945 94 mov dword ptr [ebp-6C], eax
004011B2 |. EB 07 jmp short 004011BB
004011B4 |> C745 94 0A000>mov dword ptr [ebp-6C], 0A
004011BB |> 8B4D 94 mov ecx, dword ptr [ebp-6C]
004011BE |. 51 push ecx
004011BF |. 8B55 9C mov edx, dword ptr [ebp-64]
004011C2 |. 52 push edx
004011C3 |. 6A 00 push 0
004011C5 |. 6A 00 push 0 ; /pModule = NULL
004011C7 |. FF15 88514200 call dword ptr [<&KERNEL32.GetModuleHandleA>] ; \GetModuleHandleA
004011CD |. 50 push eax
004011CE |. E8 32FEFFFF call 00401005
004011D3 |. 8945 A0 mov dword ptr [ebp-60], eax
004011D6 |. 8B45 A0 mov eax, dword ptr [ebp-60]
004011D9 |. 50 push eax
004011DA |. E8 91080000 call 00401A70
004011DF |. 8B4D EC mov ecx, dword ptr [ebp-14]
004011E2 |. 8B11 mov edx, dword ptr [ecx]
004011E4 |. 8B02 mov eax, dword ptr [edx]
004011E6 |. 8945 98 mov dword ptr [ebp-68], eax
004011E9 |. 8B4D EC mov ecx, dword ptr [ebp-14]
004011EC |. 51 push ecx ; /Arg2
004011ED |. 8B55 98 mov edx, dword ptr [ebp-68] ; |
004011F0 |. 52 push edx ; |Arg1
004011F1 |. E8 0A0A0000 call 00401C00 ; \HelloMsg.00401C00
004011F6 |. 83C4 08 add esp, 8
004011F9 \. C3 retn
004011FA . 8B65 E8 mov esp, dword ptr [ebp-18]
004011FD . 8B45 98 mov eax, dword ptr [ebp-68]
00401200 . 50 push eax
00401201 . E8 8A080000 call 00401A90
00401206 . 8B4D F0 mov ecx, dword ptr [ebp-10]
00401209 . 64:890D 00000>mov dword ptr fs:[0], ecx
00401210 . 5F pop edi
00401211 . 5E pop esi
00401212 . 5B pop ebx
00401213 . 8BE5 mov esp, ebp
00401215 . 5D pop ebp
00401216 . C3 retn
00401217 CC int3
00401218 CC int3
00401219 CC int3
0040121A CC int3
0040121B CC int3
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课