Function at 0x140005458
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x40
mov rsi, rcx
call fcn.1400055cc
mov r12d, 1
mov ecx, r12d
call fcn.140013578
mov r8d, dword [rsi + 0xc]
xor r15d, r15d
mov rbx, qword [rsi + 0x18]
test eax, eax
jne 0x140023420
add r8d, r8d
lea r9, [rsp + 0x78]
mov rdx, rbx
mov ecx, r12d
call fcn.1400136ec
test eax, eax
je 0x14002358d
mov ecx, dword [rsi + 0xc]
mov eax, dword [rsp + 0x78]
add rcx, rcx
cmp rax, rcx
jne 0x14002358d
mov ecx, r12d
call fcn.140013578
mov ecx, r12d
test eax, eax
jne 0x140023529
call qword [sym.imp.msvcrt.dll__get_osfhandle]
nop dword [rax + rax]
cmp byte [0x1400586fc], r15b
mov rbx, rax
jne 0x140023561
mov ecx, dword [0x140041928]
lea rbp, [0x140049c00]
mov qword [rsp + 0x38], r15
lea r8, [0x1400348f0]
mov qword [rsp + 0x30], r15
or r9d, 0xffffffff
mov dword [rsp + 0x28], 0x2000
xor edx, edx
mov qword [rsp + 0x20], rbp
call qword [sym.imp.api_ms_win_core_string_l1_1_0.dll_WideCharToMultiByte]
nop dword [rax + rax]
lea r9, [rsp + 0x78]
mov qword [rsp + 0x20], r15
mov edi, eax
mov rdx, rbp
sub edi, r12d
mov rcx, rbx
mov r8d, edi
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
nop dword [rax + rax]
test eax, eax
je 0x140005571
mov ecx, dword [rsp + 0x78]
mov edx, 4
cmp ecx, edi
cmove ecx, edx
mov dword [rsp + 0x78], ecx
mov rdx, qword [rsi + 0x18]
mov rcx, rsi
call fcn.14000566c
add eax, r12d
mov rcx, rsi
add dword [rsi + 8], eax
call fcn.1400055cc
mov eax, dword [rsi + 0x28]
cmp dword [rsi + 8], eax
ja 0x1400055c0
mov rax, qword [rsi + 0x18]
lea r11, [rsp + 0x40]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x40]
mov word [rax], r15w
xor eax, eax
mov dword [rsi + 0xc], r15d
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret
mov dword [rsi + 8], r15d
jmp 0x140005593
lea rbp, [rbx + r8*2]
cmp rbx, rbp
jae 0x1400054cb
mov r13d, 0x2022
mov rdi, rbx
cmp rbx, rbp
jae 0x1400054cb
cmp word [rdi], r13w
je 0x14002344e
add rdi, 2
cmp rdi, rbp
jb 0x14002343f
cmp rdi, rbx
je 0x1400234ac
mov r14, rdi
mov ecx, r12d
sub r14, rbx
sar r14, 1
call qword [sym.imp.msvcrt.dll__get_osfhandle]
nop dword [rax + rax]
lea r9, [rsp + 0x78]
mov qword [rsp + 0x20], r15
mov rcx, rax
mov r8d, r14d
mov rdx, rbx
call qword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
nop dword [rax + rax]
test eax, eax
je 0x14002358d
cmp dword [rsp + 0x78], r14d
jne 0x14002358d
mov rbx, rdi
jmp 0x1400234ac
cmp word [rdi], r13w
jne 0x1400234b1
add rdi, 2
cmp rdi, rbp
jb 0x1400234a2
cmp rdi, rbx
je 0x14002351b
mov rcx, qword [rsi]
test rcx, rcx
je 0x1400234cf
mov edx, 2
call qword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
nop dword [rax + rax]
mov r14, rdi
mov ecx, r12d
sub r14, rbx
sar r14, 1
call qword [sym.imp.msvcrt.dll__get_osfhandle]
nop dword [rax + rax]
lea r9, [rsp + 0x78]
mov qword [rsp + 0x20], r15
mov rcx, rax
mov r8d, r14d
mov rdx, rbx
call qword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
nop dword [rax + rax]
mov ebx, eax
call fcn.140010580
test ebx, ebx
je 0x14002358d
cmp dword [rsp + 0x78], r14d
jne 0x14002358d
mov rbx, rdi
cmp rbx, rbp
jb 0x140023433
jmp 0x1400054cb
call qword [sym.imp.msvcrt.dll__get_osfhandle]
nop dword [rax + rax]
lea r9, [rsp + 0x78]
mov qword [rsp + 0x20], r15
mov rcx, rax
lea rdx, [0x1400348f0]
mov r8d, 2
call qword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
nop dword [rax + rax]
nop
jmp 0x140005571
lea r9, [rsp + 0x78]
mov qword [rsp + 0x20], r15
mov r8d, 4
lea rdx, [0x1400348f0]
mov rcx, rbx
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
nop dword [rax + rax]
nop
jmp 0x140005571
mov ecx, r12d
call fcn.1400101b8
test eax, eax
je 0x1400235a0
mov ecx, 0x1d
jmp 0x1400235af
mov ecx, r12d
call fcn.14002f318
test eax, eax
jne 0x1400235b6
lea ecx, [rax + 0x70]
xor edx, edx
call fcn.140003278
call fcn.14002e91c
int3