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

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x4e1330
push 0x48f360
mov eax, dword fs:[0]
push eax
sub esp, 0x190
mov eax, dword [0x515584]
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 - 0x16c], 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 0x4213cc
push 0
lea eax, [ebp - 0x11c]
push eax
push 0x40
lea eax, [ebp - 0x160]
push eax
push esi
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
call ebx
test eax, eax
je 0x4213c5
cmp dword [ebp - 0x11c], 0x40
jne 0x4213c5
mov eax, 0x5a4d
cmp word [ebp - 0x160], ax
jne 0x4213c5
push 0
push 0
push dword [ebp - 0x124]
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, dword [ebp - 0x124]
jne 0x4213c5
push 0
lea eax, [ebp - 0x11c]
push eax
push 0xf8
lea eax, [ebp - 0x118]
push eax
push esi
call ebx
test eax, eax
je 0x4213c5
cmp dword [ebp - 0x11c], 0xf8
jne 0x4213c5
cmp dword [ebp - 0x118], 0x4550
jne 0x4213c5
cmp word [ebp - 0x112], 0
je 0x4213c5
mov ecx, dword [ebp - 0x90]
mov dword [ebp - 0x164], ecx
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x180], eax
test ecx, ecx
je 0x4213c5
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x11c], eax
push 4
push 0x1000
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
mov dword [ebp - 0x180], edi
test edi, edi
je 0x4213c5
push 0
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x11c]
push eax
push dword [ebp - 0x11c]
push edi
push esi
call ebx
test eax, eax
jne 0x4213ea
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.0048d7c2
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], 0
mov edx, dword [ebp - 0x124]
add edx, edi
mov dword [ebp - 0x168], edx
push dword [ebp - 0x164]
call fcn.004211b0
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 - 0x170], edx
mov dword [ebp - 0x17c], ecx
mov eax, edx
dec edx
mov dword [ebp - 0x170], edx
test eax, eax
je 0x421531
mov eax, dword [ecx]
movzx esi, ax
test eax, eax
js 0x421542
cmp esi, 0xa
jne 0x421542
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 - 0x174], edx
mov esi, 0x360
mov dword [ebp - 0x178], ecx
mov eax, edx
dec edx
mov dword [ebp - 0x174], edx
test eax, eax
je 0x421531
cmp word [ecx], si
jne 0x42153a
mov esi, dword [ecx + 4]
test esi, esi
jns 0x4214ac
and esi, 0x7fffffff
mov esi, dword [esi + ebx + 0x14]
mov eax, dword [ebp - 0x168]
mov dword [eax + 0x58], 0
mov dword [eax + 0x98], 0
mov dword [eax + 0x9c], 0
mov dword [ebp - 0x19c], 0x18
mov dword [ebp - 0x198], edi
push dword [ebp - 0x164]
mov edx, eax
call fcn.004211b0
add esp, 4
mov dword [ebp - 0x194], eax
mov dword [ebp - 0x190], 0x4d82a0
mov eax, dword [ebx + esi + 4]
mov dword [ebp - 0x188], eax
push dword [ebx + esi]
mov edx, dword [ebp - 0x168]
call fcn.004211b0
add esp, 4
add eax, edi
mov dword [ebp - 0x18c], eax
lea ecx, [ebp - 0x19c]
call fcn.00421580
mov dword [ebp - 0x16c], eax
mov dword [ebp - 4], 0xfffffffe
jmp 0x421560
add ecx, 8
jmp 0x42147b
add ecx, 8
jmp 0x42142a
test edi, edi
je 0x421572
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [ebp - 0x16c]
jmp 0x4213ce