Function at 0x140012e10
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x60
mov qword [rax - 0x38], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov rdi, rdx
mov rbp, rcx
call fcn.140015cb0
mov rcx, rax
test rax, rax
jne 0x140012e4d
mov ecx, 0x80004005
call fcn.1400026e0
int3
mov rax, qword [rax]
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x40], rbx
or r14, 0xffffffffffffffff
xor r12d, r12d
test rdi, rdi
je 0x140012ea1
test rdi, 0xffffffffffff0000
jne 0x140012e92
movzx edi, di
mov ecx, edi
call fcn.14001633c
test rax, rax
je 0x140012eb9
mov r8d, edi
mov rdx, rax
lea rcx, [rsp + 0x40]
call fcn.140002150
jmp 0x140012eb4
mov rax, r14
inc rax
cmp word [rdi + rax*2], r12w
jne 0x140012e95
jmp 0x140012ea4
mov eax, r12d
mov r8d, eax
mov rdx, rdi
lea rcx, [rsp + 0x40]
call fcn.140002550
mov rbx, qword [rsp + 0x40]
mov rcx, qword [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
cmp dword [rbp + 0x48], 0
je 0x140012fe3
mov rcx, qword [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetFileType]
test al, 1
jne 0x140012fb3
mov qword [rsp + 0x38], r12
mov qword [rsp + 0x30], r12
mov dword [rsp + 0x28], r12d
mov qword [rsp + 0x20], r12
mov r9d, r14d
mov r8, rbx
xor edx, edx
mov ecx, 0xfde9
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
movsxd rsi, eax
mov rcx, rsi
call fcn.140015264
mov r15, rax
mov r8, rsi
xor edx, edx
mov rcx, rax
call fcn.14003a130
mov qword [rsp + 0x38], r12
mov qword [rsp + 0x30], r12
mov dword [rsp + 0x28], esi
mov qword [rsp + 0x20], r15
mov r9d, r14d
mov r8, rbx
xor edx, edx
mov ecx, 0xfde9
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea eax, [rsi - 1]
cdqe
mov byte [rax + r15], 0
call qword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
mov edi, eax
mov ecx, 0xfde9
call qword [sym.imp.KERNEL32.dll_SetConsoleOutputCP]
mov r8, r14
nop word [rax + rax]
inc r8
cmp byte [r15 + r8], 0
jne 0x140012f70
mov qword [rsp + 0x20], r12
lea r9, [rsp + 0xa8]
mov rdx, r15
mov rcx, qword [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_SetConsoleOutputCP]
mov rcx, r15
call fcn.14001525c
jmp 0x140013092
mov r8d, dword [rbx - 0x10]
add r8d, r8d
mov qword [rsp + 0x20], r12
lea r9, [rsp + 0xa0]
mov rdx, rbx
mov rcx, qword [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
jmp 0x140013092
call fcn.140015cb0
mov rcx, rax
test rax, rax
jne 0x140012ffb
mov ecx, 0x80004005
call fcn.1400026e0
int3
mov rax, qword [rax]
call qword [rax + 0x18]
lea rdi, [rax + 0x18]
mov qword [rsp + 0x48], rdi
test rbx, rbx
je 0x140013039
test rbx, 0xffffffffffff0000
jne 0x140013039
movzx ebx, bx
mov ecx, ebx
call fcn.14001633c
test rax, rax
je 0x14001304b
mov r8d, ebx
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.14000f5b0
jmp 0x140013046
mov rdx, rbx
lea rcx, [rsp + 0x48]
call fcn.14000f3f0
mov rdi, qword [rsp + 0x48]
mov qword [rsp + 0x20], r12
lea r9, [rsp + 0xa0]
mov r8d, dword [rdi - 0x10]
mov rdx, rdi
mov rcx, qword [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
lea rdx, [rdi - 0x18]
mov eax, r14d
lock xadd dword [rdx + 0x10], eax
sub eax, 1
jg 0x14001308d
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rbx, qword [rsp + 0x40]
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], r14d
sub r14d, 1
jg 0x1400130ab
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
lea r11, [rsp + 0x60]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret