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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x606880
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x33c
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
xor ebx, ebx
mov dword [ebp - 0x10], esp
push ebx
push ebx
push 3
push ebx
push 1
mov esi, ecx
push connect
push edi
mov dword [ebp - 0x44], esi
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp + 0xc], eax
jne 0x52d98e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
lea eax, [ebp - 0x248]
push str.Error_opening_file__ls__errcode___ld._n
push eax
call fcn.005c3648
add esp, 0x10
lea ecx, [ebp - 0x248]
push ecx
mov ecx, esi
call fcn.00529460
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 - 0x40]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
mov dword [ebp - 0x1c], eax
jne 0x52da0a
test ebx, ebx
jne 0x52da0a
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x52da0a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea eax, [ebp - 0x248]
push edi
push str.Error_during_GetFileSize____errcode___d._n
push eax
call fcn.005c3648
add esp, 0xc
lea ecx, [ebp - 0x248]
push ecx
mov ecx, esi
call fcn.00529460
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x6ce048]
mov ecx, dword [esi + 0xd4]
push eax
call fcn.0053a7e0
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 - 0x40]
push 1
push 0
push 0
push ecx
call fcn.005c5530
mov ecx, dword [ebp - 0x1c]
add ecx, eax
adc ebx, edx
lea edx, [ebp - 0x248]
push ebx
push ecx
push edi
push str.Size_of__ls_is__I64d_n
push edx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], ebx
call fcn.005c3648
add esp, 0x14
lea eax, [ebp - 0x248]
mov ecx, esi
push eax
call fcn.00529460
mov edi, dword [ebp - 0x1c]
mov ecx, edi
or ecx, ebx
jne 0x52da82
push str.fSize0_n
mov ecx, esi
call fcn.00529460
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0x757c
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
xor eax, eax
cmp eax, ebx
jl 0x52dabd
jg 0x52da8f
cmp dword [ebp + 0x14], edi
jb 0x52dabd
push str.startPos___fSize_n
mov ecx, esi
call fcn.00529460
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0x757c
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 + 0x10]
push ecx
lea ecx, [ebp - 0x14]
call fcn.005df326
mov edx, dword [ebp - 0x14]
mov ecx, esi
push edx
push ebx
push edi
mov byte [ebp - 4], 1
call fcn.005314a0
xor ecx, ecx
cmp eax, ecx
je 0x52db46
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x6cdea8]
push eax
lea edx, [ebp - 0x348]
push ecx
push edx
call fcn.005c3648
mov ecx, dword [esi + 0xd4]
add esp, 0xc
lea eax, [ebp - 0x348]
push eax
call fcn.0053a7e0
push str.Disk_is_full._Cannot_add_next_chunks._n
mov ecx, esi
call fcn.00529460
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.005df266
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
cmp ebx, ecx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x20], ecx
jg 0x52db5f
jl 0x52db5a
cmp edi, 0x600000
jae 0x52db5f
mov dword [ebp + 0x10], edi
jmp 0x52db66
mov dword [ebp + 0x10], 0x600000
mov edx, dword [ebp + 0x10]
push edx
call fcn.005c350e
mov edi, eax
add esp, 4
test edi, edi
mov dword [ebp - 0x28], edi
jne 0x52dc2d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x248]
push str.VirtualAlloc_malloc_failed__error__d_n
push eax
call fcn.005c3648
add esp, 0xc
lea ecx, [ebp - 0x248]
push ecx
mov ecx, esi
call fcn.00529460
mov eax, 0xaaaaaaab
mul dword [ebp + 0x10]
shr edx, 1
mov eax, edx
push eax
mov dword [ebp + 0x10], eax
call fcn.005c350e
add esp, 4
test eax, eax
jne 0x52dc2d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [ebp - 0x248]
push str.VirtualAlloc_malloc_failed__error__d_n
push edx
call fcn.005c3648
add esp, 0xc
lea eax, [ebp - 0x248]
mov ecx, esi
push eax
call fcn.00529460
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x6ce044]
mov ecx, dword [esi + 0xd4]
push edx
call fcn.0053a7e0
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.005df266
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 eax, dword [ebp + 0x14]
test eax, eax
jbe 0x52dc4e
push 0
push 0
push eax
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp + 0x14]
xor eax, eax
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x20], eax
mov eax, dword [esi + 0x18]
xor ecx, ecx
cmp eax, ecx
je 0x52dc68
mov dl, byte [eax + 0xc]
test dl, dl
jne 0x52dc68
mov byte [esi + 0x65], 1
mov dword [esi + 0x60], ecx
mov byte [esi + 0x66], cl
mov dword [ebp - 0x3c], ecx
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x2c], ecx
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
lea edx, [ebp - 0x2c]
push 0
push edx
push eax
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x52de97
mov ecx, dword [ebp - 0x2c]
test ecx, ecx
je 0x52de97
mov eax, dword [esi + 0x18]
mov dword [ebp - 0x34], 0
test eax, eax
je 0x52dcd9
mov edx, dword [eax + 0x34]
test edx, edx
jne 0x52dcd9
lea edx, [ebp - 0x3c]
lea eax, [ebp - 0x34]
push edx
lea ecx, [ebp - 0x30]
push eax
mov eax, dword [ebp - 0x20]
lea edx, [ebp - 0x2c]
push ecx
mov ecx, dword [ebp - 0x24]
push edx
mov edx, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp + 8]
push ecx
push ebx
push edx
push edi
push eax
mov ecx, esi
call fcn.0052d370
jmp 0x52dceb
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x30]
push 0
push edx
push ecx
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x52ddd3
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
cmp eax, edx
jne 0x52ddd3
mov eax, dword [ebp - 0x24]
xor ecx, ecx
add eax, edx
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x20]
adc eax, ecx
add dword [esi + 0x100], edx
mov edx, dword [esi + 0x104]
mov dword [ebp - 0x20], eax
lea eax, [esi + 0x100]
adc edx, ecx
mov ecx, dword [esi + 0x18]
test ecx, ecx
mov dword [eax + 4], edx
je 0x52dd68
mov edi, dword [ebp - 0x34]
test edi, edi
je 0x52dd65
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x38]
mov ebx, ecx
or ebx, edx
mov ebx, dword [ebp - 0x18]
je 0x52dd5c
cmp edx, ebx
jg 0x52dd5c
jl 0x52dd52
cmp ecx, dword [ebp - 0x1c]
jae 0x52dd59
mov dword [ebp - 0x1c], ecx
mov ebx, edx
jmp 0x52dd62
mov ebx, dword [ebp - 0x18]
sub dword [ebp - 0x1c], edi
sbb ebx, 0
mov dword [ebp - 0x18], ebx
mov edi, dword [ebp - 0x28]
mov ecx, dword [esi + 0xd8]
mov ecx, dword [ecx]
test ecx, ecx
je 0x52dd86
push eax
push 0x147b
push 0x111
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
cmp dword [ebp - 0x20], ebx
jl 0x52dc71
jg 0x52dd9f
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
cmp eax, edx
jb 0x52dc71
push edi
call fcn.005c2dff
mov eax, dword [ebp + 0xc]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.005df266
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 - 0x248]
push edi
push str.Fatal_Write_Error__d_n
push ecx
call fcn.005c3648
add esp, 0xc
lea edx, [ebp - 0x248]
mov ecx, esi
push edx
call fcn.00529460
mov eax, dword [ebp - 0x28]
push eax
call fcn.005c2dff
mov ecx, dword [ebp + 0xc]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x6c826c]
mov dword [ebp + 0x14], edx
push 0
lea eax, [ebp + 8]
push 0
push eax
push 0x400
push edi
push 0
push 0x1100
mov byte [ebp - 4], 2
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov ecx, dword [ebp + 8]
lea edx, [ebp + 0x14]
push ecx
push 0x69dfbc
push edx
call fcn.005d809b
mov eax, dword [ebp + 8]
add esp, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov ecx, dword [ebp + 0x14]
push ecx
mov ecx, dword [esi + 0xd4]
call fcn.0053a7e0
lea ecx, [ebp + 0x14]
mov byte [ebp - 4], 1
call fcn.005df266
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.005df266
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 ebx, eax
lea edx, [ebp - 0x248]
push ebx
push str.Fatal_Read_Error__d_n
push edx
call fcn.005c3648
add esp, 0xc
lea eax, [ebp - 0x248]
mov ecx, esi
push eax
call fcn.00529460
push edi
call fcn.005c2dff
mov ecx, dword [ebp + 0xc]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x6ce03c]
mov ecx, dword [esi + 0xd4]
push edx
call fcn.0053a7e0
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.005df266
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10