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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x98
mov eax, dword [0x4a8404]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov dword [ebp - 0x8c], eax
mov edi, ecx
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x90], eax
mov eax, dword [ebp + 0x10]
push edi
mov dword [ebp - 0x88], edx
mov dword [ebp - 0x94], eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
je 0x405ad7
mov eax, 0x1000000
jmp 0x405ce5
lea eax, [ebp - 0x48]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
jne 0x405af0
mov eax, 0x200
jmp 0x405ce5
lea eax, [ebp - 0x58]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov esi, dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x84]
push eax
lea eax, [ebp - 0x58]
push eax
call esi
lea eax, [ebp - 0x7c]
push eax
lea eax, [ebp - 0x68]
push eax
call esi
mov ebx, dword [ebp - 0x84]
sub ebx, dword [ebp - 0x7c]
mov eax, dword [ebp - 0x80]
sbb eax, dword [ebp - 0x78]
xor esi, esi
mov dword [ebp - 0x6c], eax
lea eax, [ebp - 0x34]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x44]
mov dword [ebp - 0xc], eax
mov edx, dword [ebp + esi*4 - 0x14]
mov eax, dword [edx + 4]
sub dword [edx], ebx
sbb eax, dword [ebp - 0x6c]
inc esi
mov dword [edx + 4], eax
cmp esi, 3
jl 0x405b47
mov ebx, dword [ebp - 0x48]
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, eax
or edx, 0x20
and bl, 0x20
mov ebx, 0x81000000
cmove edx, eax
test ecx, ecx
mov eax, 0x41000000
cmove eax, ebx
or edx, eax
mov dword [ebp - 0x6c], edx
test esi, esi
jne 0x405bb5
or edx, 0x800000
mov dword [ebp - 0x6c], edx
xor ebx, ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0x28
jbe 0x405c5e
push ebx
push ebx
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call ebx
push 0
lea eax, [ebp - 0x74]
push eax
push 2
lea eax, [ebp - 0x70]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push 0
push 0x24
push edi
call ebx
push 0
lea eax, [ebp - 0x74]
push eax
push 4
lea eax, [ebp - 0x78]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, 0x54ad
cmp word [ebp - 0x70], ax
jne 0x405c5e
mov ecx, dword [ebp - 0x78]
lea eax, [ecx + 0x34]
cmp esi, eax
jbe 0x405c5e
push 0
push 0
push ecx
push edi
call ebx
push 0
lea eax, [ebp - 0x74]
push eax
push 4
lea eax, [ebp - 0x80]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x80]
cmp eax, 0x5a4d
je 0x405c54
cmp eax, 0x454e
je 0x405c54
cmp eax, 0x454c
je 0x405c54
cmp eax, 0x4550
jne 0x405c5e
mov eax, dword [ebp - 0x6c]
or eax, 0x400000
jmp 0x405c61
mov eax, dword [ebp - 0x6c]
mov ecx, dword [ebp - 0x88]
test ecx, ecx
je 0x405c6d
mov dword [ecx], eax
mov eax, dword [ebp - 0x8c]
test eax, eax
je 0x405c79
mov dword [eax], esi
mov ebx, dword [ebp - 0x90]
test ebx, ebx
je 0x405cb8
push dword [ebp - 0x38]
push dword [ebp - 0x3c]
call fcn.004059d6
push dword [ebp - 0x30]
mov dword [ebx], eax
push dword [ebp - 0x34]
mov dword [ebx + 4], edx
call fcn.004059d6
push dword [ebp - 0x40]
mov dword [ebx + 8], eax
push dword [ebp - 0x44]
mov dword [ebx + 0xc], edx
call fcn.004059d6
add esp, 0x18
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x14], edx
mov esi, dword [ebp - 0x94]
test esi, esi
je 0x405ce3
lea eax, [ebp - 0x6c]
push eax
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_FileTimeToDosDateTime]
movzx ecx, word [ebp - 0x70]
movzx eax, word [ebp - 0x6c]
shl ecx, 0x10
or ecx, eax
mov dword [esi], ecx
xor eax, eax
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00459f73
leave
ret