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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x58d488
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x268
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x10], esp
push 0
push 0
push 3
push 0
push 1
mov esi, ecx
push connect
push edi
mov dword [ebp - 0x28], esi
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp + 0xc], eax
jne 0x4e6fc3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
lea eax, [ebp - 0x174]
push str.Error_opening_file__s__errcode___ld._n
push eax
call fcn.0054ea2a
add esp, 0x10
lea ecx, [ebp - 0x174]
push ecx
mov ecx, esi
call fcn.004e50a0
mov eax, 0x7535
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
lea edx, [ebp - 0x2c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
xor eax, eax
cmp ebx, 0xffffffff
mov dword [ebp - 0x18], eax
jne 0x4e7040
test eax, eax
jne 0x4e7040
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4e7040
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea eax, [ebp - 0x174]
push edi
push str.Error_during_GetFileSize____errcode___d._n
push eax
call fcn.0054ea2a
add esp, 0xc
lea ecx, [ebp - 0x174]
push ecx
mov ecx, esi
call fcn.004e50a0
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x63f498]
mov ecx, dword [esi + 0x4c]
push eax
call fcn.004ec300
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [ebp - 0x2c]
push 1
push 0
push 0
push ecx
call fcn.00550840
add ebx, eax
mov eax, dword [ebp - 0x18]
adc eax, edx
lea edx, [ebp - 0x174]
push eax
push ebx
push edi
push str.Size_of__s_is__I64d_n
push edx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x18], eax
call fcn.0054ea2a
add esp, 0x14
lea eax, [ebp - 0x174]
mov ecx, esi
push eax
call fcn.004e50a0
mov edi, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x18]
push edi
push ecx
push ebx
mov ecx, esi
call fcn.004e8c80
xor ecx, ecx
cmp eax, ecx
je 0x4e70eb
mov edx, dword [0x63f2f8]
push edi
lea eax, [ebp - 0x274]
push edx
push eax
call fcn.0054ea2a
add esp, 0xc
lea ecx, [ebp - 0x274]
push ecx
mov ecx, dword [esi + 0x4c]
call fcn.004ec300
push str.Disk_is_full._Cannot_add_next_chunks._n
mov ecx, esi
call fcn.004e50a0
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0x755f
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x24], ecx
cmp eax, ecx
mov dword [ebp - 0x20], ecx
jg 0x4e7109
jl 0x4e7102
cmp ebx, 0x600000
jae 0x4e7109
mov edi, ebx
mov dword [ebp + 0x10], edi
jmp 0x4e7113
mov dword [ebp + 0x10], 0x600000
mov edi, dword [ebp + 0x10]
push edi
call fcn.0054e8f0
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x4e71c4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x174]
push str.VirtualAlloc_malloc_failed__error__d_n
push eax
call fcn.0054ea2a
add esp, 0xc
lea ecx, [ebp - 0x174]
push ecx
mov ecx, esi
call fcn.004e50a0
mov eax, 0xaaaaaaab
mul edi
shr edx, 1
mov eax, edx
push eax
mov dword [ebp + 0x10], eax
call fcn.0054e8f0
add esp, 4
test eax, eax
jne 0x4e71c4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [ebp - 0x174]
push str.VirtualAlloc_malloc_failed__error__d_n
push edx
call fcn.0054ea2a
add esp, 0xc
lea eax, [ebp - 0x174]
mov ecx, esi
push eax
call fcn.004e50a0
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x63f494]
mov ecx, dword [esi + 0x4c]
push edx
call fcn.004ec300
mov eax, 0x7564
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov edi, dword [ebp + 0x14]
test edi, edi
jbe 0x4e71e3
mov eax, dword [ebp + 0xc]
push 0
push 0
push edi
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x20], 0
jmp 0x4e71e6
mov edi, dword [ebp - 0x24]
mov dword [ebp - 0x14], 0
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
lea ecx, [ebp - 0x14]
push 0
push ecx
push edx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4e7361
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x4e7361
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x30]
push 0
push ecx
push eax
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4e72af
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x14]
cmp eax, edx
jne 0x4e72af
mov eax, dword [ebp - 0x20]
xor ecx, ecx
add edi, edx
adc eax, ecx
add dword [esi + 0x78], edx
mov edx, dword [esi + 0x7c]
mov dword [ebp - 0x20], eax
lea eax, [esi + 0x78]
adc edx, ecx
mov ecx, dword [esi + 0x50]
mov dword [eax + 4], edx
mov ecx, dword [ecx]
test ecx, ecx
je 0x4e726e
push eax
push 0x1393
push 0x111
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x18]
cmp edx, eax
jl 0x4e71ed
jg 0x4e7287
cmp edi, dword [ebp - 0x1c]
jb 0x4e71ed
push ebx
call fcn.0054e170
mov eax, dword [ebp + 0xc]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea ecx, [ebp - 0x174]
push edi
push str.Fatal_Write_Error__d_n
push ecx
call fcn.0054ea2a
add esp, 0xc
lea edx, [ebp - 0x174]
mov ecx, esi
push edx
call fcn.004e50a0
push ebx
call fcn.0054e170
mov eax, dword [ebp + 0xc]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x639ad4]
mov dword [ebp + 0x10], ecx
push 0
lea edx, [ebp + 0x14]
push 0
push edx
push 0x400
push edi
push 0
push 0x1100
mov byte [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov eax, dword [ebp + 0x14]
lea ecx, [ebp + 0x10]
push eax
push 0x615e9c
push ecx
call fcn.00562ecb
mov edx, dword [ebp + 0x14]
add esp, 0xc
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp + 0x10]
mov ecx, dword [esi + 0x4c]
push eax
call fcn.004ec300
lea ecx, [ebp + 0x10]
mov byte [ebp - 4], 0
call fcn.0056a100
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea ecx, [ebp - 0x174]
push edi
push str.Fatal_Read_Error__d_n
push ecx
call fcn.0054ea2a
add esp, 0xc
lea edx, [ebp - 0x174]
mov ecx, esi
push edx
call fcn.004e50a0
push ebx
call fcn.0054e170
mov eax, dword [ebp + 0xc]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x63f48c]
push ecx
mov ecx, dword [esi + 0x4c]
call fcn.004ec300
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10