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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x5d2950
push eax
mov dword fs:[0], esp
mov eax, dword [esp + 0x10]
sub esp, 0x40
push ebx
push ebp
push edi
xor ebx, ebx
push ebx
push ebx
push 3
push ebx
push 1
push connect
push eax
mov edi, ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x4853b2
push esi
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
lea ecx, [esp + 0x1c]
mov esi, eax
call fcn.00484b70
mov dword [esp + 0x58], ebx
push ebx
lea ecx, [esi + 1]
push ecx
lea ecx, [esp + 0x24]
call fcn.00484bd0
mov dword [esp + 0x4c], 0xf
mov dword [esp + 0x48], ebx
mov byte [esp + 0x38], bl
mov byte [esp + 0x58], 1
mov edx, dword [esp + 0x2c]
sub edx, dword [esp + 0x28]
mov dword [esp + 0x10], ebx
jne 0x4851ff
call fcn.0051d2bd
mov ecx, dword [esp + 0x28]
push ebx
lea eax, [esp + 0x14]
push eax
push esi
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x485369
cmp dword [esp + 0x10], esi
jne 0x485369
mov edx, dword [esp + 0x2c]
sub edx, dword [esp + 0x28]
cmp esi, edx
jb 0x485235
call fcn.0051d2bd
mov eax, dword [esp + 0x28]
mov byte [eax + esi], bl
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
sub ecx, edx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], ebx
jne 0x485259
call fcn.0051d2bd
mov edx, dword [esp + 0x28]
mov eax, edx
lea esi, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x485260
sub eax, esi
push eax
push edx
lea ecx, [esp + 0x3c]
call fcn.004039d0
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x3c]
push ecx
mov ecx, edi
call fcn.00483870
test eax, eax
je 0x485369
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0x48]
cmp esi, ecx
jae 0x485309
jbe 0x4852a9
call fcn.0051d2bd
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x38]
mov edi, 0x10
cmp dword [esp + 0x4c], edi
jae 0x4852bc
lea eax, [esp + 0x38]
cmp byte [eax + esi], 0xd
je 0x485304
cmp esi, ecx
jbe 0x4852cf
call fcn.0051d2bd
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x38]
cmp dword [esp + 0x4c], edi
jae 0x4852dd
lea eax, [esp + 0x38]
cmp byte [eax + esi], 0xa
je 0x485304
cmp esi, ecx
jbe 0x4852f0
call fcn.0051d2bd
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x38]
cmp dword [esp + 0x4c], edi
jae 0x4852fe
lea eax, [esp + 0x38]
cmp byte [eax + esi], 0x3b
jne 0x48530e
inc esi
cmp esi, ecx
jb 0x4852a9
mov edi, 0x10
mov eax, dword [esp + 0x18]
sub esi, eax
push esi
push eax
lea ecx, [esp + 0x3c]
call fcn.00402cb0
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x60]
push ebx
push ebx
push 5
push ebx
push 1
push 0x40000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
je 0x48536e
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x60], ebx
cmp dword [esp + 0x4c], edi
jae 0x485354
lea ecx, [esp + 0x38]
push ebx
lea edx, [esp + 0x64]
push edx
mov edx, dword [esp + 0x50]
push edx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x48536e
mov edi, 0x10
pop esi
cmp ebp, ebx
je 0x48537a
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [esp + 0x54], bl
cmp dword [esp + 0x48], edi
jb 0x485391
mov eax, dword [esp + 0x34]
push eax
call fcn.004d9334
add esp, 4
mov dword [esp + 0x48], 0xf
mov dword [esp + 0x44], ebx
mov byte [esp + 0x34], bl
mov dword [esp + 0x54], 0xffffffff
lea ecx, [esp + 0x18]
call fcn.0041e3b0
mov ecx, dword [esp + 0x4c]
pop edi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x4c
ret 4