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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x47c
push ebx
push esi
push edi
xor esi, esi
mov edi, 0x80
push esi
mov ebx, dword [sym.imp.KERNEL32.DLL_CreateFileA]
push edi
push 3
push esi
push 3
push connect
push dword [ebp + 8]
call ebx
cmp eax, 0xffffffff
mov dword [ebp - 8], eax
je 0x5083cf
cmp eax, esi
je 0x5083cf
push esi
push edi
push 2
push esi
push 3
push 0x40000000
push dword [ebp + 0xc]
call ebx
mov edi, eax
cmp edi, 0xffffffff
mov dword [ebp - 0xc], edi
je 0x5083ca
cmp edi, esi
je 0x5083ca
push 0x1e
lea eax, [ebp - 0x48]
push esi
push eax
call sub.MSVCRT.dll_memset
push 0x2e
lea eax, [ebp - 0x78]
push esi
push eax
call sub.MSVCRT.dll_memset
push 0x16
lea eax, [ebp - 0x28]
push esi
push eax
call sub.MSVCRT.dll_memset
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x48], 0x4034b50
push eax
lea eax, [ebp - 0x3e]
push eax
mov word [ebp - 0x44], 0xa
mov word [ebp - 0x72], 0xa
mov word [ebp - 0x42], si
mov word [ebp - 0x70], si
mov word [ebp - 0x40], si
mov word [ebp - 0x6e], si
call fcn.005080a5
mov ax, word [ebp - 0x3e]
push dword [ebp - 8]
mov word [ebp - 0x6c], ax
mov ax, word [ebp - 0x3c]
mov word [ebp - 0x6a], ax
call fcn.00508128
mov ebx, dword [sym.imp.KERNEL32.DLL_GetFileSize]
add esp, 0x30
mov dword [ebp - 0x3a], eax
mov dword [ebp - 0x68], eax
push esi
push dword [ebp - 8]
call ebx
push esi
mov dword [ebp - 0x36], eax
push dword [ebp - 8]
mov dword [ebp - 0x64], eax
call ebx
push dword [ebp + 0x10]
mov ebx, dword [sym.imp.KERNEL32.DLL_lstrlenA]
mov dword [ebp - 0x32], eax
mov dword [ebp - 0x60], eax
call ebx
mov word [ebp - 0x2e], ax
mov word [ebp - 0x5c], ax
lea eax, [ebp - 4]
push esi
push eax
lea eax, [ebp - 0x48]
push 0x1e
push eax
push edi
mov edi, dword [sym.imp.KERNEL32.DLL_WriteFile]
mov word [ebp - 0x2c], si
mov word [ebp - 0x5a], si
mov dword [ebp - 0x4e], esi
call edi
lea eax, [ebp - 4]
push esi
push eax
push dword [ebp + 0x10]
call ebx
push eax
push dword [ebp + 0x10]
push dword [ebp - 0xc]
call edi
push dword [ebp + 0x10]
call ebx
push esi
push esi
add eax, 0x1e
push esi
push dword [ebp - 8]
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
jmp 0x508311
cmp dword [ebp - 4], esi
je 0x508332
lea eax, [ebp - 0x7c]
push esi
push eax
lea eax, [ebp - 0x47c]
push dword [ebp - 4]
push eax
push dword [ebp - 0xc]
call edi
mov eax, dword [ebp - 4]
add dword [ebp - 0x10], eax
lea eax, [ebp - 4]
push esi
push eax
lea eax, [ebp - 0x47c]
push 0x400
push eax
push dword [ebp - 8]
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
jne 0x5082f2
mov eax, dword [ebp - 0x10]
push esi
mov dword [ebp - 0x18], eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x78]
push 0x2e
push eax
push dword [ebp - 0xc]
mov dword [ebp - 0x78], 0x2014b50
mov word [ebp - 0x74], 0x14
mov word [ebp - 0x54], si
mov dword [ebp - 0x52], 0x20
call edi
lea eax, [ebp - 4]
push esi
push eax
push dword [ebp + 0x10]
call ebx
push eax
push dword [ebp + 0x10]
push dword [ebp - 0xc]
call edi
push dword [ebp + 0x10]
call ebx
mov ecx, dword [ebp - 0x10]
push esi
mov dword [ebp - 0x28], 0x6054b50
mov word [ebp - 0x24], si
lea eax, [ecx + eax + 0x2e]
mov word [ebp - 0x22], si
sub eax, dword [ebp - 0x18]
mov word [ebp - 0x20], 1
mov word [ebp - 0x1e], 1
mov word [ebp - 0x14], si
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x28]
push 0x16
push eax
push dword [ebp - 0xc]
call edi
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov eax, esi
jmp 0x5083d2
push 2
pop esi
jmp 0x5083bd
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
leave
ret