Function at 0x408a10
Capabilities:
Get file size
Parse pe header
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
lea eax, [ebp - 0x38]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x48]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
jne 0x408a35
mov eax, 1
jmp 0x408c58
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x38]
and eax, 1
je 0x408a4b
mov dword [ebp - 4], 1
mov ecx, dword [ebp - 0x38]
and ecx, 2
je 0x408a5c
mov edx, dword [ebp - 4]
or edx, 2
mov dword [ebp - 4], edx
mov eax, dword [ebp - 0x38]
and eax, 4
je 0x408a6d
mov ecx, dword [ebp - 4]
or ecx, 4
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 0x38]
and edx, 0x10
je 0x408a7e
mov eax, dword [ebp - 4]
or eax, 0x10
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x38]
and ecx, 0x20
je 0x408a8f
mov edx, dword [ebp - 4]
or edx, 0x20
mov dword [ebp - 4], edx
mov eax, dword [ebp - 0x38]
and eax, 0x10
je 0x408aa5
mov ecx, dword [ebp - 4]
or ecx, 0x40000000
mov dword [ebp - 4], ecx
jmp 0x408ab1
mov edx, dword [ebp - 4]
or edx, 0x80000000
mov dword [ebp - 4], edx
mov eax, dword [ebp - 4]
or eax, 0x1000000
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x38]
and ecx, 1
jne 0x408ad0
mov edx, dword [ebp - 4]
or edx, 0x800000
mov dword [ebp - 4], edx
push 0
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, dword [ebp + 8]
mov dword [edx + 0x3c], eax
mov eax, dword [ebp + 8]
cmp dword [eax + 0x3c], 0x28
jbe 0x408be1
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x10], 0
jne 0x408be1
push 0
push 0
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [ebp - 0x3c]
push ecx
push 2
lea edx, [ebp - 0x40]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push 0
push 0x24
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [ebp - 0x3c]
push ecx
push 4
lea edx, [ebp - 0x44]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
movzx edx, word [ebp - 0x40]
cmp edx, 0x54ad
jne 0x408bce
mov eax, dword [ebp - 0x44]
add eax, 0x34
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x3c], eax
jbe 0x408bce
push 0
push 0
mov edx, dword [ebp - 0x44]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea edx, [ebp - 0x3c]
push edx
push 4
lea eax, [ebp - 0x48]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x48]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 0x48], 0x5a4d
je 0x408bc3
cmp dword [ebp - 0x48], 0x454e
je 0x408bc3
cmp dword [ebp - 0x48], 0x454c
je 0x408bc3
cmp dword [ebp - 0x48], 0x4550
jne 0x408bce
mov eax, dword [ebp - 4]
or eax, 0x400000
mov dword [ebp - 4], eax
push 0
push 0
push 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x48]
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 4]
mov dword [eax + 0x10], ecx
mov edx, dword [ebp - 0x28]
push edx
mov eax, dword [ebp - 0x2c]
push eax
call fcn.00408290
add esp, 8
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov edx, dword [ebp - 0x20]
push edx
mov eax, dword [ebp - 0x24]
push eax
call fcn.00408290
add esp, 8
mov ecx, dword [ebp + 0xc]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x30]
push edx
mov eax, dword [ebp - 0x34]
push eax
call fcn.00408290
add esp, 8
mov ecx, dword [ebp + 0xc]
mov dword [ecx + 8], eax
lea edx, [ebp - 0x4c]
push edx
lea eax, [ebp - 0x50]
push eax
mov ecx, dword [ebp - 0x20]
push ecx
mov edx, dword [ebp - 0x24]
push edx
call fcn.004081e0
add esp, 0x10
movzx eax, word [ebp - 0x4c]
movzx ecx, word [ebp - 0x50]
shl ecx, 0x10
or eax, ecx
mov edx, dword [ebp + 0xc]
mov dword [edx + 0xc], eax
xor eax, eax
mov esp, ebp
pop ebp
ret