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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
mov eax, dword [0x72232c]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
mov dword [ebp - 0x50], ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x54], ecx
mov ecx, dword [ebp + 0x18]
push esi
mov esi, dword [ebp + 0x14]
mov dword [ebp - 0x58], ecx
lea ecx, [ebp - 0x38]
push ecx
push eax
mov dword [ebp - 0x40], eax
call dword [sym.imp.KERNEL32.DLL_GetFileInformationByHandle]
test eax, eax
jne 0x5313c5
mov eax, 0x200
jmp 0x531560
push ebx
mov ebx, dword [ebp - 0x38]
mov edx, ebx
and edx, 1
mov eax, ebx
mov ecx, edx
mov dword [ebp - 0x3c], edx
or ecx, 2
and al, 2
mov eax, ebx
cmove ecx, edx
mov edx, ecx
or edx, 4
and al, 4
push edi
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
cmove edx, eax
test ecx, ecx
je 0x53140e
or edx, 0x40000000
jmp 0x531414
or edx, 0x80000000
mov ebx, dword [ebp - 0x40]
or edx, 0x1000000
mov edi, edx
or edi, 0x800000
cmp dword [ebp - 0x3c], 0
push 0
push ebx
cmovne edi, edx
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov dword [ebp - 0x3c], eax
mov ecx, edi
cmp eax, 0x28
jbe 0x5314e5
xor eax, eax
push eax
push eax
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
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 dword [sym.imp.KERNEL32.DLL_SetFilePointer]
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, edi
cmp word [ebp - 0x40], ax
jne 0x5314e2
mov edx, dword [ebp - 0x48]
lea eax, [edx + 0x34]
cmp dword [ebp - 0x3c], eax
jbe 0x5314e2
push 0
push 0
push edx
push ebx
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
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 0x5314da
cmp eax, 0x454e
je 0x5314da
cmp eax, 0x454c
je 0x5314da
mov ecx, edi
cmp eax, 0x4550
jne 0x5314e2
mov ecx, edi
or ecx, 0x400000
mov eax, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x50]
pop edi
pop ebx
test edx, edx
je 0x5314f0
mov dword [edx], ecx
mov ecx, dword [ebp - 0x54]
test ecx, ecx
je 0x5314f9
mov dword [ecx], eax
test esi, esi
je 0x531532
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
call fcn.0053286b
push dword [ebp - 0x20]
mov dword [esi], eax
push dword [ebp - 0x24]
mov dword [esi + 4], edx
call fcn.0053286b
push dword [ebp - 0x30]
mov dword [esi + 8], eax
push dword [ebp - 0x34]
mov dword [esi + 0xc], edx
call fcn.0053286b
add esp, 0x18
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], edx
mov esi, dword [ebp - 0x58]
test esi, esi
je 0x53155e
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x40]
push eax
push dword [ebp - 0x20]
push dword [ebp - 0x24]
call fcn.005327f8
movzx ecx, word [ebp - 0x40]
add esp, 0x10
movzx eax, word [ebp - 0x3c]
shl ecx, 0x10
or ecx, eax
mov dword [esi], ecx
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop esi
call fcn.005b4733
mov esp, ebp
pop ebp
ret