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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5cae10
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x32c
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 closesocket
push edi
mov dword [ebp - 0x2c], esi
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp + 0xc], eax
jne 0x50a85e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
lea eax, [ebp - 0x238]
push str.Error_opening_file__ls__errcode___ld._n
push eax
call fcn.00589e0a
add esp, 0x10
lea ecx, [ebp - 0x238]
push ecx
mov ecx, esi
call fcn.00507f30
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 - 0x30]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
mov dword [ebp - 0x20], eax
jne 0x50a8d7
test ebx, ebx
jne 0x50a8d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x50a8d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea eax, [ebp - 0x238]
push edi
push str.Error_during_GetFileSize____errcode___d._n
push eax
call fcn.00589e0a
add esp, 0xc
lea ecx, [ebp - 0x238]
push ecx
mov ecx, esi
call fcn.00507f30
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x688c14]
mov ecx, dword [esi + 0x6c]
push eax
call fcn.00513250
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 - 0x30]
push 1
push 0
push 0
push ecx
call fcn.0058bcb0
mov ecx, dword [ebp - 0x20]
add ecx, eax
adc ebx, edx
lea edx, [ebp - 0x238]
push ebx
push ecx
push edi
push str.Size_of__ls_is__I64d_n
push edx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], ebx
call fcn.00589e0a
add esp, 0x14
lea eax, [ebp - 0x238]
mov ecx, esi
push eax
call fcn.00507f30
mov edi, dword [ebp - 0x20]
mov ecx, edi
or ecx, ebx
jne 0x50a94f
push str.fSize0_n
mov ecx, esi
call fcn.00507f30
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 0x50a98a
jg 0x50a95c
cmp dword [ebp + 0x14], edi
jb 0x50a98a
push str.startPos___fSize_n
mov ecx, esi
call fcn.00507f30
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.005a590d
mov edx, dword [ebp - 0x14]
mov ecx, esi
push edx
push ebx
push edi
mov byte [ebp - 4], 1
call fcn.0050db10
xor ecx, ecx
cmp eax, ecx
je 0x50aa10
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x688a74]
push eax
lea edx, [ebp - 0x338]
push ecx
push edx
call fcn.00589e0a
mov ecx, dword [esi + 0x6c]
add esp, 0xc
lea eax, [ebp - 0x338]
push eax
call fcn.00513250
push str.Disk_is_full._Cannot_add_next_chunks._n
mov ecx, esi
call fcn.00507f30
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.005a584d
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 - 0x28], ecx
mov dword [ebp - 0x24], ecx
jg 0x50aa29
jl 0x50aa24
cmp edi, 0x600000
jae 0x50aa29
mov dword [ebp + 0x10], edi
jmp 0x50aa33
mov dword [ebp + 0x10], 0x600000
mov edi, dword [ebp + 0x10]
push edi
call fcn.00589cd0
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x50aaef
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [ebp - 0x238]
push str.VirtualAlloc_malloc_failed__error__d_n
push edx
call fcn.00589e0a
add esp, 0xc
lea eax, [ebp - 0x238]
mov ecx, esi
push eax
call fcn.00507f30
mov eax, 0xaaaaaaab
mul edi
shr edx, 1
mov eax, edx
push eax
mov dword [ebp + 0x10], eax
call fcn.00589cd0
add esp, 4
test eax, eax
jne 0x50aaef
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [ebp - 0x238]
push str.VirtualAlloc_malloc_failed__error__d_n
push ecx
call fcn.00589e0a
add esp, 0xc
lea edx, [ebp - 0x238]
mov ecx, esi
push edx
call fcn.00507f30
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x688c10]
push ecx
mov ecx, dword [esi + 0x6c]
call fcn.00513250
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], bl
call fcn.005a584d
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 0x50ab0c
mov edx, dword [ebp + 0xc]
push 0
push 0
push edi
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor eax, eax
mov dword [ebp - 0x24], eax
jmp 0x50ab0f
mov edi, dword [ebp - 0x28]
mov dword [ebp - 0x18], 0
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
lea eax, [ebp - 0x18]
push 0
push eax
push ecx
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x50ac90
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x50ac90
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x34]
push 0
push ecx
push eax
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x50abf1
mov edx, dword [ebp - 0x34]
mov eax, dword [ebp - 0x18]
cmp eax, edx
jne 0x50abf1
mov eax, dword [ebp - 0x24]
xor ecx, ecx
add edi, edx
adc eax, ecx
add dword [esi + 0x98], edx
mov edx, dword [esi + 0x9c]
mov dword [ebp - 0x24], eax
lea eax, [esi + 0x98]
adc edx, ecx
mov ecx, dword [esi + 0x70]
mov dword [eax + 4], edx
mov ecx, dword [ecx]
test ecx, ecx
je 0x50aba4
push eax
push 0x147b
push 0x111
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x1c]
cmp edx, eax
jl 0x50ab16
jg 0x50abbd
cmp edi, dword [ebp - 0x20]
jb 0x50ab16
push ebx
call fcn.005895ef
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.005a584d
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 - 0x238]
push edi
push str.Fatal_Write_Error__d_n
push ecx
call fcn.00589e0a
add esp, 0xc
lea edx, [ebp - 0x238]
mov ecx, esi
push edx
call fcn.00507f30
push ebx
call fcn.005895ef
mov eax, dword [ebp + 0xc]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x682f9c]
mov dword [ebp + 0x14], ecx
push 0
lea edx, [ebp + 0x10]
push 0
push edx
push 0x400
push edi
push 0
push 0x1100
mov byte [ebp - 4], 2
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov eax, dword [ebp + 0x10]
lea ecx, [ebp + 0x14]
push eax
push 0x65bf6c
push ecx
call fcn.0059e618
mov edx, dword [ebp + 0x10]
add esp, 0xc
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp + 0x14]
mov ecx, dword [esi + 0x6c]
push eax
call fcn.00513250
lea ecx, [ebp + 0x14]
mov byte [ebp - 4], 1
call fcn.005a584d
jmp 0x50acdd
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea ecx, [ebp - 0x238]
push edi
push str.Fatal_Read_Error__d_n
push ecx
call fcn.00589e0a
add esp, 0xc
lea edx, [ebp - 0x238]
mov ecx, esi
push edx
call fcn.00507f30
push ebx
call fcn.005895ef
mov eax, dword [ebp + 0xc]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x688c08]
push ecx
mov ecx, dword [esi + 0x6c]
call fcn.00513250
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.005a584d
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