Function at 0x838c42
Capabilities:
Clear file content
Move file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x15c
and dword [ebp - 8], 0
push ebx
push esi
push edi
push dword [ebp + 0xc]
mov ebx, eax
call fcn.00838601
pop ecx
push eax
mov dword [ebp - 0x2c], eax
call fcn.008390c6
mov esi, dword [ebx + 0x20]
lea edi, [esi + 0x38]
mov dword [ebp - 0x14], edi
add edi, 0xc0000
pop ecx
lea ecx, [eax + eax + 2]
mov eax, edi
sub eax, esi
add eax, ecx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x30], edi
test al, 0xf
je 0x838c9f
mov eax, esi
mov edx, edi
sub edx, eax
add edx, ecx
and edx, 0xf
sub edi, edx
sub edi, eax
lea eax, [edi + ecx + 0x10]
jmp 0x838ca5
mov eax, edi
sub eax, esi
add eax, ecx
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov eax, esi
lea edi, [eax + ecx]
lea ecx, [edi + 0xb2]
mov dword [ebp - 0xc], ecx
add ecx, 0x18
sub ecx, eax
add ecx, 0x40000
cmp dword [ebx + 0x24], ecx
jb 0x838eaa
push dword [ebp + 0x10]
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
je 0x838eaa
xor eax, eax
push eax
push eax
push 3
push eax
push eax
push 0xc0000000
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 4], eax
cmp eax, 0xffffffff
je 0x838eaa
push dword [ebp - 0x14]
lea eax, [esi + 0x20]
push eax
push dword [ebp - 4]
call fcn.00838b60
add esp, 0xc
test eax, eax
je 0x838e9b
push 0x18
lea eax, [esi + 0x20]
push eax
push dword [ebp - 0xc]
call fcn.00838fd7
mov ecx, dword [ebp - 0x14]
and dword [esi], 0
add esp, 0xc
push 0xc0000
xor eax, eax
mov dword [esi + 4], 1
mov dword [esi + 8], 0xaf77bc0f
mov dword [esi + 0xc], 3
mov dword [esi + 0x10], 0x40000
call fcn.008385d9
pop ecx
push dword [ebp - 0x24]
mov dword [esi + 0x14], eax
push dword [ebp - 0x2c]
mov dword [esi + 0x18], 0xc0038
push dword [ebp - 0x30]
call fcn.00838fd7
mov eax, dword [ebx]
add esp, 0xc
push dword [ebp + 8]
push eax
lea eax, [ebp - 0x158]
push eax
call fcn.0083669b
add esp, 0xc
test eax, eax
jne 0x838e9b
mov eax, dword [ebx + 0x20]
mov esi, dword [ebp - 0x10]
push eax
push eax
lea eax, [ebp - 0x158]
push eax
mov ecx, esi
call fcn.00836432
add esp, 0xc
test eax, eax
je 0x838e9b
push 0x128
lea eax, [ebp - 0x158]
push 0
push eax
call fcn.00838fa9
add esp, 0xc
push 0x14
lea eax, [ebx + 4]
push eax
push edi
call fcn.00838fd7
add esp, 0xc
push 0x10
push dword [ebp + 8]
lea eax, [edi + 0x14]
push eax
call fcn.00838fd7
mov eax, dword [ebx]
add esp, 0xc
add eax, 0x20
push 0x80
push eax
lea eax, [edi + 0x28]
push eax
call fcn.00838fd7
add esp, 0xc
push 6
lea eax, [ebx + 0x18]
push eax
lea eax, [edi + 0xac]
push eax
call fcn.00838fd7
xor eax, eax
add esp, 0xc
mov dword [edi + 0x24], eax
add esi, 0xb2
mov dword [edi + 0xa8], esi
mov esi, dword [ebp - 4]
push 2
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x1c]
push dword [ebp - 0x20]
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x838e9b
push 0
lea eax, [ebp - 0x28]
push eax
push dword [edi + 0xa8]
push dword [ebx + 0x20]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x838e9b
mov eax, dword [ebp - 0x28]
cmp eax, dword [edi + 0xa8]
jne 0x838e9b
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [ebp - 0xc]
mov ebx, dword [ebp - 0xc]
add eax, 0x18
push eax
push esi
call fcn.00838af1
test byte [ebp + 0x14], 2
pop ecx
pop ecx
je 0x838e94
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov dword [ebp - 8], 1
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 8], 0
jne 0x838eb6
push dword [ebp + 0xc]
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_MoveFileW]
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
leave
ret