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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x480
push 0
push 0x80
push 3
push 0
push 3
push closesocket
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
je 0x405754
cmp dword [ebp - 0xc], 0
jne 0x40575e
mov eax, 1
jmp 0x405a9a
push 0
push 0x80
push 2
push 0
push 3
push 0x40000000
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xffffffff
je 0x405789
cmp dword [ebp - 8], 0
jne 0x40579d
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 2
jmp 0x405a9a
push 0x1e
push 0
lea eax, [ebp - 0x2c]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0x2e
push 0
lea ecx, [ebp - 0x464]
push ecx
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0x16
push 0
lea edx, [ebp - 0x47c]
push edx
call sub.MSVCRT.dll_memset
add esp, 0xc
mov dword [ebp - 0x434], 0
mov dword [ebp - 0x2c], 0x4034b50
mov eax, 0xa
mov word [ebp - 0x28], ax
mov cx, word [ebp - 0x28]
mov word [ebp - 0x45e], cx
xor edx, edx
mov word [ebp - 0x26], dx
mov ax, word [ebp - 0x26]
mov word [ebp - 0x45c], ax
xor ecx, ecx
mov word [ebp - 0x24], cx
mov dx, word [ebp - 0x24]
mov word [ebp - 0x45a], dx
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x22]
push ecx
call fcn.00405aa0
add esp, 8
mov dx, word [ebp - 0x22]
mov word [ebp - 0x458], dx
mov ax, word [ebp - 0x20]
mov word [ebp - 0x456], ax
mov ecx, dword [ebp - 0xc]
push ecx
call fcn.00405b50
add esp, 4
mov dword [ebp - 0x1e], eax
mov edx, dword [ebp - 0x1e]
mov dword [ebp - 0x454], edx
push 0
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x1a], eax
mov ecx, dword [ebp - 0x1a]
mov dword [ebp - 0x450], ecx
push 0
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x16], eax
mov eax, dword [ebp - 0x16]
mov dword [ebp - 0x44c], eax
mov ecx, dword [ebp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov word [ebp - 0x12], ax
mov dx, word [ebp - 0x12]
mov word [ebp - 0x448], dx
xor eax, eax
mov word [ebp - 0x10], ax
mov cx, word [ebp - 0x10]
mov word [ebp - 0x446], cx
mov edx, dword [ebp - 0x434]
mov dword [ebp - 0x43a], edx
push 0
lea eax, [ebp - 4]
push eax
push 0x1e
lea ecx, [ebp - 0x2c]
push ecx
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x434]
add eax, 0x1e
mov dword [ebp - 0x434], eax
push 0
lea ecx, [ebp - 4]
push ecx
mov edx, dword [ebp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, dword [ebp - 0x434]
mov dword [ebp - 0x434], eax
push 0
push 0
push 0
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 4], 0
push 0
lea ecx, [ebp - 4]
push ecx
push 0x400
lea edx, [ebp - 0x430]
push edx
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405951
jmp 0x405988
cmp dword [ebp - 4], 0
jne 0x405959
jmp 0x405988
push 0
lea ecx, [ebp - 0x480]
push ecx
mov edx, dword [ebp - 4]
push edx
lea eax, [ebp - 0x430]
push eax
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x434]
add edx, dword [ebp - 4]
mov dword [ebp - 0x434], edx
jmp 0x405928
mov eax, dword [ebp - 0x434]
mov dword [ebp - 0x46c], eax
mov dword [ebp - 0x464], 0x2014b50
mov ecx, 0x14
mov word [ebp - 0x460], cx
xor edx, edx
mov word [ebp - 0x440], dx
mov dword [ebp - 0x43e], 0x20
push 0
lea eax, [ebp - 4]
push eax
push 0x2e
lea ecx, [ebp - 0x464]
push ecx
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x434]
add eax, 0x2e
mov dword [ebp - 0x434], eax
push 0
lea ecx, [ebp - 4]
push ecx
mov edx, dword [ebp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, dword [ebp - 0x434]
mov dword [ebp - 0x434], eax
mov dword [ebp - 0x47c], 0x6054b50
xor eax, eax
mov word [ebp - 0x478], ax
xor ecx, ecx
mov word [ebp - 0x476], cx
mov edx, 1
mov word [ebp - 0x474], dx
mov ax, word [ebp - 0x474]
mov word [ebp - 0x472], ax
mov ecx, dword [ebp - 0x434]
sub ecx, dword [ebp - 0x46c]
mov dword [ebp - 0x470], ecx
xor edx, edx
mov word [ebp - 0x468], dx
push 0
lea eax, [ebp - 4]
push eax
push 0x16
lea ecx, [ebp - 0x47c]
push ecx
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov esp, ebp
pop ebp
ret