Function at 0x4013a0
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
sub esp, 0xc70
push ebx
push ebp
mov ebp, dword [esp + 0xc7c]
push esi
test ebp, ebp
push edi
je 0x401722
mov edi, dword [esp + 0xc88]
test edi, edi
je 0x401722
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0x80
push 3
push 0
push 3
push connect
push edi
call esi
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x1c], ebx
jne 0x401401
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc70
ret 8
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
mov dword [esp + 0x18], eax
jne 0x401424
pop edi
pop esi
pop ebp
mov eax, 0x3ee
pop ebx
add esp, 0xc70
ret 8
push 0x5c
push edi
call dword [sym.imp.MSVCRT.dll_wcsrchr]
add esp, 8
test eax, eax
jne 0x401446
pop edi
pop esi
pop ebp
mov eax, 0x3ee
pop ebx
add esp, 0xc70
ret 8
push 0
push 0x80
push 3
push 0
push 0
add eax, 2
push 0xc0000000
push ebp
mov dword [esp + 0x40], eax
call esi
mov esi, eax
cmp esi, 0xffffffff
jne 0x401494
push ebp
call fcn.00401740
mov esi, eax
cmp esi, 0xffffffff
jne 0x401494
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc70
ret 8
mov ecx, 0x200
xor eax, eax
lea edi, [esp + 0x480]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x480]
push eax
push esi
call fcn.00401bb0
mov edi, eax
test edi, edi
mov dword [esp + 0x10], edi
je 0x4014d7
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push ebx
call esi
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc70
ret 8
push 2
push 0
push 0xfffff800
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40150f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, eax
call esi
push ebx
call esi
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc70
ret 8
mov ebp, 0x10000
push ebp
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
test edi, edi
jne 0x40154d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, eax
call esi
push ebx
call esi
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc70
ret 8
lea ecx, [esp + 0x28]
xor ebx, ebx
push ecx
call fcn.00409250
mov eax, dword [esp + 0x18]
test eax, eax
jbe 0x4015f3
mov eax, dword [esp + 0x18]
sub eax, ebx
cmp eax, ebp
jae 0x401571
mov ebp, eax
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x14]
push 0
push edx
push ebp
push edi
push eax
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4015df
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4015d5
lea ecx, [esp + 0x20]
push 0
push ecx
push eax
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4015df
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
cmp eax, ecx
jne 0x4015eb
push eax
lea edx, [esp + 0x2c]
push edi
push edx
call fcn.00409280
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x18]
add ebx, ecx
cmp ebx, eax
jb 0x401565
jmp 0x4015f3
mov dword [esp + 0x10], 0x1e
jmp 0x4015f3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
jmp 0x4015f3
mov dword [esp + 0x10], 0x1d
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x401701
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x80]
push 0x20
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x490]
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x2c]
mov ebx, 0x400
push 0x426034
push edx
mov dword [esp + 0x8c], 0x50464746
mov dword [esp + 0x90], ebx
mov dword [esp + 0x98], eax
mov dword [esp + 0x9c], ecx
call fcn.00409280
lea eax, [esp + 0x94]
lea ecx, [esp + 0x28]
push eax
push ecx
call fcn.00409350
push 0x104
lea eax, [esp + 0xc4]
mov edx, dword [esp + 0x28]
push edx
push eax
call dword [sym.imp.MSVCRT.dll_wcsncpy]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
add esp, 0xc
lea ecx, [esp + 0x14]
lea edx, [esp + 0x80]
push 0
push ecx
push ebx
push edx
push esi
call edi
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4016ad
call ebp
mov dword [esp + 0x10], eax
cmp dword [esp + 0x14], ebx
je 0x4016b9
call ebp
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x401701
mov ebx, dword [esp + 0x48c]
lea eax, [esp + 0x14]
push 0
push eax
lea ecx, [esp + 0x488]
push 0x800
inc ebx
push ecx
push esi
mov dword [esp + 0x4a0], ebx
call edi
test eax, eax
jne 0x4016f1
call ebp
mov dword [esp + 0x10], eax
cmp dword [esp + 0x14], 0x800
je 0x401701
call ebp
mov dword [esp + 0x10], eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
mov edx, dword [esp + 0x1c]
push edx
call esi
pop edi
pop esi
mov eax, dword [esp + 8]
pop ebp
pop ebx
add esp, 0xc70
ret 8
pop edi
pop esi
pop ebp
mov eax, 0x57
pop ebx
add esp, 0xc70
ret 8