Function at 0x5057e6
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 0x505a19
cmp eax, esi
je 0x505a19
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 0x505a14
cmp edi, esi
je 0x505a14
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.00505717
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.00505772
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 0x50595b
cmp dword [ebp - 4], esi
je 0x50597c
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 0x50593c
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 0x505a1c
push 2
pop esi
jmp 0x505a07
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
leave
ret