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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x62ae98
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x44
mov eax, dword [0x6cd768]
push ebx
push esi
push edi
mov esi, ecx
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x30], esi
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], eax
mov edi, dword [ebp + 0xc]
push 0
push 0
push 3
push 0
push 1
push bind
push edi
mov byte [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp + 0xc], eax
jne 0x547fc2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
lea ecx, [ebp - 0x14]
push str.Error_opening_file__ls__errcode___ld._n
push ecx
call fcn.005fc86b
mov edx, dword [ebp - 0x14]
add esp, 0x10
mov ecx, esi
push edx
call fcn.005427e0
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00603a3c
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
mov ecx, dword [ebp + 0xc]
lea eax, [ebp - 0x2c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
xor ebx, ebx
cmp eax, 0xffffffff
mov dword [ebp - 0x40], eax
jne 0x54802e
test ebx, ebx
jne 0x54802e
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x54802e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea edx, [ebp - 0x14]
push edi
push str.Error_during_GetFileSize____errcode___d._n
push edx
call fcn.005fc86b
mov eax, dword [ebp - 0x14]
add esp, 0xc
mov ecx, esi
push eax
call fcn.005427e0
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x6d36a0]
mov ecx, dword [esi + 0xd4]
push edx
call fcn.005559f0
jmp 0x548506
mov eax, dword [ebp - 0x2c]
push 1
push 0
push 0
push eax
call fcn.005e9a70
mov ecx, dword [ebp - 0x40]
add ecx, eax
adc ebx, edx
mov dword [ebp - 0x40], ecx
push ebx
push ecx
push edi
lea ecx, [ebp - 0x14]
push str.Size_of__ls_is__I64d_n
push ecx
call fcn.005fc86b
mov edx, dword [ebp - 0x14]
add esp, 0x14
mov ecx, esi
push edx
call fcn.005427e0
mov edi, dword [ebp - 0x40]
mov eax, edi
or eax, ebx
jne 0x548081
push str.fSize0_n
mov ecx, esi
call fcn.005427e0
mov ecx, dword [ebp + 0xc]
push ecx
jmp 0x54809e
xor eax, eax
cmp eax, ebx
jl 0x5480c8
jg 0x54808e
cmp dword [ebp + 0x14], edi
jb 0x5480c8
push str.startPos___fSize_n
mov ecx, esi
call fcn.005427e0
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00603a3c
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 eax, dword [ebp + 0x10]
lea ecx, [ebp - 0x18]
push eax
push ecx
call fcn.00402500
add esp, 8
mov edx, dword [ebp - 0x18]
mov ecx, esi
push edx
push ebx
push edi
mov byte [ebp - 4], 2
call fcn.0054ba50
xor ecx, ecx
cmp eax, ecx
je 0x54815b
mov eax, dword [ebp - 0x18]
mov ecx, dword [0x6d3500]
push eax
lea edx, [ebp - 0x14]
push ecx
push edx
call fcn.005fc86b
mov eax, dword [ebp - 0x14]
mov ecx, dword [esi + 0xd4]
add esp, 0xc
push eax
call fcn.005559f0
push str.Disk_is_full._Cannot_add_next_chunks._n
mov ecx, esi
call fcn.005427e0
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.00603a3c
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00603a3c
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 - 0x38], ecx
mov dword [ebp - 0x34], ecx
jg 0x548174
jl 0x54816f
cmp edi, 0x600000
jae 0x548174
mov dword [ebp - 0x1c], edi
jmp 0x54817b
mov dword [ebp - 0x1c], 0x600000
mov edx, dword [ebp - 0x1c]
push edx
call fcn.005e7a99
add esp, 4
mov dword [ebp + 0x10], eax
test eax, eax
jne 0x548240
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x14]
push str.VirtualAlloc_malloc_failed__error__d_n
push eax
call fcn.005fc86b
mov ecx, dword [ebp - 0x14]
add esp, 0xc
push ecx
mov ecx, esi
call fcn.005427e0
mov eax, 0xaaaaaaab
mul dword [ebp - 0x1c]
shr edx, 1
mov eax, edx
push eax
mov dword [ebp - 0x1c], eax
call fcn.005e7a99
add esp, 4
test eax, eax
jne 0x548240
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [ebp - 0x14]
push str.VirtualAlloc_malloc_failed__error__d_n
push edx
call fcn.005fc86b
mov eax, dword [ebp - 0x14]
add esp, 0xc
mov ecx, esi
push eax
call fcn.005427e0
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x6d369c]
mov ecx, dword [esi + 0xd4]
push edx
call fcn.005559f0
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.00603a3c
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00603a3c
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]
xor ecx, ecx
cmp eax, ecx
jbe 0x548263
push ecx
push ecx
mov ecx, dword [ebp + 0xc]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp + 0x14]
xor eax, eax
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x34], eax
xor ecx, ecx
mov eax, dword [esi + 0x18]
cmp eax, ecx
je 0x54827c
mov dl, byte [eax + 0xc]
test dl, dl
jne 0x54827c
mov byte [esi + 0x65], 1
mov dword [esi + 0x60], ecx
mov byte [esi + 0x66], 0
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x20], ecx
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp + 0x10]
lea eax, [ebp - 0x20]
push 0
push eax
mov eax, dword [ebp + 0xc]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5484ad
mov ecx, dword [ebp - 0x20]
test ecx, ecx
je 0x5484ad
mov eax, dword [esi + 0x18]
mov dword [ebp - 0x28], 0
test eax, eax
je 0x5482f0
mov edx, dword [eax + 0x3c]
test edx, edx
jne 0x5482f0
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0x28]
push ecx
lea eax, [ebp - 0x24]
push edx
mov edx, dword [ebp - 0x34]
lea ecx, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x38]
push ecx
mov ecx, dword [ebp + 0x10]
push edx
mov edx, dword [ebp + 8]
push eax
push ebx
push edi
push ecx
push edx
mov ecx, esi
call fcn.00547980
jmp 0x548305
mov edx, dword [ebp + 8]
lea eax, [ebp - 0x24]
push 0
push eax
push ecx
mov ecx, dword [ebp + 0x10]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x54840f
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x20]
cmp eax, ecx
jne 0x54840f
mov edx, dword [ebp - 0x38]
xor eax, eax
add edx, ecx
mov dword [ebp - 0x38], edx
mov edx, dword [ebp - 0x34]
adc edx, eax
mov dword [ebp - 0x34], edx
mov edx, dword [esi + 0x100]
add edx, ecx
mov dword [esi + 0x100], edx
mov ecx, dword [esi + 0x104]
adc ecx, eax
mov eax, dword [esi + 0x18]
test eax, eax
mov dword [esi + 0x104], ecx
je 0x548384
mov edx, dword [ebp - 0x28]
test edx, edx
je 0x548384
mov eax, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x44]
mov edi, eax
or edi, ecx
je 0x548379
cmp ecx, ebx
jg 0x548379
jl 0x548370
mov edi, dword [ebp - 0x40]
cmp eax, edi
jae 0x54837c
mov edi, eax
mov ebx, ecx
mov dword [ebp - 0x40], edi
jmp 0x548384
mov edi, dword [ebp - 0x40]
sub edi, edx
mov dword [ebp - 0x40], edi
sbb ebx, 0
mov eax, dword [esi + 0xd8]
cmp dword [eax], 0
je 0x5483b8
mov ecx, dword [esi + 0x100]
mov edx, dword [esi + 0x104]
mov dword [ebp - 0x50], ecx
lea ecx, [ebp - 0x50]
mov dword [ebp - 0x4c], edx
mov edx, dword [eax]
push ecx
push 0x147b
push 0x111
push edx
call dword [sym.imp.USER32.dll_SendMessageA]
cmp dword [ebp - 0x34], ebx
jl 0x548285
jg 0x5483cc
cmp dword [ebp - 0x38], edi
jb 0x548285
mov eax, dword [ebp + 0x10]
push eax
call fcn.005e7026
mov ecx, dword [ebp + 0xc]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.00603a3c
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00603a3c
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 edx, [ebp - 0x14]
push edi
push str.Fatal_Write_Error__d_n
push edx
call fcn.005fc86b
mov eax, dword [ebp - 0x14]
add esp, 0xc
mov ecx, esi
push eax
call fcn.005427e0
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.005e7026
mov edx, dword [ebp + 0xc]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x6cd768]
mov dword [ebp + 0x14], eax
push 0
lea ecx, [ebp + 8]
push 0
push ecx
push 0x400
push edi
push 0
push 0x1100
mov byte [ebp - 4], 3
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov edx, dword [ebp + 8]
lea eax, [ebp + 0x14]
push edx
push 0x6a10a0
push eax
call fcn.005fc86b
mov ecx, dword [ebp + 8]
add esp, 0xc
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov edx, dword [ebp + 0x14]
mov ecx, dword [esi + 0xd4]
push edx
call fcn.005559f0
lea ecx, [ebp + 0x14]
mov byte [ebp - 4], 2
call fcn.00603a3c
jmp 0x5484fa
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea eax, [ebp - 0x14]
push edi
push str.Fatal_Read_Error__d_n
push eax
call fcn.005fc86b
mov ecx, dword [ebp - 0x14]
add esp, 0xc
push ecx
mov ecx, esi
call fcn.005427e0
mov edx, dword [ebp + 0x10]
push edx
call fcn.005e7026
mov eax, dword [ebp + 0xc]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x6d3694]
push ecx
mov ecx, dword [esi + 0xd4]
call fcn.005559f0
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.00603a3c
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00603a3c
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