Function at 0x140024680
Capabilities:
Write file on windows

Disassembly:
push r15
push r14
push rsi
push rdi
push rbx
sub rsp, 0x90
mov r15, rcx
test r9, r9
je 0x1400246c5
mov rsi, r9
mov rbx, r8
mov ecx, edx
call qword [sym.imp.kernel32.dll_GetStdHandle]
test rax, rax
je 0x1400246d1
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x1400246e0
call qword [sym.imp.kernel32.dll_GetLastError]
shl rax, 0x20
or rax, 2
jmp 0x140024853
xorps xmm0, xmm0
movups xmmword [r15], xmm0
jmp 0x14002485e
movabs rax, 0x600000002
jmp 0x140024853
mov dword [rsp + 0x38], 0
lea rdx, [rsp + 0x38]
mov rcx, rdi
call qword [sym.imp.kernel32.dll_GetConsoleMode]
test eax, eax
je 0x140024762
mov r14, qword [rsp + 0xe0]
movzx eax, byte [r14 + 4]
test rax, rax
je 0x1400247a2
cmp al, 4
jae 0x140024923
mov cl, byte [rbx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x140024803
mov byte [r14 + rax], cl
mov al, byte [r14 + 4]
add al, 1
mov byte [r14 + 4], al
movzx ecx, byte [r14]
lea rdx, [0x14004f6b8]
movzx esi, byte [rcx + rdx]
mov qword [rsp + 0x80], rsi
cmp sil, al
jbe 0x140024826
movaps xmm0, xmmword [0x140044640]
jmp 0x1400246c8
mov dword [rsp + 0x38], 0
mov eax, 0xffffffff
cmp rsi, rax
mov r8d, 0xffffffff
cmovb r8d, esi
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x38]
mov rcx, rdi
mov rdx, rbx
call qword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x14002480a
mov eax, dword [rsp + 0x38]
xor ecx, ecx
jmp 0x14002481d
cmp rsi, 0x1000
mov r8d, 0x1000
cmovb r8, rsi
lea rcx, [rsp + 0x68]
mov rdx, rbx
call fcn.1400093c0
cmp qword [rsp + 0x68], 0
je 0x14002486d
mov r8, qword [rsp + 0x70]
test r8, r8
je 0x140024884
cmp r8, rsi
ja 0x140024978
lea rsi, [rsp + 0x38]
mov rcx, rsi
mov rdx, rbx
call fcn.1400093c0
mov rcx, rsi
call fcn.140025270
mov r8, rax
mov r9, rdx
jmp 0x140024877
mov byte [r14 + 4], 0
jmp 0x14002484c
call qword [sym.imp.kernel32.dll_GetLastError]
shl rax, 0x20
or rax, 2
mov ecx, 1
mov qword [r15], rcx
mov qword [r15 + 8], rax
jmp 0x14002485e
movzx r8d, al
cmp al, 5
jae 0x140024969
lea rcx, [rsp + 0x68]
mov rdx, r14
call fcn.1400093c0
mov byte [r14 + 4], 0
cmp qword [rsp + 0x68], 0
je 0x1400248a7
lea rax, str.Windows_stdio_in_console_mode_does_not_support_writing_non_UTF_8_byte_sequences
mov qword [r15 + 8], rax
mov qword [r15], 1
add rsp, 0x90
pop rbx
pop rdi
pop rsi
pop r14
pop r15
ret
mov r8, qword [rsp + 0x70]
mov r9, qword [rsp + 0x78]
mov rcx, r15
mov rdx, rdi
call fcn.140024f90
jmp 0x14002485e
movzx eax, byte [rbx]
lea rcx, [0x14004f6b8]
movzx ecx, byte [rax + rcx]
cmp rcx, 2
jb 0x1400248de
cmp rcx, rsi
jbe 0x1400248de
mov byte [r14], al
mov byte [r14 + 4], 1
jmp 0x140024911
mov r8, qword [rsp + 0x70]
mov rax, qword [rsp + 0x78]
mov qword [rsp + 0x30], rax
cmp rax, rsi
jne 0x140024985
lea rcx, [rsp + 0x38]
mov rdx, rdi
mov r9, rsi
call fcn.140024f90
cmp qword [rsp + 0x38], 0
je 0x1400248f6
mov rax, qword [rsp + 0x40]
jmp 0x1400248e5
lea rax, str.Windows_stdio_in_console_mode_does_not_support_writing_non_UTF_8_byte_sequences
mov qword [r15 + 8], rax
mov eax, 1
mov qword [r15], rax
jmp 0x14002485e
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x88], rax
mov qword [rsp + 0x30], rsi
cmp rax, rsi
jne 0x14002499f
mov qword [r15 + 8], 1
xor eax, eax
mov qword [r15], rax
jmp 0x14002485e
lea rax, [0x140051910]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x40], 1
mov qword [rsp + 0x48], 0
lea rax, [0x14004f6b8]
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x60], 0
lea rdx, str.library_std_src_syswindows_stdio.rsUnexpected_number_of_bytes_for_incomplete_UTF_8_codepoint.
lea rcx, [rsp + 0x38]
call fcn.1400422e0
ud2
mov edx, 4
mov rcx, r8
call fcn.140042330
ud2
mov rcx, r8
mov rdx, rsi
call fcn.140042330
ud2
mov qword [rsp + 0x38], 0
lea r9, str.library_std_src_syswindows_stdio.rsUnexpected_number_of_bytes_for_incomplete_UTF_8_codepoint.
lea rcx, [rsp + 0x80]
jmp 0x1400249b7
mov qword [rsp + 0x38], 0
lea r9, str.library_std_src_syswindows_stdio.rsUnexpected_number_of_bytes_for_incomplete_UTF_8_codepoint.
lea rcx, [rsp + 0x88]
lea rdx, [rsp + 0x30]
lea r8, [rsp + 0x38]
call fcn.140043690
ud2