Function at 0x40f00d
Capabilities:
Get file size
Read file on windows

Disassembly:
push 0x2c
mov eax, 0x4a491a
call fcn.00483f50
and dword [ebp - 4], 0
and dword [ebp - 0x14], 0
mov ebx, dword [ebp + 8]
push 0x4f19f8
mov ecx, ebx
call fcn.004016bd
mov esi, dword [ebp + 0xc]
and dword [ebp - 4], 0
mov eax, dword [esi]
xor edx, edx
inc edx
cmp dword [eax - 0xc], 0
mov ecx, edx
push 3
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x14], ecx
pop edi
je 0x40f08a
push 0x4ae02c
mov ecx, esi
call fcn.00403715
test eax, eax
je 0x40f087
lea eax, [ebp - 0x20]
push eax
call fcn.0040ec07
pop ecx
push dword [eax]
mov ecx, edi
mov dword [ebp - 0x14], ecx
mov ecx, esi
mov dword [ebp - 4], 1
call fcn.00403715
test eax, eax
je 0x40f087
xor dl, dl
mov dword [ebp - 0x18], edx
jmp 0x40f08a
xor edx, edx
inc edx
mov eax, dword [ebp - 0x14]
and dword [ebp - 4], 0
test al, 2
je 0x40f0a9
mov ecx, dword [ebp - 0x20]
and eax, 0xfffffffd
lea ecx, [ecx - 0x10]
mov dword [ebp - 0x14], eax
call fcn.00404d08
mov edx, dword [ebp - 0x18]
test dl, dl
je 0x40f0d6
lea eax, [ebp - 0x20]
push eax
call fcn.0040ec07
pop ecx
mov dword [ebp - 4], 2
push eax
mov ecx, ebx
call fcn.00401cd5
mov ecx, dword [ebp - 0x20]
lea ecx, [ecx - 0x10]
call fcn.00404d08
jmp 0x40f2ca
push 0
push 0
push edi
push 0
push 0
push SysReAllocStringLen
push dword [esi]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x18], esi
cmp esi, 0xffffffff
jne 0x40f105
lea eax, [ebp - 0x20]
push eax
call fcn.0040ec07
pop ecx
mov dword [ebp - 4], edi
jmp 0x40f0be
push 8
lea eax, [ebp - 0x2c]
push 0
push eax
call fcn.004845c0
add esp, 0xc
lea eax, [ebp - 0x2c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40f14d
lea eax, [ebp - 0x20]
push eax
call fcn.0040ec07
pop ecx
mov dword [ebp - 4], 4
push eax
mov ecx, ebx
call fcn.00401cd5
mov ecx, dword [ebp - 0x20]
lea ecx, [ecx - 0x10]
call fcn.00404d08
jmp 0x40f2c3
cmp dword [ebp - 0x28], 0
je 0x40f166
lea eax, [ebp - 0x20]
push eax
call fcn.0040ec07
pop ecx
mov dword [ebp - 4], 5
jmp 0x40f135
cmp dword [ebp - 0x2c], 0
je 0x40f2c3
xor eax, eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
push dword [ebp - 0x2c]
lea ecx, [ebp - 0x38]
mov dword [ebp - 4], 6
call fcn.0040f47d
mov edi, dword [ebp - 0x38]
and dword [ebp - 0x24], 0
push 0
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x2c]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40f1b6
lea ecx, [ebp - 0x38]
call fcn.0040f419
jmp 0x40f2c3
xor eax, eax
mov byte [ebp + 0xf], al
mov byte [ebp - 0xd], al
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0xd]
push eax
lea eax, [ebp + 0xf]
push eax
push edi
call fcn.0042dba4
mov eax, dword [ebp - 0x1c]
add esp, 0x10
test eax, eax
jle 0x40f1f0
add eax, edi
push eax
push edi
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x38]
call fcn.00412f83
mov edi, dword [ebp - 0x38]
cmp byte [ebp - 0xd], 0
mov esi, dword [ebp - 0x34]
je 0x40f213
mov ecx, edi
cmp edi, esi
je 0x40f213
mov dl, byte [ecx]
mov bl, byte [ecx + 1]
mov byte [ecx + 1], dl
mov byte [ecx], bl
add ecx, 2
cmp ecx, esi
jne 0x40f1ff
mov ebx, dword [ebp + 8]
sub esi, edi
cmp byte [edi + esi - 1], 0
je 0x40f248
inc esi
push esi
lea ecx, [ebp - 0x38]
call fcn.0040f47d
mov edi, dword [ebp - 0x38]
mov byte [edi + esi - 1], 0
cmp byte [ebp + 0xf], 0
je 0x40f28b
inc esi
push esi
lea ecx, [ebp - 0x38]
call fcn.0040f47d
mov edi, dword [ebp - 0x38]
mov byte [edi + esi - 1], 0
jmp 0x40f263
cmp byte [ebp + 0xf], 0
je 0x40f28b
lea eax, [esi + 2]
push eax
lea ecx, [ebp - 0x38]
call fcn.0040f47d
mov edi, dword [ebp - 0x38]
mov word [edi + esi], 0
cmp byte [ebp + 0xf], 0
je 0x40f28b
push edi
lea ecx, [ebp - 0x20]
call fcn.0040185d
push eax
mov ecx, ebx
mov byte [ebp - 4], 7
call fcn.00401cd5
mov ecx, dword [ebp - 0x20]
lea ecx, [ecx - 0x10]
call fcn.00404d08
jmp 0x40f2b8
push edi
lea ecx, [ebp - 0x20]
call fcn.0040ed71
push eax
mov ecx, ebx
mov byte [ebp - 4], 8
call fcn.00401cd5
mov ecx, dword [ebp - 0x20]
mov byte [ebp - 4], 6
lea ecx, [ecx - 0x10]
call fcn.00404d08
push ebx
push ebx
call fcn.0042d230
pop ecx
pop ecx
lea ecx, [ebp - 0x38]
call fcn.0040f419
mov esi, dword [ebp - 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
call fcn.00483f1e
ret