Function at 0x140005678
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.1400057f0
mov r12d, 1
mov ecx, r12d
call fcn.14000de24
mov r8d, dword [rsi + 0xc]
xor r15d, r15d
mov rbx, qword [rsi + 0x18]
test eax, eax
jne 0x140028ace
add r8d, r8d
lea r9, [rsp + 0x78]
mov rdx, rbx
mov ecx, r12d
call fcn.14000def4
test eax, eax
je 0x140028c32
mov edx, dword [rsi + 0xc]
mov eax, dword [rsp + 0x78]
add rdx, rdx
cmp rax, rdx
jne 0x140028c32
mov ecx, r12d
call fcn.14000de24
mov ecx, r12d
test eax, eax
jne 0x140028bce
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__get_osfhandle]
nop dword [rax + rax]
cmp byte [0x14005bc9c], r15b
mov rbx, rax
jne 0x140028c06
mov ecx, dword [0x1400449b8]
lea rbp, [0x140050dd0]
mov qword [rsp + 0x38], r15
lea r8, [0x140037cf8]
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 0x140005791
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.140006524
mov ecx, dword [rsi + 8]
inc ecx
add eax, ecx
mov rcx, rsi
mov dword [rsi + 8], eax
call fcn.1400057f0
mov eax, dword [rsi + 0x28]
cmp dword [rsi + 8], eax
ja 0x1400057e4
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 0x1400057b7
lea rbp, [rbx + r8*2]
cmp rbx, rbp
jae 0x1400056eb
mov r13d, 0x2022
mov rdi, rbx
cmp word [rdi], r13w
je 0x140028af3
add rdi, 2
cmp rdi, rbp
jb 0x140028ae4
cmp rdi, rbx
je 0x140028b51
mov r14, rdi
mov ecx, r12d
sub r14, rbx
sar r14, 1
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__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 0x140028c32
cmp dword [rsp + 0x78], r14d
jne 0x140028c32
mov rbx, rdi
jmp 0x140028b51
cmp word [rdi], r13w
jne 0x140028b56
add rdi, 2
cmp rdi, rbp
jb 0x140028b47
cmp rdi, rbx
je 0x140028bc0
mov rcx, qword [rsi]
test rcx, rcx
je 0x140028b74
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.api_ms_win_crt_private_l1_1_0.dll__o__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.140014740
test ebx, ebx
je 0x140028c32
cmp dword [rsp + 0x78], r14d
jne 0x140028c32
mov rbx, rdi
cmp rbx, rbp
jb 0x140028ae1
jmp 0x1400056eb
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__get_osfhandle]
nop dword [rax + rax]
lea r9, [rsp + 0x78]
mov qword [rsp + 0x20], r15
mov rcx, rax
lea rdx, [0x140037cf8]
mov r8d, 2
call qword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
nop dword [rax + rax]
nop
jmp 0x140005791
lea r9, [rsp + 0x78]
mov qword [rsp + 0x20], r15
mov r8d, 4
lea rdx, [0x140037cf8]
mov rcx, rbx
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
nop dword [rax + rax]
nop
jmp 0x140005791
mov ecx, r12d
call fcn.14001447c
test eax, eax
je 0x140028c45
mov ecx, 0x1d
jmp 0x140028c54
mov ecx, r12d
call fcn.140032d08
test eax, eax
jne 0x140028c5b
lea ecx, [rax + 0x70]
xor edx, edx
call fcn.140002bfc
call fcn.1400322f0
int3