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

Disassembly:
sub esp, 0x64
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov dword [esp + 0x20], edx
lea eax, [esp + 0x3c]
push eax
push dword [edi + 0x64]
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
jne 0x4207bc
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x64
ret
mov ebx, dword [esp + 0x3c]
mov esi, ebx
and esi, 1
mov eax, ebx
mov ecx, esi
or ecx, 2
and al, 2
mov eax, ebx
cmove ecx, esi
mov edx, ecx
or edx, 4
and al, 4
cmove edx, ecx
mov ecx, ebx
mov eax, edx
or eax, 0x10
and ecx, 0x10
cmove eax, edx
mov edx, 0x81000000
mov ebp, eax
or ebp, 0x20
and bl, 0x20
cmove ebp, eax
test ecx, ecx
mov eax, 0x41000000
cmove eax, edx
or ebp, eax
test esi, esi
jne 0x420810
or ebp, 0x800000
push 0
push dword [edi + 0x64]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
xor ecx, ecx
mov dword [edi + 0x50], eax
mov dword [edi + 0x54], ecx
cmp eax, 0x28
jbe 0x4208eb
mov eax, dword [edi + 0x18]
or eax, dword [edi + 0x1c]
jne 0x4208eb
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push eax
push eax
push eax
push dword [edi + 0x64]
call esi
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [esp + 0x14]
push 0
push eax
push 2
lea eax, [esp + 0x1c]
push eax
push dword [edi + 0x64]
call ebx
push 0
push 0
push 0x24
push dword [edi + 0x64]
call esi
push 0
lea eax, [esp + 0x18]
push eax
push 4
lea eax, [esp + 0x24]
push eax
push dword [edi + 0x64]
call ebx
mov eax, 0x54ad
cmp word [esp + 0x10], ax
jne 0x4208e0
cmp dword [edi + 0x54], 0
mov eax, dword [esp + 0x18]
lea ecx, [eax + 0x34]
jb 0x4208e0
ja 0x42089d
cmp dword [edi + 0x50], ecx
jbe 0x4208e0
push 0
push 0
push eax
push dword [edi + 0x64]
call esi
push 0
lea eax, [esp + 0x18]
push eax
push 4
lea eax, [esp + 0x28]
push eax
push dword [edi + 0x64]
call ebx
mov eax, dword [esp + 0x1c]
cmp eax, 0x5a4d
je 0x4208da
cmp eax, 0x454e
je 0x4208da
cmp eax, 0x454c
je 0x4208da
cmp eax, 0x4550
jne 0x4208e0
or ebp, 0x400000
push 0
push 0
push 0
push dword [edi + 0x64]
call esi
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x4c]
sub ecx, 0xd53e8000
mov ebx, dword [esp + 0x20]
push 0
push 0x989680
sbb eax, 0x19db1de
push eax
push ecx
mov dword [ebx + 0x10], ebp
call fcn.004b7080
mov edi, dword [esp + 0x50]
mov ecx, edi
mov esi, dword [esp + 0x54]
sub ecx, 0xd53e8000
mov dword [ebx], eax
mov eax, esi
push 0
push 0x989680
sbb eax, 0x19db1de
push eax
push ecx
call fcn.004b7080
mov ecx, dword [esp + 0x40]
mov dword [ebx + 4], eax
sub ecx, 0xd53e8000
mov eax, dword [esp + 0x44]
push 0
push 0x989680
sbb eax, 0x19db1de
push eax
push ecx
call fcn.004b7080
mov dword [ebx + 8], eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x24]
mov dword [esp + 0x24], edi
push eax
mov dword [esp + 0x2c], esi
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x2e]
and eax, 0xf
pop edi
lea ecx, [ecx - 0x3c]
shl ecx, 4
or ecx, eax
mov eax, dword [esp + 0x2e]
shl ecx, 5
and eax, 0x1f
movzx edx, cx
mov ecx, dword [esp + 0x32]
or edx, eax
mov eax, dword [esp + 0x30]
and ecx, 0x3f
shl eax, 6
or ecx, eax
shl edx, 0x10
shl ecx, 5
movzx eax, cx
or edx, eax
mov eax, dword [esp + 0x34]
add eax, eax
and eax, 0x1f
pop esi
or edx, eax
xor eax, eax
pop ebp
mov dword [ebx + 0xc], edx
pop ebx
add esp, 0x64
ret