Function at 0x140161870
Capabilities:
Query environment variable

Disassembly:
push rbp
push r12
push r13
push r14
push r15
mov eax, 0x50
call fcn.140234360
sub rsp, rax
lea rbp, [rsp + 0x40]
mov qword [rbp + 0x40], rbx
mov qword [rbp + 0x48], rsi
mov qword [rbp + 0x50], rdi
mov rax, qword [0x1402fd960]
xor rax, rbp
mov qword [rbp], rax
mov r15, rcx
xor r8d, r8d
lea rcx, str.OPENSSL_WIN32_UTF8
xor edx, edx
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x140161b46
xor edi, edi
mov r14d, edi
mov ebx, edi
lea r12d, [rdi + 8]
call qword [sym.imp.KERNEL32.dll_GetACP]
mov esi, eax
add eax, 0xffff3bd4
cmp eax, 9
ja 0x1401618ea
mov ecx, 0x2a7
bt ecx, eax
jb 0x140161902
lea ecx, [rsi - 0xdeaa]
cmp ecx, 9
jbe 0x140161902
cmp esi, 0xfde8
je 0x140161902
cmp esi, 0x2a
jne 0x140161905
mov r12d, edi
mov dword [rsp + 0x28], edi
mov r9d, 0xffffffff
mov r8, r15
mov qword [rsp + 0x20], rdi
mov edx, r12d
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
movsxd r13, eax
test eax, eax
jle 0x140161b41
mov rdx, r13
mov r8, rdi
add rdx, rdx
lea rcx, [rdx + 0x10]
cmp rcx, rdx
cmova r8, rcx
test r8, r8
je 0x140161b41
movabs rcx, 0xffffffffffffff0
cmp r8, 0x400
ja 0x14016198b
lea rax, [r8 + 0xf]
cmp rax, r8
ja 0x140161969
mov rax, rcx
and rax, 0xfffffffffffffff0
call fcn.140234360
sub rsp, rax
lea rdi, [rsp + 0x40]
test rdi, rdi
je 0x140161b41
mov dword [rdi], 0xcccc
jmp 0x1401619a2
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rdi, rax
test rax, rax
je 0x1401619a6
mov dword [rax], 0xdddd
add rdi, 0x10
test rdi, rdi
je 0x140161b41
mov dword [rsp + 0x28], r13d
mov r9d, 0xffffffff
mov r8, r15
mov qword [rsp + 0x20], rdi
mov edx, r12d
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jle 0x140161b16
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov esi, eax
test eax, eax
je 0x140161b16
xor r15d, r15d
mov edx, esi
add rdx, rdx
mov r8d, r15d
lea rcx, [rdx + 0x10]
cmp rcx, rdx
cmova r8, rcx
test r8, r8
je 0x140161b16
cmp r8, 0x400
ja 0x140161a4a
lea rax, [r8 + 0xf]
cmp rax, r8
ja 0x140161a28
movabs rax, 0xffffffffffffff0
and rax, 0xfffffffffffffff0
call fcn.140234360
sub rsp, rax
lea rbx, [rsp + 0x40]
test rbx, rbx
je 0x140161b16
mov dword [rbx], 0xcccc
jmp 0x140161a61
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rbx, rax
test rax, rax
je 0x140161a65
mov dword [rax], 0xdddd
add rbx, 0x10
test rbx, rbx
je 0x140161b16
mov r8d, esi
mov rdx, rbx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
cmp eax, esi
jae 0x140161b16
mov qword [rsp + 0x38], r15
mov r9d, 0xffffffff
mov qword [rsp + 0x30], r15
mov r8, rbx
mov dword [rsp + 0x28], r15d
xor edx, edx
mov ecx, 0xfde9
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
movsxd rsi, eax
test eax, eax
jle 0x140161b16
mov rcx, rsi
lea rdx, str.cryptogetenv.c
mov r8d, 0x46
call fcn.1400dc8b0
mov r14, rax
test rax, rax
je 0x140161b16
mov qword [rsp + 0x38], r15
mov r9d, 0xffffffff
mov qword [rsp + 0x30], r15
mov r8, rbx
mov dword [rsp + 0x28], esi
xor edx, edx
mov ecx, 0xfde9
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x140161b16
lea r8d, [rax + 0x4c]
mov rcx, r14
lea rdx, str.cryptogetenv.c
call fcn.1400dc900
mov r14, r15
cmp dword [rdi - 0x10], 0xdddd
lea rcx, [rdi - 0x10]
jne 0x140161b29
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test rbx, rbx
je 0x140161b41
cmp dword [rbx - 0x10], 0xdddd
lea rcx, [rbx - 0x10]
jne 0x140161b41
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rax, r14
jmp 0x140161b5c
call fcn.14007f460
test eax, eax
je 0x140161b53
xor eax, eax
jmp 0x140161b5c
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
mov rcx, qword [rbp]
xor rcx, rbp
call fcn.140233900
mov rbx, qword [rbp + 0x40]
mov rsi, qword [rbp + 0x48]
mov rdi, qword [rbp + 0x50]
lea rsp, [rbp + 0x10]
pop r15
pop r14
pop r13
pop r12
pop rbp
ret