Function at 0x403470
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x429d78
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
push ebx
push esi
push edi
mov eax, dword [0x4392c0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x2c], edx
mov esi, ecx
cmp dword [esi + 4], 0xffffffff
jne 0x4034d3
push ecx
push 0
push 0
call fcn.0040fee0
test al, al
jne 0x4034d3
cmp dword [0x43bb1c], 1
jl 0x4034bf
call fcn.00406ac0
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 0
push ecx
mov eax, esp
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x44]
mov dword [eax], 0x2000
call fcn.00406b50
lea eax, [ebp - 0x44]
push eax
mov ecx, esi
call fcn.0040ffb0
mov ebx, dword [ebp - 0x44]
test al, al
jne 0x40352e
cmp dword [0x43bb1c], 1
jl 0x403750
mov ecx, str.Error_reading_exe_file
call fcn.00406bc0
jmp 0x403750
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x14]
call fcn.00407680
cmp dword [ebp - 0x14], 0x40
jae 0x40355c
cmp dword [0x43bb1c], 1
jl 0x403750
mov ecx, str.No_data_read_from_exe_file
call fcn.00406bc0
jmp 0x403750
mov eax, 0x5a4d
cmp ax, word [ebx]
je 0x403582
cmp dword [0x43bb1c], 1
jl 0x403750
mov ecx, str.Invalid_magic_number_in_DOS_header
call fcn.00406bc0
jmp 0x403750
mov edi, dword [ebx + 0x3c]
mov dword [ebp - 0x24], edi
lea esi, [edi + 0xf8]
cmp esi, edi
jae 0x4035a6
mov al, byte [ebp - 0xd]
mov byte [ebp - 0xd], al
push 0x436504
lea eax, [ebp - 0xd]
push eax
call fcn.0041877b
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x1c], esi
call fcn.00407680
cmp esi, dword [ebp - 0x14]
jbe 0x4035ff
cmp dword [0x43bb1c], 1
jl 0x403750
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x14]
call fcn.00407680
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x38]
push eax
push ecx
lea edx, [ebp - 0x30]
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x2c], 0
call fcn.00406c50
add esp, 8
jmp 0x403750
cmp byte [ebx + edi], 0x50
jne 0x403742
cmp byte [ebx + edi + 1], 0x45
jne 0x403742
cmp byte [ebx + edi + 2], 0
jne 0x403742
cmp byte [ebx + edi + 3], 0
jne 0x403742
lea ecx, [ebx + 4]
add ecx, edi
mov eax, 0xe0
mov dword [ebp - 0x20], ecx
cmp ax, word [ecx + 0x10]
je 0x403659
cmp dword [0x43bb1c], 1
jl 0x403750
mov ecx, str.Invalid_optional_header_size
call fcn.00406bc0
jmp 0x403750
mov eax, 0x10b
cmp ax, word [ebx + edi + 0x18]
je 0x40367c
cmp dword [0x43bb1c], 1
jl 0x403750
call fcn.00406db0
jmp 0x403750
push ecx
mov eax, esp
lea edx, [ebp - 0x14]
mov dword [eax], 0x28
movzx eax, word [ecx + 2]
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x14], eax
call fcn.00405d70
add esp, 4
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x14]
call fcn.00407680
lea eax, [ebp - 0x18]
push eax
lea edx, [ebp - 0x1c]
lea ecx, [ebp - 0x34]
call fcn.00405d40
mov eax, dword [eax]
add esp, 4
cmp eax, dword [ebp - 0x14]
jbe 0x4036d3
cmp dword [0x43bb1c], 1
jl 0x403750
call fcn.00406e40
jmp 0x403750
mov ecx, dword [ebp - 0x20]
xor esi, esi
movzx edx, word [ecx + 2]
movzx eax, word [ecx + 0x10]
xor edi, edi
test edx, edx
je 0x403701
add eax, 0x28
add eax, ecx
jmp 0x4036f0
mov ecx, dword [eax]
cmp ecx, esi
jbe 0x4036fb
mov edi, dword [eax - 4]
mov esi, ecx
add eax, 0x28
dec edx
jne 0x4036f0
mov ecx, dword [ebp - 0x24]
xor edx, edx
mov ecx, dword [ebx + ecx + 0x3c]
mov eax, edi
div ecx
test edx, edx
je 0x403716
sub ecx, edx
add edi, ecx
lea eax, [ebp - 0x24]
push eax
lea edx, [ebp - 0x20]
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x20], esi
call fcn.00405d40
mov ecx, dword [ebp - 0x2c]
mov eax, dword [eax]
add esp, 4
mov dword [ecx], eax
mov dword [ecx + 4], 0
mov byte [ebp - 0xd], 1
jmp 0x403754
cmp dword [0x43bb1c], 1
jl 0x403750
call fcn.00406d20
mov byte [ebp - 0xd], 0
test ebx, ebx
je 0x403761
push ebx
call fcn.00416924
add esp, 4
mov al, byte [ebp - 0xd]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret