Function at 0x140112fd8
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 0x18], r8
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x57]
sub rsp, 0x90
mov qword [rbp - 0x31], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov rbx, r9
mov rdi, r8
mov r15, rdx
mov r14, rcx
cmp r8, r9
jb 0x140113021
xor edx, edx
mov rax, r8
div rbx
inc rax
imul rbx, rax
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
xor r12d, r12d
test eax, eax
je 0x140113047
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x140113054
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x140113246
sub ebx, edi
cmp ebx, dword [r14 + 0x68]
jbe 0x14011307c
mov byte [r14 + 0x64], r12b
lea rcx, [r14 + 0x90]
call fcn.1400257a8
lea rcx, [r14 + 0xc0]
call fcn.1400259b0
mov dword [r14 + 0x68], ebx
mov qword [rbp - 9], r12
mov qword [rbp - 1], r12
mov qword [rbp + 7], r12
lea r8, [rbp - 9]
mov edx, dword [rbp + 0x7f]
mov rcx, r14
call fcn.140112a08
mov esi, eax
mov qword [rbp - 0x29], r12
mov r13, r12
mov qword [rbp - 0x21], r12
mov rdi, qword [rbp - 9]
mov rax, qword [rbp - 1]
mov qword [rbp - 0x39], rax
mov qword [rbp - 0x41], rdi
cmp rdi, qword [rbp - 0x39]
je 0x1401131b4
mov rax, qword [rdi]
mov qword [rbp - 0x19], rax
mov rcx, qword [rdi + 8]
mov qword [rbp - 0x11], rcx
test rcx, rcx
je 0x1401130e2
lock inc dword [rcx + 8]
mov r13, qword [rbp - 0x21]
mov rdi, qword [rbp - 0x41]
mov rcx, qword [rbp - 0x11]
mov rax, qword [rbp - 0x19]
mov qword [rbp - 0x29], rax
mov r12, r13
mov r13, rcx
mov qword [rbp - 0x21], rcx
test r12, r12
je 0x140113125
lock dec dword [r12 + 8]
jne 0x14011311d
mov rax, qword [r12]
mov rcx, r12
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
lock dec dword [r12 + 0xc]
jne 0x14011311d
mov rax, qword [r12]
mov rcx, r12
call qword [rax + 0x10]
mov rdi, qword [rbp - 0x41]
mov r13, qword [rbp - 0x21]
mov rax, qword [r14]
mov rcx, r14
call qword [rax + 0x30]
mov r11, qword [r14]
mov rcx, r14
call qword [r11 + 0x10]
xor r12d, r12d
test al, al
jne 0x140113155
mov rcx, qword [r14 + 0xe0]
test rcx, rcx
je 0x14011315a
mov rax, qword [rcx]
call qword [rax + 0x30]
test al, al
jne 0x14011315a
mov esi, 0x4c7
test esi, esi
jne 0x1401131b4
xor r9d, r9d
xor r8d, r8d
mov edx, dword [rbp + 0x6f]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x1401131a3
mov dword [rbp + 0x77], r12d
mov qword [rsp + 0x20], r12
lea r9, [rbp + 0x77]
mov r8d, ebx
mov rdx, qword [rbp - 0x19]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1401131a3
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x1401131ab
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
add rdi, 0x10
jmp 0x1401130b0
xor r9d, r9d
xor r8d, r8d
mov rdx, qword [rbp + 0x6f]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x1401131d8
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x1401131e0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test r13, r13
je 0x140113217
or edi, 0xffffffff
mov eax, edi
lock xadd dword [r13 + 8], eax
add eax, edi
jne 0x140113217
mov rbx, qword [rbp - 0x21]
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov eax, edi
lock xadd dword [rbx + 0xc], eax
add eax, edi
jne 0x140113217
mov rcx, qword [rbp - 0x21]
mov rax, qword [rcx]
call qword [rax + 0x10]
nop
mov rbx, qword [rbp - 9]
test rbx, rbx
je 0x140113246
mov rdi, qword [rbp - 1]
cmp rbx, rdi
je 0x14011323e
mov rcx, rbx
call fcn.140058134
add rbx, 0x10
cmp rbx, rdi
jne 0x140113229
mov rbx, qword [rbp - 9]
mov rcx, rbx
call fcn.1400be0f4
mov eax, esi
mov rbx, qword [rsp + 0xd0]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret