Function at 0x4021e9
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
and dword [ebp - 4], 0
push ebx
push esi
push edi
push 0x40
push dword [ebp + 0xc]
call fcn.00402457
pop ecx
test eax, eax
pop ecx
je 0x40243d
mov esi, dword [ebp + 8]
cmp word [esi], 0x5a4d
je 0x402224
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40243d
mov eax, dword [esi + 0x3c]
add eax, 0xf8
push eax
push dword [ebp + 0xc]
call fcn.00402457
pop ecx
test eax, eax
pop ecx
je 0x40243d
mov edi, dword [esi + 0x3c]
add edi, esi
cmp dword [edi], 0x4550
jne 0x402214
cmp word [edi + 4], 0x14c
jne 0x402214
mov ebx, dword [edi + 0x38]
test bl, 1
jne 0x402214
movzx eax, word [edi + 0x14]
movzx edx, word [edi + 6]
test edx, edx
lea eax, [eax + edi + 0x18]
jbe 0x40228c
lea ecx, [eax + 0xc]
mov esi, dword [ecx + 4]
mov eax, dword [ecx]
test esi, esi
jne 0x40227c
add eax, ebx
jmp 0x40227e
add eax, esi
cmp eax, dword [ebp - 4]
jbe 0x402286
mov dword [ebp - 4], eax
add ecx, 0x28
dec edx
jne 0x40226f
push 0x40ebe8
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
test eax, eax
je 0x40243d
push 0
push 0x40f55c
push eax
call dword [ebp + 0x1c]
add esp, 0xc
test eax, eax
je 0x40243d
lea ecx, [ebp - 0x28]
push ecx
call eax
mov eax, dword [ebp - 0x24]
mov edx, dword [edi + 0x50]
lea esi, [edx + eax - 1]
mov edx, dword [ebp - 4]
lea ecx, [eax - 1]
not ecx
lea eax, [eax + edx - 1]
and esi, ecx
and eax, ecx
cmp esi, eax
jne 0x402214
push dword [ebp + 0x24]
push 4
push 0x3000
push esi
push dword [edi + 0x34]
call dword [ebp + 0x10]
mov ebx, eax
add esp, 0x14
test ebx, ebx
jne 0x40230f
push dword [ebp + 0x24]
push 4
push 0x3000
push esi
push eax
call dword [ebp + 0x10]
mov ebx, eax
add esp, 0x14
test ebx, ebx
je 0x402336
push 0x3c
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
jne 0x40233d
push dword [ebp + 0x24]
push 0x8000
push eax
push ebx
call dword [ebp + 0x14]
add esp, 0x10
push 0xe
jmp 0x402219
mov dword [esi + 4], ebx
mov ax, word [edi + 0x16]
shr eax, 0xd
and eax, 1
mov dword [esi + 0x14], eax
mov eax, dword [ebp + 0x10]
mov dword [esi + 0x1c], eax
mov eax, dword [ebp + 0x14]
mov dword [esi + 0x20], eax
mov eax, dword [ebp + 0x18]
mov dword [esi + 0x24], eax
mov eax, dword [ebp + 0x1c]
mov dword [esi + 0x28], eax
mov eax, dword [ebp + 0x20]
mov dword [esi + 0x2c], eax
mov eax, dword [ebp + 0x24]
mov dword [esi + 0x30], eax
mov eax, dword [ebp - 0x24]
mov dword [esi + 0x38], eax
push dword [edi + 0x54]
push dword [ebp + 0xc]
call fcn.00402457
pop ecx
test eax, eax
pop ecx
je 0x402436
push dword [ebp + 0x24]
push 4
push 0x1000
push dword [edi + 0x54]
push ebx
call dword [ebp + 0x10]
push dword [edi + 0x54]
mov dword [ebp + 0x24], eax
push dword [ebp + 8]
push eax
call sub.MSVCRT.dll_memcpy
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0x24]
push esi
push edi
mov eax, dword [ecx + 0x3c]
push dword [ebp + 0xc]
add eax, edx
mov dword [esi], eax
push ecx
mov dword [eax + 0x34], ebx
call fcn.00402470
add esp, 0x30
test eax, eax
je 0x402436
mov eax, dword [esi]
mov eax, dword [eax + 0x34]
sub eax, dword [edi + 0x34]
je 0x4023e9
push eax
push esi
call fcn.00402758
pop ecx
mov dword [esi + 0x18], eax
pop ecx
push 1
pop edi
jmp 0x4023ef
push 1
pop edi
mov dword [esi + 0x18], edi
push esi
call fcn.004027df
test eax, eax
pop ecx
je 0x402436
push esi
call fcn.0040254b
test eax, eax
pop ecx
je 0x402436
push esi
call fcn.0040271d
test eax, eax
pop ecx
je 0x402436
mov eax, dword [esi]
xor ecx, ecx
mov eax, dword [eax + 0x28]
cmp eax, ecx
je 0x40244d
cmp dword [esi + 0x14], ecx
je 0x402446
push ecx
push edi
add eax, ebx
push ebx
call eax
test eax, eax
jne 0x402441
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
push esi
call fcn.004029cc
pop ecx
xor eax, eax
jmp 0x402452
mov dword [esi + 0x10], edi
jmp 0x402450
add eax, ebx
mov dword [esi + 0x34], eax
jmp 0x402450
mov dword [esi + 0x34], ecx
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret