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

Disassembly:
sub esp, 0x7c
push esi
mov esi, dword [esp + 0x84]
push esi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
je 0x40e031
mov eax, 0x1000000
pop esi
add esp, 0x7c
ret
lea eax, [esp + 0x4c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
jne 0x40e04b
mov eax, 0x200
pop esi
add esp, 0x7c
ret
push ebx
push ebp
lea ecx, [esp + 0x34]
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
lea edx, [esp + 0x48]
push edx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov esi, dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [esp + 0x24]
lea ecx, [esp + 0x38]
push eax
push ecx
call esi
lea edx, [esp + 0x1c]
lea eax, [esp + 0x48]
push edx
push eax
call esi
mov edi, dword [esp + 0x24]
mov ecx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x28]
mov eax, dword [esp + 0x20]
sub edi, ecx
lea ecx, [esp + 0x6c]
sbb ebx, eax
lea edx, [esp + 0x64]
lea eax, [esp + 0x5c]
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], eax
lea esi, [esp + 0x2c]
mov ebp, 3
mov eax, dword [esi]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
sub ecx, edi
sbb edx, ebx
add esi, 4
mov dword [eax], ecx
dec ebp
mov dword [eax + 4], edx
jne 0x40e0b7
mov eax, dword [esp + 0x58]
xor ebp, ebp
mov edx, eax
and edx, 1
je 0x40e0df
mov ebp, 1
test al, 2
je 0x40e0e6
or ebp, 2
test al, 4
je 0x40e0ed
or ebp, 4
mov ecx, eax
and ecx, 0x10
je 0x40e0f7
or ebp, 0x10
test al, 0x20
je 0x40e0fe
or ebp, 0x20
test ecx, ecx
je 0x40e10a
or ebp, 0x40000000
jmp 0x40e110
or ebp, 0x80000000
or ebp, 0x1000000
test edx, edx
jne 0x40e120
or ebp, 0x800000
mov esi, dword [esp + 0x90]
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0x28
mov dword [esp + 0x18], eax
jbe 0x40e1d4
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push 0
push esi
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x14]
push 0
push ecx
lea edx, [esp + 0x1a]
push 2
push edx
push esi
call ebx
push 0
push 0
push 0x24
push esi
call edi
lea eax, [esp + 0x14]
push 0
push eax
lea ecx, [esp + 0x24]
push 4
push ecx
push esi
call ebx
cmp word [esp + 0x12], 0x54ad
jne 0x40e1d4
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
lea edx, [eax + 0x34]
cmp ecx, edx
jbe 0x40e1d4
push 0
push 0
push eax
push esi
call edi
lea eax, [esp + 0x14]
push 0
push eax
lea ecx, [esp + 0x2c]
push 4
push ecx
push esi
call ebx
mov eax, dword [esp + 0x24]
cmp eax, 0x5a4d
je 0x40e1ce
cmp eax, 0x454e
je 0x40e1ce
cmp eax, 0x454c
je 0x40e1ce
cmp eax, 0x4550
jne 0x40e1d4
or ebp, 0x400000
mov eax, dword [esp + 0x94]
test eax, eax
je 0x40e1e1
mov dword [eax], ebp
mov eax, dword [esp + 0x98]
pop edi
pop ebp
pop ebx
test eax, eax
je 0x40e1f5
mov edx, dword [esp + 0xc]
mov dword [eax], edx
mov esi, dword [esp + 0x90]
test esi, esi
je 0x40e238
mov eax, dword [esp + 0x5c]
mov ecx, dword [esp + 0x58]
push eax
push ecx
call fcn.0040df40
mov edx, dword [esp + 0x6c]
mov dword [esi], eax
mov eax, dword [esp + 0x68]
push edx
push eax
call fcn.0040df40
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x60]
push ecx
push edx
mov dword [esi + 4], eax
call fcn.0040df40
add esp, 0x18
mov dword [esi + 8], eax
mov esi, dword [esp + 0x94]
test esi, esi
je 0x40e272
lea eax, [esp + 0x10]
lea ecx, [esp + 0x18]
push eax
lea edx, [esp + 0x64]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_FileTimeToDosDateTime]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
and eax, 0xffff
and ecx, 0xffff
shl eax, 0x10
or eax, ecx
mov dword [esi], eax
xor eax, eax
pop esi
add esp, 0x7c
ret