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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x60
mov eax, dword [0x6ba394]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x54], eax
mov eax, dword [ebp + 0xc]
push esi
mov dword [ebp - 0x58], eax
mov eax, dword [ebp + 0x10]
push edi
mov dword [ebp - 0x5c], eax
lea eax, [ebp - 0x38]
push eax
push ecx
mov dword [ebp - 0x50], edx
mov dword [ebp - 0x3c], ecx
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
jne 0x585840
mov eax, 0x200
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b168a
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x38]
mov edi, ebx
and edi, 1
mov eax, ebx
mov ecx, edi
mov esi, ebx
or ecx, 2
and al, 2
mov eax, ebx
cmove ecx, edi
mov edx, ecx
or edx, 4
and al, 4
push 0
cmove edx, ecx
mov eax, edx
or eax, 0x10
and esi, 0x10
cmove eax, edx
mov ecx, eax
or ecx, 0x20
and bl, 0x20
mov ebx, dword [ebp - 0x3c]
cmove ecx, eax
mov eax, ecx
or ecx, 0x80000000
or eax, 0x40000000
test esi, esi
push ebx
cmovne ecx, eax
or ecx, 0x1000000
mov esi, ecx
or esi, 0x800000
test edi, edi
cmovne esi, ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, eax
mov ecx, esi
mov dword [ebp - 0x3c], edx
cmp edx, 0x28
jbe 0x585956
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push 0
push ebx
call edi
push 0
lea eax, [ebp - 0x44]
push eax
push 2
lea eax, [ebp - 0x40]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push 0
push 0x24
push ebx
call edi
push 0
lea eax, [ebp - 0x44]
push eax
push 4
lea eax, [ebp - 0x48]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, 0x54ad
mov ecx, esi
cmp word [ebp - 0x40], ax
jne 0x585953
mov edx, dword [ebp - 0x48]
lea eax, [edx + 0x34]
cmp dword [ebp - 0x3c], eax
jbe 0x585953
push 0
push 0
push edx
push ebx
call edi
push 0
lea eax, [ebp - 0x44]
push eax
push 4
lea eax, [ebp - 0x4c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x4c]
cmp eax, 0x5a4d
je 0x58594b
cmp eax, 0x454e
je 0x58594b
cmp eax, 0x454c
je 0x58594b
mov ecx, esi
cmp eax, 0x4550
jne 0x585953
mov ecx, esi
or ecx, 0x400000
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x50]
test eax, eax
je 0x58595f
mov dword [eax], ecx
mov eax, dword [ebp - 0x54]
test eax, eax
je 0x585968
mov dword [eax], edx
mov ebx, dword [ebp - 0x58]
mov esi, dword [ebp - 0x20]
mov edi, dword [ebp - 0x24]
test ebx, ebx
je 0x5859e1
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x28]
sub ecx, 0xd53e8000
push 0
push 0x989680
sbb eax, 0x19db1de
push eax
push ecx
call fcn.005b22e0
mov dword [ebx], eax
mov ecx, edi
sub ecx, 0xd53e8000
mov dword [ebx + 4], edx
push 0
mov eax, esi
push 0x989680
sbb eax, 0x19db1de
push eax
push ecx
call fcn.005b22e0
mov ecx, dword [ebp - 0x34]
mov dword [ebx + 8], eax
sub ecx, 0xd53e8000
mov eax, dword [ebp - 0x30]
push 0
push 0x989680
sbb eax, 0x19db1de
mov dword [ebx + 0xc], edx
push eax
push ecx
call fcn.005b22e0
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x14], edx
mov ebx, dword [ebp - 0x5c]
test ebx, ebx
je 0x585a07
push esi
push edi
lea edx, [ebp - 0x3c]
lea ecx, [ebp - 0x40]
call fcn.00585770
movzx ecx, word [ebp - 0x40]
add esp, 8
movzx eax, word [ebp - 0x3c]
shl ecx, 0x10
or ecx, eax
mov dword [ebx], ecx
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.005b168a
mov esp, ebp
pop ebp
ret