Function at 0x405150
Capabilities:
Get file size
Parse pe header
Read file on windows
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffa4
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x5c], ebx
mov dword [ebp - 0x58], ebx
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.0040359c
mov eax, dword [ebp - 8]
call fcn.0040359c
mov eax, dword [ebp - 0xc]
call fcn.0040359c
xor eax, eax
push ebp
push 0x40557b
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0xd], 0
push 0
push 0
push 3
push 0
push 1
push 0x80000000
mov eax, dword [ebp - 0xc]
call fcn.004035ac
push eax
call sub.kernel32.dll_CreateFileA
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4051fd
push 0x405598
push dword [ebp - 4]
push 0x4055b4
lea eax, [ebp - 0x38]
mov edx, 3
call fcn.0040346c
mov eax, dword [ebp - 0x38]
call fcn.0040480c
push ebx
call sub.kernel32.dll_CloseHandle
jmp 0x405553
push 0
push ebx
call sub.kernel32.dll_GetFileSize
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
push eax
call fcn.00403bc4
pop ecx
mov dword [ebp - 0x18], eax
push 0
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x18]
push eax
push ebx
call sub.kernel32.dll_ReadFile
push ebx
call sub.kernel32.dll_CloseHandle
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x1c]
je 0x405269
push 0x4055c0
push dword [ebp - 4]
push 0x4055b4
lea eax, [ebp - 0x3c]
mov edx, 3
call fcn.0040346c
mov eax, dword [ebp - 0x3c]
call fcn.0040480c
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
call fcn.00402494
jmp 0x405553
mov eax, dword [ebp - 0x18]
cmp word [eax], 0x5a4d
je 0x4052a5
push 0x4055e0
push dword [ebp - 4]
push 0x4055b4
lea eax, [ebp - 0x40]
mov edx, 3
call fcn.0040346c
mov eax, dword [ebp - 0x40]
call fcn.0040480c
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
call fcn.00402494
jmp 0x405553
mov eax, dword [eax + 0x3c]
add eax, dword [ebp - 0x18]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
cmp dword [eax], 0x4550
je 0x4052eb
push 0x405604
push dword [ebp - 4]
push 0x4055b4
lea eax, [ebp - 0x44]
mov edx, 3
call fcn.0040346c
mov eax, dword [ebp - 0x44]
call fcn.0040480c
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
call fcn.00402494
jmp 0x405553
mov eax, dword [ebp - 0x30]
add eax, 0x78
cmp dword [eax + 4], 0
jne 0x405329
push 0x405628
push dword [ebp - 4]
push 0x4055b4
lea eax, [ebp - 0x48]
mov edx, 3
call fcn.0040346c
mov eax, dword [ebp - 0x48]
call fcn.0040480c
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
call fcn.00402494
jmp 0x405553
mov edi, dword [eax]
xor eax, eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x30]
call fcn.00405138
mov edx, dword [ebp - 0x30]
movzx ebx, word [edx + 6]
test ebx, ebx
jle 0x405365
mov edx, dword [eax + 0xc]
cmp edi, edx
jb 0x40535f
mov ecx, edx
add ecx, dword [eax + 0x10]
cmp edi, ecx
jae 0x40535f
mov ecx, edi
sub ecx, edx
add ecx, dword [eax + 0x14]
mov dword [ebp - 0x24], ecx
jmp 0x405365
add eax, 0x28
dec ebx
jne 0x405343
cmp dword [ebp - 0x24], 0
jne 0x40539d
push 0x405650
push dword [ebp - 4]
push 0x4055b4
lea eax, [ebp - 0x4c]
mov edx, 3
call fcn.0040346c
mov eax, dword [ebp - 0x4c]
call fcn.0040480c
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
call fcn.00402494
jmp 0x405553
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x24]
mov dword [ebp - 0x34], eax
mov byte [ebp - 0x29], 0
mov eax, dword [ebp - 0x34]
mov esi, dword [eax + 0x20]
sub esi, edi
add esi, dword [ebp - 0x34]
mov eax, dword [ebp - 0x34]
mov ebx, dword [eax + 0x18]
test ebx, ebx
jle 0x4053f7
mov dword [ebp - 0x28], 1
mov eax, dword [esi]
sub eax, edi
add eax, dword [ebp - 0x34]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x50]
mov edx, dword [ebp - 0x14]
call fcn.00403328
mov eax, dword [ebp - 0x50]
mov edx, dword [ebp - 8]
call fcn.004034f8
jne 0x4053ee
mov byte [ebp - 0x29], 1
jmp 0x4053f7
add esi, 4
inc dword [ebp - 0x28]
dec ebx
jne 0x4053c6
cmp byte [ebp - 0x29], 0
jne 0x405437
push 0x405694
push dword [ebp - 8]
push 0x4056a8
push dword [ebp - 4]
push 0x4055b4
lea eax, [ebp - 0x54]
mov edx, 5
call fcn.0040346c
mov eax, dword [ebp - 0x54]
call fcn.0040480c
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
call fcn.00402494
jmp 0x405553
mov eax, dword [ebp - 0x34]
mov esi, dword [eax + 0x24]
sub esi, edi
add esi, dword [ebp - 0x34]
mov eax, dword [ebp - 0x28]
dec eax
add eax, eax
add eax, esi
mov esi, eax
movzx eax, word [esi]
mov edx, dword [ebp - 0x34]
add eax, dword [edx + 0x10]
mov edx, dword [ebp - 0x34]
mov edx, dword [edx + 0x10]
cmp eax, edx
jb 0x40546a
mov ecx, dword [ebp - 0x34]
add edx, dword [ecx + 0x14]
dec edx
cmp eax, edx
jbe 0x4054a4
push 0x4056dc
push dword [ebp - 8]
push 0x40570c
push dword [ebp - 4]
push 0x4055b4
lea eax, [ebp - 0x58]
mov edx, 5
call fcn.0040346c
mov eax, dword [ebp - 0x58]
call fcn.0040480c
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
call fcn.00402494
jmp 0x405553
mov edx, dword [ebp - 0x34]
sub eax, dword [edx + 0x10]
mov esi, eax
shl esi, 2
mov eax, dword [ebp - 0x34]
mov eax, dword [eax + 0x1c]
sub eax, edi
add esi, eax
add esi, dword [ebp - 0x34]
xor eax, eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x30]
call fcn.00405138
mov edx, dword [ebp - 0x30]
movzx ebx, word [edx + 6]
test ebx, ebx
jle 0x4054f6
mov edx, dword [esi]
cmp edx, dword [eax + 0xc]
jb 0x4054f0
mov ecx, dword [eax + 0xc]
add ecx, dword [eax + 0x10]
cmp edx, ecx
jae 0x4054f0
sub edx, dword [eax + 0xc]
add edx, dword [eax + 0x14]
mov dword [ebp - 0x24], edx
jmp 0x4054f6
add eax, 0x28
dec ebx
jne 0x4054d4
cmp dword [ebp - 0x24], 0
jne 0x405533
push 0x405724
push dword [ebp - 8]
push 0x405744
push dword [ebp - 4]
push 0x4055b4
lea eax, [ebp - 0x5c]
mov edx, 5
call fcn.0040346c
mov eax, dword [ebp - 0x5c]
call fcn.0040480c
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
call fcn.00402494
jmp 0x405553
mov edx, dword [ebp - 0x18]
add edx, dword [ebp - 0x24]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
call fcn.00404074
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
call fcn.00402494
mov byte [ebp - 0xd], 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x405582
lea eax, [ebp - 0x5c]
mov edx, 0xa
call fcn.00403190
lea eax, [ebp - 0xc]
mov edx, 3
call fcn.00403190
ret