Function at 0x40f090
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x566984
mov eax, dword fs:[0]
push eax
sub esp, 0x170
mov eax, dword [0x5ca3a0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x17c], ecx
mov dword [ebp - 4], 0
lea ecx, [ebp + 8]
call fcn.00401800
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40f0ef
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call fcn.00401650
jmp 0x40f638
push 0
push 0x80
push 4
push 0
push 1
push SysReAllocStringLen
lea ecx, [ebp + 8]
call fcn.00401800
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x40f12d
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call fcn.00401650
jmp 0x40f638
push 0
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x34]
add eax, 2
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0045d45b
add esp, 4
mov dword [ebp - 0x144], eax
mov eax, dword [ebp - 0x144]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jne 0x40f184
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call fcn.00401650
jmp 0x40f638
mov ecx, dword [ebp - 0x34]
add ecx, 2
push ecx
push 0
mov edx, dword [ebp - 0x30]
push edx
call fcn.0047d440
add esp, 0xc
push 0
lea eax, [ebp - 0x40]
push eax
mov ecx, dword [ebp - 0x34]
push ecx
mov edx, dword [ebp - 0x30]
push edx
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x48], ecx
mov edx, dword [ebp - 0x48]
movzx eax, word [edx]
cmp eax, 0xfeff
jne 0x40f1d2
mov ecx, dword [ebp - 0x30]
add ecx, 2
mov dword [ebp - 0x48], ecx
jmp 0x40f270
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x4c], edx
mov eax, dword [ebp - 0x34]
add eax, 2
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0045d45b
add esp, 4
mov dword [ebp - 0x148], eax
mov eax, dword [ebp - 0x148]
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x50], 0
jne 0x40f220
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call fcn.00401650
jmp 0x40f638
mov ecx, dword [ebp - 0x34]
add ecx, 2
push ecx
push 0
mov edx, dword [ebp - 0x50]
push edx
call fcn.0047d440
add esp, 0xc
mov eax, dword [ebp - 0x50]
push eax
mov ecx, dword [ebp - 0x4c]
push ecx
call fcn.00414bb0
add esp, 8
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x14c], edx
mov eax, dword [ebp - 0x14c]
push eax
call fcn.0045d460
add esp, 4
mov dword [ebp - 0x30], 0
mov ecx, dword [ebp - 0x50]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x48], edx
lea ecx, [ebp - 0x2c]
call fcn.0040d4a0
mov byte [ebp - 4], 1
mov eax, dword [0x56f3e8]
mov dword [ebp - 0x3c], eax
mov cx, word [0x56f3ec]
mov word [ebp - 0x38], cx
lea edx, [ebp - 0x3c]
push edx
mov eax, dword [ebp - 0x48]
push eax
call fcn.0047f7b4
add esp, 8
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
je 0x40f2ec
mov ecx, dword [ebp - 0x44]
push ecx
lea ecx, [ebp - 0x168]
call fcn.00401610
mov byte [ebp - 4], 2
lea edx, [ebp - 0x168]
push edx
lea ecx, [ebp - 0x2c]
call fcn.0040f6f0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x168]
call fcn.00401650
lea eax, [ebp - 0x3c]
push eax
push 0
call fcn.0047f7b4
add esp, 8
mov dword [ebp - 0x44], eax
jmp 0x40f2a2
lea ecx, [ebp - 0x2c]
call fcn.00423380
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], 0
lea ecx, [ebp - 0x58]
push ecx
lea ecx, [ebp - 0x2c]
call fcn.0043d6c0
jmp 0x40f31d
push 0
lea edx, [ebp - 0x170]
push edx
lea ecx, [ebp - 0x58]
call fcn.0040f780
lea eax, [ebp - 0x178]
push eax
lea ecx, [ebp - 0x2c]
call fcn.00423350
push eax
lea ecx, [ebp - 0x58]
call fcn.00443090
movzx ecx, al
test ecx, ecx
je 0x40f61d
push str.sign
lea ecx, [ebp - 0xe4]
call fcn.0045ab40
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x58]
call fcn.0040f760
mov ecx, eax
call fcn.00401800
push eax
lea ecx, [ebp - 0x140]
call fcn.00401610
mov byte [ebp - 4], 4
lea edx, [ebp - 0x140]
push edx
lea eax, [ebp - 0x74]
push eax
call fcn.00414f80
add esp, 8
mov byte [ebp - 4], 5
push 0
push 0x56f3f8
lea ecx, [ebp - 0x74]
call fcn.0040f680
mov dword [ebp - 0x120], eax
mov ecx, dword [ebp - 0x120]
cmp ecx, dword [0x5b7c28]
jne 0x40f3dc
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x74]
call fcn.004015d0
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x140]
call fcn.00401650
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xe4]
call fcn.0045ac00
jmp 0x40f30c
mov edx, dword [ebp - 0x120]
push edx
push 0
lea eax, [ebp - 0x11c]
push eax
lea ecx, [ebp - 0x74]
call fcn.0040f6b0
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x11c]
call fcn.004017e0
push eax
push str.code
lea ecx, [ebp - 0xe4]
call fcn.0045ac70
mov ecx, dword [ebp - 0x120]
add ecx, 1
push ecx
push 0x56f404
lea ecx, [ebp - 0x74]
call fcn.0040f680
mov dword [ebp - 0x124], eax
mov edx, dword [ebp - 0x124]
cmp edx, dword [0x5b7c28]
jne 0x40f47d
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x11c]
call fcn.004015d0
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x74]
call fcn.004015d0
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x140]
call fcn.00401650
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xe4]
call fcn.0045ac00
jmp 0x40f30c
mov eax, dword [ebp - 0x124]
sub eax, dword [ebp - 0x120]
sub eax, 1
push eax
mov ecx, dword [ebp - 0x120]
add ecx, 1
push ecx
lea edx, [ebp - 0x90]
push edx
lea ecx, [ebp - 0x74]
call fcn.0040f6b0
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x90]
call fcn.004017e0
push eax
push str.text
lea ecx, [ebp - 0xe4]
call fcn.0045ac70
mov eax, dword [ebp - 0x124]
mov dword [ebp - 0x120], eax
mov ecx, dword [ebp - 0x120]
add ecx, 1
push ecx
push 0x56f410
lea ecx, [ebp - 0x74]
call fcn.0040f680
mov dword [ebp - 0x124], eax
mov edx, dword [ebp - 0x124]
cmp edx, dword [0x5b7c28]
jne 0x40f569
lea ecx, [ebp - 0x74]
call fcn.004467d0
mov dword [ebp - 0x124], eax
mov eax, dword [ebp - 0x120]
add eax, 1
cmp dword [ebp - 0x124], eax
jg 0x40f569
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x90]
call fcn.004015d0
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x11c]
call fcn.004015d0
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x74]
call fcn.004015d0
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x140]
call fcn.00401650
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xe4]
call fcn.0045ac00
jmp 0x40f30c
mov ecx, dword [ebp - 0x124]
sub ecx, dword [ebp - 0x120]
sub ecx, 1
push ecx
mov edx, dword [ebp - 0x120]
add edx, 1
push edx
lea eax, [ebp - 0x100]
push eax
lea ecx, [ebp - 0x74]
call fcn.0040f6b0
mov byte [ebp - 4], 8
lea ecx, [ebp - 0x100]
call fcn.004017e0
push eax
push 0x56f414
lea ecx, [ebp - 0xe4]
call fcn.0045ac70
lea ecx, [ebp - 0xe4]
push ecx
mov ecx, dword [ebp + 0x24]
call fcn.004595e0
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x100]
call fcn.004015d0
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x90]
call fcn.004015d0
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x11c]
call fcn.004015d0
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x74]
call fcn.004015d0
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x140]
call fcn.00401650
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xe4]
call fcn.0045ac00
jmp 0x40f30c
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x2c]
call fcn.0040d4d0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call fcn.00401650
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0047da50
mov esp, ebp
pop ebp
ret 0x20