Function at 0x42867a
Capabilities:
Clear file content
Get file size
Read file on windows
Write file on windows

Disassembly:
push 0x20
mov eax, 0x432e8d
call fcn.00430dc8
mov edi, dword [ebp + 0xc]
test edi, edi
je 0x42889a
xor ebx, ebx
cmp dword [edi + 0x10], 0xffffffff
je 0x428859
cmp dword [edi + 8], 0
je 0x428859
push ebx
push ebx
push 3
push ebx
push 1
push SysReAllocStringLen
push dword [edi + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x2c], 0x40e59c
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 4], ebx
cmp esi, 0xffffffff
jne 0x4286f9
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x4286e1
mov ecx, eax
jmp 0x4286ea
movzx ecx, ax
or ecx, 0x80070000
push eax
push 0x40d128
push ecx
call fcn.004241bf
add esp, 0xc
lea eax, [ebp - 0x24]
mov dword [ebp - 0x24], ebx
push eax
push esi
mov dword [ebp - 0x20], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x428734
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x42871c
mov ecx, eax
jmp 0x428725
movzx ecx, ax
or ecx, 0x80070000
push eax
push 0x40d170
push ecx
call fcn.004241bf
add esp, 0xc
mov eax, dword [ebp - 0x20]
mov ebx, dword [ebp - 0x24]
mov dword [ebp - 0x10], eax
test eax, eax
jl 0x42880b
jg 0x42875d
test ebx, ebx
je 0x42880b
test eax, eax
jl 0x428764
jg 0x42875d
cmp ebx, 0x100000
jbe 0x428764
mov esi, 0x100000
jmp 0x428766
mov esi, ebx
push 0
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp + 8]
push esi
push dword [eax + 0x5c]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4287a6
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x42878e
mov ecx, eax
jmp 0x428797
movzx ecx, ax
or ecx, 0x80070000
push eax
push 0x40d1c0
push ecx
call fcn.004241bf
add esp, 0xc
push 0
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp + 8]
push esi
push dword [eax + 0x5c]
push dword [edi + 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4287c5
cmp dword [ebp - 0x18], esi
jae 0x4287eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x4287d3
mov ecx, eax
jmp 0x4287dc
movzx ecx, ax
or ecx, 0x80070000
push eax
push 0x40a338
push ecx
call fcn.004241bf
add esp, 0xc
mov eax, dword [ebp - 0x10]
sub ebx, esi
sbb eax, 0
mov dword [ebp - 0x10], eax
test eax, eax
jg 0x42875d
jl 0x428808
test ebx, ebx
jne 0x42874f
mov esi, dword [ebp - 0x14]
push dword [edi + 0x10]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x42883e
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x428826
mov ecx, eax
jmp 0x42882f
movzx ecx, ax
or ecx, 0x80070000
push eax
push 0x40d208
push ecx
call fcn.004241bf
add esp, 0xc
or dword [ebp - 4], 0xffffffff
cmp esi, 0xffffffff
je 0x42884e
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 0x28], 0xffffffff
mov dword [ebp - 0x2c], 0x40e53c
cmp byte [0x43821a], 0
je 0x428871
push dword [edi + 0xc]
push 0x40d254
call sub.msvcrt.dll_wprintf
pop ecx
pop ecx
mov ebx, dword [ebp + 8]
mov eax, dword [edi + 4]
push 1
mov dword [ebx + 0x44], eax
mov eax, dword [edi]
mov esi, dword [eax]
mov ecx, esi
call dword [0x4392d8]
mov ecx, edi
call esi
mov edi, dword [ebx + 0x44]
push 0
pop ebx
test edi, edi
jne 0x428693
call fcn.00430d96
ret 8