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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 8], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x30]
add ecx, 0x14
call fcn.0040f280
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40619a
jmp 0x4063ce
push 0
push 0x80
push 3
push 0
push 1
push closesocket
mov ecx, dword [ebp - 0x30]
add ecx, 0x14
call fcn.0040f280
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
jne 0x4061d1
jmp 0x4063ce
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 8], eax
cmp dword [ebp - 0x1c], 0
jne 0x4061f1
cmp dword [ebp - 8], 0x200000
jbe 0x4061fb
jmp 0x4063ce
cmp dword [ebp - 8], 0
je 0x406207
cmp dword [ebp - 8], 0xffffffff
jne 0x406211
jmp 0x4063ce
mov edx, dword [ebp - 0x30]
cmp dword [edx + 0x18], 0
je 0x4062ce
mov eax, dword [ebp - 8]
add eax, 1
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0044be20
add esp, 4
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x20]
mov dword [eax], ecx
mov edx, dword [ebp + 8]
cmp dword [edx], 0
jne 0x40625a
jmp 0x4063ce
mov eax, dword [ebp - 8]
lea ecx, [eax + eax + 2]
push ecx
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call sub.MSVCR80.dll_memset
add esp, 0xc
push 0
push 0
push 2
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x406291
jmp 0x4063ce
push 0
lea edx, [ebp - 0xc]
push edx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4062b9
jmp 0x4063ce
cmp dword [ebp - 0xc], 0
jne 0x4062c9
jmp 0x4063c7
jmp 0x4063c7
mov ecx, dword [ebp - 8]
add ecx, 1
push ecx
call fcn.0044be20
add esp, 4
mov dword [ebp - 0x24], eax
mov edx, dword [ebp - 0x24]
mov dword [ebp - 0x18], edx
cmp dword [ebp - 0x18], 0
jne 0x4062f6
jmp 0x4063ce
mov eax, dword [ebp - 8]
add eax, 1
push eax
push 0
mov ecx, dword [ebp - 0x18]
push ecx
call sub.MSVCR80.dll_memset
add esp, 0xc
push 0
lea edx, [ebp - 0xc]
push edx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x406331
jmp 0x4063ce
push 0
push 0
push 0xffffffffffffffff
mov eax, dword [ebp - 0x18]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x406352
jmp 0x4063ce
mov eax, dword [ebp - 4]
add eax, 2
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0044be20
add esp, 4
mov dword [ebp - 0x28], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x28]
mov dword [eax], ecx
mov edx, dword [ebp + 8]
cmp dword [edx], 0
jne 0x406388
jmp 0x4063ce
mov eax, dword [ebp - 4]
lea ecx, [eax + eax + 2]
push ecx
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call sub.MSVCR80.dll_memset
add esp, 0xc
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
push 0xffffffffffffffff
mov ecx, dword [ebp - 0x18]
push ecx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x4063c7
jmp 0x4063ce
mov dword [ebp - 0x14], 1
cmp dword [ebp - 0x10], 0xffffffff
je 0x4063e5
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x10], 0xffffffff
cmp dword [ebp - 0x18], 0
je 0x406404
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x2c]
push ecx
call sub.MSVCR80.dll_void___cdecl_operator_delete___void__
add esp, 4
mov dword [ebp - 0x18], 0
mov eax, dword [ebp - 0x14]
mov esp, ebp
pop ebp
ret 4