Function at 0x4beaf4
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe8
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 0x18], eax
mov edi, dword [ebp + 0xc]
xor eax, eax
push ebp
push 0x4bed15
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 4], eax
mov eax, 0x20
call fcn.00404350
mov esi, eax
mov edx, 0x20
mov eax, esi
call fcn.0040c058
mov ebx, esi
mov eax, dword [ebp + 8]
mov dword [ebx], eax
test edi, edi
setne al
mov byte [ebx + 0xc], al
test al, al
je 0x4beb4e
mov eax, dword [edi]
mov dword [ebx + 4], eax
mov eax, dword [edi + 4]
mov dword [ebx + 8], eax
mov edi, dword [ebx]
test edi, edi
je 0x4bece4
cmp edi, 0xffffffff
je 0x4bece4
push 0
push 0
push 0
push 4
push 0
push edi
call sub.kernel32.dll_CreateFileMappingW
mov dword [ebx + 0x10], eax
cmp dword [ebx + 0x10], 0
je 0x4bece4
push 0
push 0
push 0
push 0xf001f
mov eax, dword [ebx + 0x10]
push eax
call sub.kernel32.dll_MapViewOfFile
mov edi, eax
mov dword [ebx + 0x14], edi
test edi, edi
je 0x4bece4
cmp word [edi], 0x5a4d
jne 0x4bece4
mov edx, dword [ebx + 0x14]
mov eax, edx
add eax, 0x3c
mov eax, dword [eax]
add eax, edx
mov dword [ebx + 0x18], eax
cmp dword [eax], 0x4550
jne 0x4bece4
cmp word [eax + 0x18], 0x20b
jne 0x4bebe6
lea edx, [eax + 0x18]
mov edx, dword [edx + 0x80]
mov dword [ebp - 0x14], edx
add eax, 0x18
add eax, 0xf0
mov dword [ebp - 8], eax
jmp 0x4bebfa
mov edx, dword [eax + 0x88]
mov dword [ebp - 0x14], edx
add eax, 0x18
add eax, 0xe0
mov dword [ebp - 8], eax
push 2
call sub.kernel32.dll_SetLastError
mov byte [ebp - 0xd], 0
mov eax, dword [ebx + 0x18]
movzx edi, word [eax + 6]
dec edi
test edi, edi
jl 0x4bec54
inc edi
mov dword [ebp - 0xc], 0
lea eax, [ebp - 0x18]
mov edx, dword [ebp - 0xc]
lea edx, [edx + edx*4]
mov ecx, dword [ebp - 8]
lea edx, [ecx + edx*8]
mov ecx, 0
call fcn.00406ea4
mov edx, dword [ebp - 0x18]
mov ecx, dword [0x4c92f8]
mov ecx, dword [ecx]
mov eax, 0x4bed34
call ecx
test al, al
je 0x4bec4e
mov byte [ebp - 0xd], 1
jmp 0x4bec54
inc dword [ebp - 0xc]
dec edi
jne 0x4bec19
cmp byte [ebp - 0xd], 0
jne 0x4bece4
mov eax, dword [ebx + 0x18]
movzx edi, word [eax + 6]
dec edi
test edi, edi
jl 0x4bece4
inc edi
mov dword [ebp - 0xc], 0
mov eax, dword [ebp - 0xc]
lea eax, [eax + eax*4]
mov edx, dword [ebp - 8]
mov eax, dword [edx + eax*8 + 0xc]
cmp eax, dword [ebp - 0x14]
jne 0x4becde
cmp dword [ebp + 0x10], 0
je 0x4becb4
mov edx, dword [0x4bdcd4]
mov eax, 0x2c
call fcn.00407d70
mov edi, eax
mov dword [ebx + 0x1c], edi
mov edx, 0x2c
mov eax, edi
call fcn.0040c058
mov eax, dword [ebx + 0x1c]
mov byte [eax + 0x14], 1
jmp 0x4becd9
mov eax, dword [ebp - 0xc]
lea eax, [eax + eax*4]
mov edx, dword [ebp - 8]
mov ecx, dword [edx + eax*8 + 0xc]
mov eax, dword [ebp - 0xc]
lea eax, [eax + eax*4]
mov edx, dword [ebp - 8]
mov edx, dword [edx + eax*8 + 0x14]
mov eax, dword [ebx + 0x14]
call fcn.004be1f0
mov dword [ebx + 0x1c], eax
mov dword [ebp - 4], esi
jmp 0x4bece4
inc dword [ebp - 0xc]
dec edi
jne 0x4bec72
cmp dword [ebp - 4], 0
jne 0x4becff
call sub.kernel32.dll_GetLastError_1
mov ebx, eax
push 0xffffffffffffffff
push esi
call fcn.004bee08
push ebx
call sub.kernel32.dll_SetLastError
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4bed1c
lea eax, [ebp - 0x18]
call fcn.004068b8
ret