Function at 0x140005ae0
Capabilities:
Read file on windows

Disassembly:
push rbx
push rsi
push rdi
push r13
sub rsp, 0x78
mov rax, qword [0x1400cb008]
xor rax, rsp
mov qword [rsp + 0x50], rax
movsxd rsi, r9d
mov rbx, r8
mov byte [rsp + 0x40], dl
movzx r13d, dl
mov rdi, rcx
test rcx, rcx
je 0x140005de1
test rbx, rbx
je 0x140005dfa
test r9d, r9d
jle 0x140005e13
mov qword [rsp + 0xa8], rbp
mov ecx, 0xfffffff6
mov qword [rsp + 0x60], r15
mov byte [r8], 0
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov r15d, dword [0x1400cb91c]
mov rbp, rax
test r15d, r15d
jne 0x140005b66
lea ecx, [r15 + 2]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov r15d, eax
mov qword [rsp + 0x70], r12
mov qword [rsp + 0x68], r14
cmp rbp, 0xffffffffffffffff
je 0x140005d92
cmp dword [0x1400d3d20], 1
jne 0x140005ba4
mov rcx, qword [0x1400d3d28]
lea rdx, [rcx - 1]
cmp rdx, 0xfffffffffffffffd
ja 0x140005ba4
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x140005d92
mov r8, 0xffffffffffffffff
nop dword [rax + rax]
inc r8
cmp byte [rdi + r8], 0
jne 0x140005bb0
mov rdx, rdi
mov ecx, r15d
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__write]
cmp eax, 0xffffffff
je 0x140005d92
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 2
sete r14b
xor r12d, r12d
mov dword [rsp + 0x48], r12d
cmp eax, 2
jne 0x140005c1b
lea rdx, [rsp + 0x48]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x140005ca8
test r13b, r13b
mov edx, 7
mov eax, 3
mov rcx, rbp
cmove edx, eax
call qword [sym.imp.KERNEL32.dll_SetConsoleMode]
mov dword [rsp + 0x44], r12d
test r14b, r14b
je 0x140005cb0
lfence
mov rcx, 0xffffffffffffffff
mov eax, 2
mul rsi
cmovo rax, rcx
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rdi, rax
test rax, rax
je 0x140005db1
lfence
lea r9, [rsp + 0x44]
mov qword [rsp + 0x20], r12
mov r8d, esi
mov rdx, rax
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_ReadConsoleW]
mov r9d, dword [rsp + 0x44]
mov r8, rdi
mov r12d, eax
xor edx, edx
xor eax, eax
mov ecx, 0xfde9
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], esi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x140005ccf
xor r14b, r14b
mov dword [rsp + 0x44], r12d
lfence
lea r9, [rsp + 0x44]
mov qword [rsp + 0x20], r12
mov r8d, esi
mov rdx, rbx
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov r12d, eax
movsxd rax, dword [rsp + 0x44]
test eax, eax
js 0x140005e2c
cmp eax, esi
jg 0x140005e2c
jge 0x140005cec
mov byte [rax + rbx], 0
jmp 0x140005cf3
jne 0x140005cf3
mov byte [rax + rbx - 1], 0
mov r13, 0xffffffffffffffff
nop word [rax + rax]
mov rax, r13
inc rax
cmp byte [rbx + rax], 0
jne 0x140005d03
test eax, eax
jle 0x140005d34
lfence
movsxd rdi, eax
lea rcx, [0x14009835c]
movsx edx, byte [rdi + rbx - 1]
call qword [sym.imp.VCRUNTIME140.dll_strchr]
test rax, rax
je 0x140005d34
mov byte [rdi + rbx - 1], 0
jmp 0x140005d00
cmp byte [rsp + 0x40], 0
jne 0x140005d51
mov r8d, 2
lea rdx, [0x14009835c]
mov ecx, r15d
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__write]
test r14b, r14b
je 0x140005d63
mov edx, dword [rsp + 0x48]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_SetConsoleMode]
test r12d, r12d
je 0x140005db1
cmp dword [0x1400d3d20], 1
jne 0x140005d8e
mov rcx, qword [0x1400d3d28]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140005d8e
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x140005db1
mov al, 1
jmp 0x140005db3
mov ecx, 0x140
call fcn.14000ec70
test al, al
je 0x140005db1
lea rdx, str.get_console_input_win32__:_unexpected_error
mov ecx, 0x140
call fcn.14000e820
xor al, al
mov r14, qword [rsp + 0x68]
mov r12, qword [rsp + 0x70]
mov rbp, qword [rsp + 0xa8]
mov r15, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x50]
xor rcx, rsp
call fcn.14008aca0
add rsp, 0x78
pop r13
pop rdi
pop rsi
pop rbx
ret
lea r8, str.prompt
mov edx, 0x3d
lea rcx, str.C:Users_vagrant_buildbotwindows_server_2019_static_msbuildopenvpn_srcopenvpnconsole_builtin.c
call fcn.14000ed60
int3
lea r8, str.input
mov edx, 0x3e
lea rcx, str.C:Users_vagrant_buildbotwindows_server_2019_static_msbuildopenvpn_srcopenvpnconsole_builtin.c
call fcn.14000ed60
int3
lea r8, str.capacity___0
mov edx, 0x3f
lea rcx, str.C:Users_vagrant_buildbotwindows_server_2019_static_msbuildopenvpn_srcopenvpnconsole_builtin.c
call fcn.14000ed60
int3
lea r8, str.len___0__len___capacity__capacity___0
mov edx, 0x267
lea rcx, str.C:Users_vagrant_buildbotwindows_server_2019_static_msbuildopenvpn_srcopenvpn_buffer.c
call fcn.14000ed60
int3