00511322 . 8B75 08 MOV ESI,DWORD PTR SS:[EBP+8] ; ESI = pMemory_Start
00511326 . 56 PUSH ESI
00511327 . 89F1 MOV ECX,ESI
00511329 . 034E 3C ADD ECX,DWORD PTR DS:[ESI+3C] ; ECX ->
'PE'
... ...
00511331 . F3:A4 REP MOVS BYTE PTR ES:[EDI],BYTE PTR DS:[>; 写入刚才分配的内存00400000处
... ...
00511348 . 0FB640 06 MOVZX EAX,BYTE PTR DS:[EAX+6] ; [PE+6] = (4) 读取节的个数
... ...
0051134D > 8D7D C8 LEA EDI,DWORD PTR SS:[EBP-38] ; 下面这个循环,向0040000处部署PE
00511351 . 57 PUSH EDI
00511352 . 6A 0A PUSH 0A
00511354 . 59 POP ECX
00511355 . F3:A5 REP MOVS DWORD PTR ES:[EDI],DWORD PTR DS>00511357 . 5F POP EDI
00511359 . 8B57 14 MOV EDX,DWORD PTR DS:[EDI+14] ; Size(400)
0051135D . 85D2 TEST EDX,EDX
0051135F . 74 1B JE SHORT mydu1.0051137C
00511362 . 56 PUSH ESI
00511363 . 8B75 08 MOV ESI,DWORD PTR SS:[EBP+8] ; pMemory_Start
00511367 . 01D6 ADD ESI,EDX ; 增加之前的节大小
0051136A . 8B4F 10 MOV ECX,DWORD PTR DS:[EDI+10]
0051136E . 8B57 0C MOV EDX,DWORD PTR DS:[EDI+C] ; 对齐后大小
00511372 . 8B7D F4 MOV EDI,DWORD PTR SS:[EBP-C] ; Base
00511376 . 01D7 ADD EDI,EDX ; Base + 对齐后大小
00511379 . F3:A4 REP MOVS BYTE PTR ES:[EDI],BYTE PTR DS:[>; 向对齐后的开始位置写入数据
0051137B . 5E POP ESI
0051137C > 48 DEC EAX ; 节数-1
0051137E .^ 75 CD JNZ SHORT mydu1.0051134D
; ???
00511431 > 90 NOP ; 貌似是查找Ldr的循环
00511432 . 8B50 18 MOV EDX,DWORD PTR DS:[EAX+18] ; EDX=pMemory_Start
... ...
0051146B . 3930 CMP DWORD PTR DS:[EAX],ESI ; [EAX] == PEB.Ldr
0051146D . 74 06 JE SHORT mydu1.00511475
0051146F . 8B00 MOV EAX,DWORD PTR DS:[EAX]
00511472 .^ EB BD JMP SHORT mydu1.00511431
00511475 > 90 NOP ; 此时 [EAX]=Ldr
00511476 . 8B9D 88FEFFFF MOV EBX,DWORD PTR SS:[EBP-178] ; EBX=4000
0051147D . 85DB TEST EBX,EBX
0051147F . 0F84 9E000000 JE mydu1.00511523
00511485 . 8B75 F4 MOV ESI,DWORD PTR SS:[EBP-C] ; ESI = Base
00511488 . 01F3 ADD EBX,ESI ; 00404000 - 重定位表
0051148B > 90 NOP ; 手动重定位??
0051148C . 8B43 0C MOV EAX,DWORD PTR DS:[EBX+C]
0051148F . 85C0 TEST EAX,EAX
00511491 . 0F84 8C000000 JE mydu1.00511523
00511498 . 8B4B 10 MOV ECX,DWORD PTR DS:[EBX+10]
0051149C . 01F1 ADD ECX,ESI ; at 00404044
0051149F . 894D C4 MOV DWORD PTR SS:[EBP-3C],ECX
005114A3 . 8B0B MOV ECX,DWORD PTR DS:[EBX]
005114A6 . 85C9 TEST ECX,ECX
005114A8 . 75 04 JNZ SHORT mydu1.005114AE
005114AA . 8B4B 10 MOV ECX,DWORD PTR DS:[EBX+10]
005114AE > 01F1 ADD ECX,ESI
005114B1 . 894D C0 MOV DWORD PTR SS:[EBP-40],ECX
005114B5 . 01F0 ADD EAX,ESI ; EAX = DLL name
005114B8 . 50 PUSH EAX
005114BA . 8B45 10 MOV EAX,DWORD PTR SS:[EBP+10]
005114BE . FF10 CALL DWORD PTR DS:[EAX] ; LoadLibraryA(Kernel32)
005114C1 . 85C0 TEST EAX,EAX
005114C3 . 0F84 6A010000 JE mydu1.00511633
005114CC . 89C7 MOV EDI,EAX ; EDI = Kernel32 Base
005114D0 . 8B4D C0 MOV ECX,DWORD PTR SS:[EBP-40]
005114D4 . 8B11 MOV EDX,DWORD PTR DS:[ECX]
005114D7 . 85D2 TEST EDX,EDX
005114D9 . 74 3B JE SHORT mydu1.00511516
005114DC . F7C2 00000080 TEST EDX,80000000
005114E2 . 74 0B JE SHORT mydu1.005114EF
005114E5 . 81E2 FFFFFF7F AND EDX,7FFFFFFF
005114EC . EB 0A JMP SHORT mydu1.005114F8
005114F0 . 01F2 ADD EDX,ESI
005114F4 . 42 INC EDX
005114F6 . 42 INC EDX ; EDX = API Name
005114F8 > 52 PUSH EDX
005114FA . 57 PUSH EDI
005114FC . 8B45 0C MOV EAX,DWORD PTR SS:[EBP+C]
[COLOR=
"Red"
]00511500 . FF10 CALL DWORD PTR DS:[EAX] ; Out Here!
00511503 . 8B4D C4 MOV ECX,DWORD PTR SS:[EBP-3C]
00511507 . 8901 MOV DWORD PTR DS:[ECX],EAX
00511509 . 8345 C4 04 ADD DWORD PTR SS:[EBP-3C],4
0051150E . 8345 C0 04 ADD DWORD PTR SS:[EBP-40],4
00511513 .^ EB BA JMP SHORT mydu1.005114CF
[COLOR=
"DarkOrchid"
]00511516 > 90 NOP ; F4 Here!
00511517 . 83C3 14 ADD EBX,14
0051151B .^ E9 6BFFFFFF JMP mydu1.0051148B