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

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x5b4428
push 0x5095a0
mov eax, dword fs:[0]
push eax
sub esp, 0x188
mov eax, dword [0x5c2460]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov dword [ebp - 0x160], 0
push 0
push 0
push 3
push 0
push 1
push SysReAllocString
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4783cc
push 0
lea eax, [ebp - 0x15c]
push eax
push 0x40
lea eax, [ebp - 0x158]
push eax
push esi
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
call edi
test eax, eax
je 0x4783c5
cmp dword [ebp - 0x15c], 0x40
jne 0x4783c5
mov eax, 0x5a4d
cmp word [ebp - 0x158], ax
jne 0x4783c5
push 0
push 0
push dword [ebp - 0x11c]
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, dword [ebp - 0x11c]
jne 0x4783c5
push 0
lea eax, [ebp - 0x15c]
push eax
push 0xf8
lea eax, [ebp - 0x118]
push eax
push esi
call edi
test eax, eax
je 0x4783c5
cmp dword [ebp - 0x15c], 0xf8
jne 0x4783c5
cmp dword [ebp - 0x118], 0x4550
jne 0x4783c5
cmp word [ebp - 0x112], 0
je 0x4783c5
mov ecx, dword [ebp - 0x90]
mov dword [ebp - 0x164], ecx
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x17c], eax
test ecx, ecx
je 0x4783c5
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x15c], eax
push 4
push 0x1000
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
mov dword [ebp - 0x17c], ebx
test ebx, ebx
je 0x4783c5
push 0
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x15c]
push eax
push dword [ebp - 0x15c]
push ebx
push esi
call edi
test eax, eax
jne 0x4783ea
push 0x8000
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.00501d03
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], 0
mov edx, dword [ebp - 0x11c]
add edx, ebx
mov dword [ebp - 0x168], edx
push dword [ebp - 0x164]
call fcn.004781c0
add esp, 4
lea edi, [ebx + eax]
lea ecx, [edi + 0x10]
movzx edx, word [edi + 0xe]
movzx eax, word [edi + 0xc]
add edx, eax
mov dword [ebp - 0x174], edx
mov dword [ebp - 0x16c], ecx
mov eax, edx
dec edx
mov dword [ebp - 0x174], edx
test eax, eax
je 0x478531
test dword [ecx], 0x80000000
jne 0x478542
cmp word [ecx], 0xa
jne 0x478542
mov eax, dword [ecx + 4]
and eax, 0x7fffffff
lea ecx, [edi + 0x10]
add ecx, eax
movzx edx, word [eax + edi + 0xe]
movzx eax, word [eax + edi + 0xc]
add edx, eax
mov dword [ebp - 0x178], edx
mov esi, 0x360
mov dword [ebp - 0x170], ecx
mov eax, edx
dec edx
mov dword [ebp - 0x178], edx
test eax, eax
je 0x478531
cmp word [ecx], si
jne 0x47853a
mov eax, dword [ecx + 4]
test eax, eax
jns 0x4784af
and eax, 0x7fffffff
mov esi, dword [eax + edi + 0x14]
add esi, edi
jmp 0x4784b2
lea esi, [eax + edi]
mov edi, dword [ebp - 0x168]
mov dword [edi + 0x58], 0
mov dword [edi + 0x98], 0
mov dword [edi + 0x9c], 0
mov dword [ebp - 0x198], 0x18
mov dword [ebp - 0x194], ebx
push dword [ebp - 0x164]
mov edx, edi
call fcn.004781c0
add esp, 4
mov dword [ebp - 0x190], eax
mov dword [ebp - 0x18c], 0x5512d8
mov eax, dword [esi + 4]
mov dword [ebp - 0x184], eax
push dword [esi]
mov edx, edi
call fcn.004781c0
add esp, 4
add eax, ebx
mov dword [ebp - 0x188], eax
lea ecx, [ebp - 0x198]
call fcn.00478580
mov dword [ebp - 0x160], eax
mov dword [ebp - 4], 0xfffffffe
jmp 0x478560
add ecx, 8
jmp 0x47847b
add ecx, 8
jmp 0x47842a
test ebx, ebx
je 0x478572
push 0x8000
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [ebp - 0x160]
jmp 0x4783ce