Function at 0x40beb1
Capabilities:
Parse pe header

Disassembly:
mov eax, 0x4196f4
call fcn.004180a0
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 0x40bf45
cmp dword [ebp - 0x60], 0x40
jne 0x40bf45
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 0x40bf69
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c0], eax
push 0x41eec0
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 0x41eec0
lea eax, [ebp - 0x1b8]
push eax
call sub.MSVCRT.dll__CxxThrowException
lea eax, [ebp - 0x60]
push eax
mov edi, 0xf8
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 0x40bfbf
cmp dword [ebp - 0x60], edi
jne 0x40bfbf
mov dword [ebp - 0x1cc], ebx
cmp dword [ebp - 0x184], 0x4550
jne 0x40bfe3
cmp word [ebp - 0x180], 0x14c
jne 0x40bfe3
cmp word [ebp - 0x16c], 0x10b
jne 0x40bfe3
mov dword [ebp - 0x1d4], ebx
jmp 0x40c007
and dword [ebp - 0x1cc], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c8], eax
push 0x41eec0
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 0x41eec0
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 0x40c0df
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 0x40c0aa
cmp dword [ebp - 0x60], ebx
jne 0x40c0aa
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 0x40c0df
mov ecx, dword [ebp - 0x18c]
mov eax, 0x20000020
and ecx, eax
cmp ecx, eax
jne 0x40c0ce
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 0x40c0e1
and dword [ebp - 0x1dc], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1d8], eax
push 0x41eec0
lea eax, [ebp - 0x1d8]
push eax
call sub.MSVCRT.dll__CxxThrowException
inc dword [ebp - 0x188]
jmp 0x40c028
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret