Function at 0x1401f59c0
Capabilities:
Query environment variable

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x658
lea rbx, [0x1401f57f0]
mov dword [0x14032f444], 0
mov dword [0x14032f440], 0
mov rdi, rcx
mov rbp, rdx
mov ecx, 0x16
mov rdx, rbx
mov esi, r8d
mov r12d, r9d
call sub.msvcrt.dll_signal
mov rdx, rbx
mov ecx, 8
mov qword [0x14032f530], rax
call sub.msvcrt.dll_signal
mov rdx, rbx
mov ecx, 4
mov qword [0x14032f4c0], rax
call sub.msvcrt.dll_signal
mov rdx, rbx
mov ecx, 2
mov qword [0x14032f4a0], rax
call sub.msvcrt.dll_signal
mov rdx, rbx
mov ecx, 0xb
mov qword [0x14032f490], rax
call sub.msvcrt.dll_signal
mov rdx, rbx
mov ecx, 0xf
mov qword [0x14032f4d8], rax
call sub.msvcrt.dll_signal
mov dword [0x14032f440], 1
mov qword [0x14032f4f8], rax
test esi, esi
je 0x1401f5c20
mov eax, dword [0x14032f448]
mov byte [rsp + 0x50], 0
mov dword [0x14032f440], 2
test eax, eax
je 0x1401f5c3f
lea rcx, str.OPENSSL_WIN32_UTF8
xor r8d, r8d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov ecx, 0xfffffff6
test eax, eax
je 0x1401f5b70
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
lea r9, [rsp + 0x4c]
lea rbx, [rsp + 0x250]
mov qword [rsp + 0x20], 0
mov rcx, rax
mov r8d, 0x1ff
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
je 0x1401f5cc8
mov eax, dword [rsp + 0x4c]
cmp eax, 1
jbe 0x1401f5b0d
lea edx, [rax - 2]
cmp word [rsp + rdx*2 + 0x250], 0xd
je 0x1401f5e20
xor edx, edx
lea r13, [rsp + 0x50]
mov ecx, 0xfde9
mov r8, rbx
mov word [rsp + rax*2 + 0x250], dx
mov r9d, 0xffffffff
xor edx, edx
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x200
mov qword [rsp + 0x20], r13
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edx, 0x400
mov rcx, rbx
test eax, eax
jle 0x1401f5dc8
call fcn.1401426f0
jmp 0x1401f5c61
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
lea r13, [rsp + 0x50]
lea r9, [rsp + 0x4c]
mov qword [rsp + 0x20], 0
mov rcx, rax
mov r8d, 0x1ff
mov rdx, r13
call qword [sym.imp.KERNEL32.dll_ReadConsoleA]
test eax, eax
je 0x1401f5bd0
mov eax, dword [rsp + 0x4c]
cmp eax, 1
jbe 0x1401f5bb6
lea edx, [rax - 2]
cmp byte [rsp + rdx + 0x50], 0xd
je 0x1401f5e58
mov rcx, qword [0x14032f458]
mov byte [rsp + rax + 0x50], 0
call sub.msvcrt.dll_feof
test eax, eax
je 0x1401f5c75
nop
xor ebx, ebx
mov eax, dword [0x14032f444]
cmp eax, 2
mov eax, 0xffffffff
cmove ebx, eax
test esi, esi
je 0x1401f5d48
mov eax, dword [0x14032f440]
test eax, eax
jg 0x1401f5cd8
mov edx, 0x200
mov rcx, r13
call fcn.1401426f0
mov eax, ebx
add rsp, 0x658
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov r9d, dword [0x14032f448]
test r9d, r9d
jne 0x1401f5da0
mov dword [0x14032f440], 2
mov byte [rsp + 0x50], 0
lea r13, [rsp + 0x50]
mov r8, qword [0x14032f458]
mov edx, 0x1ff
mov rcx, r13
call sub.msvcrt.dll_fgets
test rax, rax
je 0x1401f5bd0
mov rcx, qword [0x14032f458]
call sub.msvcrt.dll_feof
test eax, eax
jne 0x1401f5bd0
mov rcx, qword [0x14032f458]
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x1401f5bd0
mov edx, 0xa
mov rcx, r13
call sub.msvcrt.dll_strchr
test rax, rax
je 0x1401f5dd8
test r12d, r12d
je 0x1401f5ca7
mov byte [rax], 0
mov r8, r13
mov rdx, rbp
mov rcx, rdi
call fcn.1401f57b0
not eax
mov ebx, eax
shr ebx, 0x1f
jmp 0x1401f5bd2
lea r13, [rsp + 0x50]
jmp 0x1401f5bd0
mov rdx, qword [0x14032f530]
mov ecx, 0x16
call sub.msvcrt.dll_signal
mov rdx, qword [0x14032f4c0]
mov ecx, 8
call sub.msvcrt.dll_signal
mov rdx, qword [0x14032f4a0]
mov ecx, 4
call sub.msvcrt.dll_signal
mov rdx, qword [0x14032f490]
mov ecx, 2
call sub.msvcrt.dll_signal
mov rdx, qword [0x14032f4d8]
mov ecx, 0xb
call sub.msvcrt.dll_signal
mov rdx, qword [0x14032f4f8]
mov ecx, 0xf
call sub.msvcrt.dll_signal
jmp 0x1401f5bf9
mov rcx, qword [0x14032f450]
lea rdx, [0x1402d8e9e]
call fcn.1401f5860
mov eax, dword [0x14032f440]
cmp eax, 1
jle 0x1401f5bf1
mov eax, dword [0x14032f448]
test eax, eax
je 0x1401f5cd8
mov esi, dword [0x14032f460]
mov ecx, 0xfffffff6
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov rcx, rax
mov edx, esi
call qword [sym.imp.KERNEL32.dll_SetConsoleMode]
jmp 0x1401f5beb
mov ebx, dword [0x14032f460]
mov ecx, 0xfffffff6
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
and ebx, 0xfffffffb
mov rcx, rax
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetConsoleMode]
jmp 0x1401f5a80
call fcn.1401426f0
jmp 0x1401f5bd0
mov r12, qword [0x14032f458]
lea rbx, [rsp + 0x250]
jmp 0x1401f5e06
mov edx, 0xa
mov rcx, rbx
call sub.msvcrt.dll_strchr
test rax, rax
jne 0x1401f5ca7
mov r8, r12
mov edx, 4
mov rcx, rbx
call sub.msvcrt.dll_fgets
test rax, rax
jne 0x1401f5df0
jmp 0x1401f5bd0
lea r8d, [rax - 1]
cmp word [rsp + r8*2 + 0x250], 0xa
mov rcx, r8
jne 0x1401f5b0d
mov r8d, 0xa
mov dword [rsp + 0x4c], ecx
mov eax, ecx
mov word [rsp + rdx*2 + 0x250], r8w
jmp 0x1401f5b0d
lea r8d, [rax - 1]
cmp byte [rsp + r8 + 0x50], 0xa
jne 0x1401f5bb6
mov byte [rsp + rdx + 0x50], 0xa
mov eax, r8d
jmp 0x1401f5bb6