Function at 0x40f700
Capabilities:
Get file size
Parse pe header

Disassembly:
push 0xffffffffffffffff
push 0x4669d0
mov eax, dword fs:[0]
push eax
sub esp, 0x44
push ebx
push ebp
push esi
push edi
mov eax, dword [0x481670]
xor eax, esp
push eax
lea eax, [esp + 0x58]
mov dword fs:[0], eax
xor ebp, ebp
xor edi, edi
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x1c], edi
mov eax, dword [esp + 0x6c]
push ebp
push 0x80
push 3
push ebp
mov ebx, 1
push ebx
push SysReAllocStringLen
push eax
mov dword [esp + 0x7c], ebp
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x40f800
call fcn.0040fc00
cmp eax, ebp
je 0x40f806
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x28]
push 0x4745f4
push ecx
call fcn.004079a0
add esp, 0xc
mov esi, eax
lea edx, [esp + 0x18]
push 0x87
push edx
mov byte [esp + 0x68], bl
call fcn.00406770
push esi
mov esi, dword [esp + 0x74]
push eax
push esi
mov byte [esp + 0x74], 2
call fcn.00407ac0
mov byte [esp + 0x74], bl
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
add esp, 0x14
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f7d2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x60], 0
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40fac5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x40fac5
mov edi, eax
mov dword [esp + 0x1c], edi
mov dword [esp + 0x34], ebp
mov dword [esp + 0x3c], ebp
lea ecx, [esp + 0x30]
push ecx
mov byte [esp + 0x64], 3
push edi
xor esi, esi
mov dword [esp + 0x38], ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
mov dword [esp + 0x2c], eax
jne 0x40f83b
call fcn.0040fc00
cmp eax, ebp
jl 0x40f851
mov eax, dword [esp + 0x2c]
cmp eax, 0x100000
mov edx, dword [esp + 0x30]
mov esi, eax
mov dword [esp + 0x30], edx
jbe 0x40f851
mov esi, 0x100000
mov ebx, 4
push ebx
push 2
push ebp
push ebp
push esi
push edi
lea ecx, [esp + 0x4c]
call fcn.0040fb20
test eax, eax
je 0x40f916
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x1c]
push 0x4745f4
push eax
call fcn.004079a0
add esp, 0xc
mov esi, eax
lea ecx, [esp + 0x24]
push 0x87
push ecx
mov byte [esp + 0x68], bl
call fcn.00406770
push esi
mov esi, dword [esp + 0x74]
push eax
push esi
mov byte [esp + 0x74], 5
call fcn.00407ac0
mov byte [esp + 0x74], bl
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
add esp, 0x14
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40f8d4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x60], 3
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f8f9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x34]
call fcn.0040fc20
cmp edi, ebp
je 0x40fac5
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40fac5
mov ecx, dword [esp + 0x34]
cmp word [ecx], 0x5a4d
je 0x40f933
mov esi, dword [esp + 0x68]
push 0x4747b8
mov ecx, esi
call fcn.004036e0
jmp 0x40f8f9
mov eax, dword [ecx + 0x3c]
add eax, ecx
cmp dword [eax], 0x4550
je 0x40f952
mov esi, dword [esp + 0x68]
push str.Invalid_PE_signature.
mov ecx, esi
call fcn.004036e0
jmp 0x40f8f9
mov ecx, dword [eax + 0x98]
cmp ecx, ebp
je 0x40f968
mov esi, dword [eax + 0x9c]
add esi, ecx
xor edi, edi
jmp 0x40f9bf
lea ecx, [esp + 0x18]
call fcn.00405340
mov eax, dword [esp + 0x6c]
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x1c]
push edx
push str._MGX_VERIFY
mov byte [esp + 0x6c], 6
push eax
mov dword [esp + 0x34], ebp
call fcn.0044e430
add esp, 0x10
cmp eax, ebp
jne 0x40fa9a
mov eax, dword [esp + 0x18]
cmp dword [eax - 0xc], 8
jne 0x40fa9a
mov esi, dword [eax]
mov edi, dword [eax + 4]
lea ecx, [esp + 0x18]
mov byte [esp + 0x60], 3
call fcn.004011e0
mov ecx, dword [esp + 0x6c]
call fcn.0040fae0
mov ebx, eax
cmp esi, ebx
mov ebp, edx
jne 0x40f9e9
cmp edi, ebp
jne 0x40f9e9
mov esi, dword [esp + 0x68]
push 0x4740fc
mov ecx, esi
call fcn.004036e0
jmp 0x40fab3
lea ecx, [esp + 0x2c]
push 0xa2
push ecx
call fcn.00406770
push ebp
push ebx
push edi
mov byte [esp + 0x74], 7
mov eax, dword [eax]
push esi
push eax
lea edx, [esp + 0x44]
push edx
call fcn.004079a0
mov esi, eax
lea eax, [esp + 0x38]
push 0x9b
push eax
mov byte [esp + 0x88], 8
call fcn.00406770
push 0x474228
push eax
lea ecx, [esp + 0x54]
push ecx
mov byte [esp + 0x94], 9
call fcn.004057d0
add esp, 0x34
push esi
push eax
lea edx, [esp + 0x28]
push edx
mov byte [esp + 0x6c], 0xa
call fcn.00407ac0
add esp, 0xc
lea ecx, [esp + 0x24]
call fcn.004011e0
lea ecx, [esp + 0x18]
call fcn.004011e0
lea ecx, [esp + 0x28]
call fcn.004011e0
lea ecx, [esp + 0x2c]
mov byte [esp + 0x60], 0xf
call fcn.004011e0
mov esi, dword [esp + 0x68]
lea eax, [esp + 0x20]
push eax
mov ecx, esi
call fcn.004036c0
lea ecx, [esp + 0x20]
call fcn.004011e0
jmp 0x40fab3
mov esi, dword [esp + 0x68]
push str.Resource__MGX_VERIFY_is_not_found.
mov ecx, esi
call fcn.004036e0
lea ecx, [esp + 0x18]
call fcn.004011e0
lea ecx, [esp + 0x34]
call fcn.0040fc20
lea ecx, [esp + 0x1c]
call fcn.0040fc70
mov eax, esi
mov ecx, dword [esp + 0x58]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x50
ret