Function at 0x1400058d0
Capabilities:
Read file on windows

Disassembly:
push rbx
push rsi
push rdi
push r13
sub rsp, 0x58
movsxd rdi, r9d
mov rbx, r8
movzx r13d, dl
mov rsi, rcx
test rcx, rcx
je 0x140005ba9
test rbx, rbx
je 0x140005bc2
test r9d, r9d
jle 0x140005bdb
mov qword [rsp + 0x88], rbp
mov ecx, 0xfffffff6
mov qword [rsp + 0x50], r15
mov byte [r8], 0
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov r15d, dword [0x1400c78dc]
mov rbp, rax
test r15d, r15d
jne 0x140005943
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 + 0x90], r12
mov qword [rsp + 0x98], r14
cmp rbp, 0xffffffffffffffff
je 0x140005b61
cmp dword [0x1400cfce0], 1
jne 0x140005987
mov rcx, qword [0x1400cfce8]
lea rdx, [rcx - 1]
cmp rdx, 0xfffffffffffffffd
ja 0x140005987
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x140005b61
mov r8, 0xffffffffffffffff
nop
inc r8
cmp byte [rsi + r8], 0
jne 0x140005990
mov rdx, rsi
mov ecx, r15d
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__write]
cmp eax, 0xffffffff
je 0x140005b61
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 2
sete r14b
xor r12d, r12d
mov dword [rsp + 0x40], r12d
cmp eax, 2
jne 0x1400059fb
lea rdx, [rsp + 0x40]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x140005a77
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 + 0x80], r12d
test r14b, r14b
je 0x140005a82
mov rcx, rdi
add rcx, rcx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rsi, rax
test rax, rax
je 0x140005b80
lea r9, [rsp + 0x80]
mov qword [rsp + 0x20], r12
mov r8d, edi
mov rdx, rax
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_ReadConsoleW]
mov r9d, dword [rsp + 0x80]
mov r8, rsi
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], edi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x140005aa1
xor r14b, r14b
mov dword [rsp + 0x80], r12d
lea r9, [rsp + 0x80]
mov qword [rsp + 0x20], r12
mov r8d, edi
mov rdx, rbx
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov r12d, eax
movsxd rax, dword [rsp + 0x80]
test eax, eax
js 0x140005bf4
cmp eax, edi
jg 0x140005bf4
jge 0x140005ac1
mov byte [rax + rbx], 0
jmp 0x140005ad0
jne 0x140005ad0
mov byte [rax + rbx - 1], 0
nop dword [rax + rax]
mov rax, 0xffffffffffffffff
inc rax
cmp byte [rbx + rax], 0
jne 0x140005ad7
test eax, eax
jle 0x140005b05
movsxd rdi, eax
lea rcx, [0x140095d94]
movsx edx, byte [rdi + rbx - 1]
call qword [sym.imp.VCRUNTIME140.dll_strchr]
test rax, rax
je 0x140005b05
mov byte [rdi + rbx - 1], 0
jmp 0x140005ad0
test r13b, r13b
jne 0x140005b20
mov r8d, 2
lea rdx, [0x140095d94]
mov ecx, r15d
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__write]
test r14b, r14b
je 0x140005b32
mov edx, dword [rsp + 0x40]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_SetConsoleMode]
test r12d, r12d
je 0x140005b80
cmp dword [0x1400cfce0], 1
jne 0x140005b5d
mov rcx, qword [0x1400cfce8]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140005b5d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x140005b80
mov al, 1
jmp 0x140005b82
mov ecx, 0x140
call fcn.14000e3d0
test al, al
je 0x140005b80
lea rdx, str.get_console_input_win32__:_unexpected_error
mov ecx, 0x140
call fcn.14000e000
xor al, al
mov r14, qword [rsp + 0x98]
mov r12, qword [rsp + 0x90]
mov rbp, qword [rsp + 0x88]
mov r15, qword [rsp + 0x50]
add rsp, 0x58
pop r13
pop rdi
pop rsi
pop rbx
ret
lea r8, str.prompt
mov edx, 0x3d
lea rcx, str.C:Users_vagrant_buildopenvpn_srcopenvpnconsole_builtin.c
call fcn.14000e4c0
int3
lea r8, str.input
mov edx, 0x3e
lea rcx, str.C:Users_vagrant_buildopenvpn_srcopenvpnconsole_builtin.c
call fcn.14000e4c0
int3
lea r8, str.capacity___0
mov edx, 0x3f
lea rcx, str.C:Users_vagrant_buildopenvpn_srcopenvpnconsole_builtin.c
call fcn.14000e4c0
int3
lea r8, str.len___0__len___capacity__capacity___0
mov edx, 0x27e
lea rcx, str.C:Users_vagrant_buildopenvpn_srcopenvpn_buffer.c
call fcn.14000e4c0
int3