Function at 0x40e22d
Capabilities:
Parse pe header

Disassembly:
mov eax, 0x418118
call fcn.00416540
sub esp, 0x1d0
push ebx
push esi
push edi
mov dword [ebp - 0x10], esp
and dword [ebp - 4], 0
and byte [ebp - 0x8c], 0
push 9
pop ecx
xor eax, eax
lea edi, [ebp - 0x8b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov dword [ebp - 0x64], 0x20000020
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x58], esi
lea eax, [ebp - 0x60]
push eax
push 0x40
lea eax, [ebp - 0x54]
push eax
push esi
push dword [ebp + 8]
call dword [ebp + 0x18]
test eax, eax
je 0x40e2c1
cmp dword [ebp - 0x60], 0x40
jne 0x40e2c1
push 1
pop ebx
mov dword [ebp - 0x1bc], ebx
xor eax, eax
cmp word [ebp - 0x54], 0x5a4d
sete al
mov byte [ebp - 0x1c4], al
test al, al
jne 0x40e2e5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c0], eax
push 0x41d1a8
lea eax, [ebp - 0x1c0]
push eax
call sub.MSVCRT.dll__CxxThrowException
and dword [ebp - 0x1bc], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1b8], eax
push 0x41d1a8
lea eax, [ebp - 0x1b8]
push eax
call sub.MSVCRT.dll__CxxThrowException
lea eax, [ebp - 0x60]
push eax
mov edi, pe_nt_image_headers32
push edi
lea eax, [ebp - 0x184]
push eax
mov eax, dword [ebp - 0x18]
add eax, esi
push eax
push dword [ebp + 8]
call dword [ebp + 0x18]
test eax, eax
je 0x40e33b
cmp dword [ebp - 0x60], edi
jne 0x40e33b
mov dword [ebp - 0x1cc], ebx
cmp dword [ebp - 0x184], 0x4550
jne 0x40e35f
cmp word [ebp - 0x180], 0x14c
jne 0x40e35f
cmp word [ebp - 0x16c], 0x10b
jne 0x40e35f
mov dword [ebp - 0x1d4], ebx
jmp 0x40e383
and dword [ebp - 0x1cc], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c8], eax
push 0x41d1a8
lea eax, [ebp - 0x1c8]
push eax
call sub.MSVCRT.dll__CxxThrowException
and dword [ebp - 0x1d4], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1d0], eax
push 0x41d1a8
lea eax, [ebp - 0x1d0]
push eax
call sub.MSVCRT.dll__CxxThrowException
mov eax, dword [ebp - 0x18]
lea eax, [eax + esi + 0xf8]
mov dword [ebp - 0x58], eax
movzx edi, word [ebp - 0x17e]
mov dword [ebp - 0x5c], edi
and dword [ebp - 0x188], 0
push 0x28
pop ebx
cmp dword [ebp - 0x188], edi
jae 0x40e45b
lea eax, [ebp - 0x60]
push eax
push ebx
lea eax, [ebp - 0x1b0]
push eax
push dword [ebp - 0x58]
push dword [ebp + 8]
call dword [ebp + 0x18]
test eax, eax
je 0x40e426
cmp dword [ebp - 0x60], ebx
jne 0x40e426
mov dword [ebp - 0x1dc], 1
add dword [ebp - 0x58], ebx
push ebx
lea eax, [ebp - 0x8c]
push eax
lea eax, [ebp - 0x1b0]
push eax
call sub.MSVCRT.dll_memcmp
add esp, 0xc
test eax, eax
je 0x40e45b
mov ecx, dword [ebp - 0x18c]
mov eax, 0x20000020
and ecx, eax
cmp ecx, eax
jne 0x40e44a
mov eax, dword [ebp - 0x1a4]
add eax, esi
mov ecx, dword [ebp + 0x14]
mov dword [ecx], eax
mov ecx, dword [ebp - 0x1a0]
add eax, ecx
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
push 1
pop eax
jmp 0x40e45d
and dword [ebp - 0x1dc], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1d8], eax
push 0x41d1a8
lea eax, [ebp - 0x1d8]
push eax
call sub.MSVCRT.dll__CxxThrowException
inc dword [ebp - 0x188]
jmp 0x40e3a4
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret