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

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x4ae680
push 0x4657c0
mov eax, dword fs:[0]
push eax
sub esp, 0x188
mov eax, dword [0x4b206c]
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 - 0x168], 0
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4222fc
push 0
lea eax, [ebp - 0x15c]
push eax
push 0x40
lea eax, [ebp - 0x158]
push eax
push esi
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
call ebx
test eax, eax
je 0x4222f5
cmp dword [ebp - 0x15c], 0x40
jne 0x4222f5
mov eax, 0x5a4d
cmp word [ebp - 0x158], ax
jne 0x4222f5
push 0
push 0
push dword [ebp - 0x11c]
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, dword [ebp - 0x11c]
jne 0x4222f5
push 0
lea eax, [ebp - 0x15c]
push eax
push 0xf8
lea eax, [ebp - 0x118]
push eax
push esi
call ebx
test eax, eax
je 0x4222f5
cmp dword [ebp - 0x15c], 0xf8
jne 0x4222f5
cmp dword [ebp - 0x118], 0x4550
jne 0x4222f5
cmp word [ebp - 0x112], 0
je 0x4222f5
mov ecx, dword [ebp - 0x90]
mov dword [ebp - 0x160], ecx
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x17c], eax
test ecx, ecx
je 0x4222f5
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 edi, eax
mov dword [ebp - 0x17c], edi
test edi, edi
je 0x4222f5
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 edi
push esi
call ebx
test eax, eax
jne 0x42231a
push 0x8000
push eax
push edi
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.00460c27
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, edi
mov dword [ebp - 0x164], edx
push dword [ebp - 0x160]
call fcn.004220f0
add esp, 4
lea ebx, [edi + eax]
lea ecx, [ebx + 0x10]
movzx edx, word [ebx + 0xe]
movzx eax, word [ebx + 0xc]
add edx, eax
mov dword [ebp - 0x16c], edx
mov dword [ebp - 0x178], ecx
mov eax, edx
dec edx
mov dword [ebp - 0x16c], edx
test eax, eax
je 0x422465
cmp dword [ecx], 0x80000000
jae 0x422476
cmp word [ecx], 0xa
jne 0x422476
mov eax, dword [ecx + 4]
and eax, 0x7fffffff
lea ecx, [ebx + 0x10]
add ecx, eax
movzx edx, word [eax + ebx + 0xe]
movzx eax, word [eax + ebx + 0xc]
add edx, eax
mov dword [ebp - 0x170], edx
mov esi, 0x360
mov dword [ebp - 0x174], ecx
mov eax, edx
dec edx
mov dword [ebp - 0x170], edx
test eax, eax
je 0x422465
cmp word [ecx], si
jne 0x42246e
mov esi, dword [ecx + 4]
cmp esi, 0x80000000
jb 0x4223e0
and esi, 0x7fffffff
mov esi, dword [esi + ebx + 0x14]
mov eax, dword [ebp - 0x164]
mov dword [eax + 0x58], 0
mov dword [eax + 0x98], 0
mov dword [eax + 0x9c], 0
mov dword [ebp - 0x198], 0x18
mov dword [ebp - 0x194], edi
push dword [ebp - 0x160]
mov edx, eax
call fcn.004220f0
add esp, 4
mov dword [ebp - 0x190], eax
mov dword [ebp - 0x18c], 0x495cb0
mov eax, dword [ebx + esi + 4]
mov dword [ebp - 0x184], eax
push dword [ebx + esi]
mov edx, dword [ebp - 0x164]
call fcn.004220f0
add esp, 4
add eax, edi
mov dword [ebp - 0x188], eax
lea ecx, [ebp - 0x198]
call fcn.004224c0
mov dword [ebp - 0x168], eax
mov dword [ebp - 4], 0xfffffffe
jmp 0x422494
add ecx, 8
jmp 0x4223ab
add ecx, 8
jmp 0x42235a
test edi, edi
je 0x4224a6
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [ebp - 0x168]
jmp 0x4222fe