Function at 0x140166140
Capabilities:
Query environment variable

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x498
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x410], 0xfffffffffffffffe
mov qword [rbp + 0x3c8], rcx
mov qword [rbp + 0x3b8], rdx
mov qword [rbp + 0x3c0], r8
lea rsi, [rbp - 0x60]
mov rcx, rsi
call fcn.140173690
cmp dword [rbp - 0x60], 1
mov r14, qword [rbp - 0x50]
mov rbx, qword [rbp - 0x58]
je 0x1401663c2
mov rax, qword [rbp - 0x48]
mov qword [rbp + 0x3a0], rbx
mov qword [rbp + 0x3f0], r14
mov qword [rbp + 0x3a8], r14
mov qword [rbp + 0x3b0], rax
xor r14d, r14d
mov r8d, 0x400
mov rcx, rsi
xor edx, edx
call sub.VCRUNTIME140.dll_memset
mov rdi, qword [0x1402e8458]
mov qword [rbp + 0x3f8], rdi
xorps xmm0, xmm0
movups xmmword [rbp + 0x400], xmm0
mov r12d, 0x200
cmp r12, 0x201
jae 0x140166215
jmp 0x140166260
cmp r12, rsi
mov r12, rsi
ja 0x1401662c0
cmp r12, 0x201
jb 0x140166260
mov r8, r12
sub r8, r14
mov rax, qword [rbp + 0x400]
sub rax, r14
cmp rax, r8
jae 0x140166240
lea rcx, [rbp + 0x3f8]
mov rdx, r14
call fcn.14019da50
mov rdi, qword [rbp + 0x3f8]
mov qword [rbp + 0x408], r12
mov r14, r12
mov r13, rdi
mov r15, r12
mov rsi, rdi
jmp 0x14016626d
lea rsi, [rbp - 0x60]
mov r13, rsi
mov r15d, 0x200
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rbx
mov rdx, rsi
mov r8d, r12d
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov esi, eax
test eax, eax
jne 0x140166294
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x140166301
mov esi, esi
cmp r12, rsi
jne 0x140166200
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x140166200
add r12, r12
cmp r12, 0x201
jae 0x140166215
jmp 0x140166260
cmp r15, rsi
jb 0x14016644b
lea rcx, [rbp + 0x3d0]
mov rdx, r13
mov r8, rsi
call fcn.14016aef0
mov rsi, qword [rbp + 0x3d0]
mov r14, qword [rbp + 0x3d8]
mov r15, qword [rbp + 0x3e0]
xor r12d, r12d
mov rdx, qword [rbp + 0x400]
test rdx, rdx
jne 0x14016631f
jmp 0x140166337
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
shl rsi, 0x20
mov r12b, 1
xor r14d, r14d
mov rdx, qword [rbp + 0x400]
test rdx, rdx
je 0x140166337
test rdi, rdi
je 0x140166337
add rdx, rdx
je 0x140166337
mov r8d, 2
mov rcx, rdi
call fcn.1400012f0
test r12b, r12b
je 0x140166371
test sil, sil
sete al
mov rcx, rsi
shr rcx, 0x20
cmp ecx, 0xcb
sete cl
and cl, al
mov eax, ecx
xor al, 1
movzx edi, al
xor eax, eax
test cl, cl
cmovne rsi, rax
mov rdx, qword [rbp + 0x3f0]
test rdx, rdx
jne 0x14016637f
jmp 0x140166397
xor edi, edi
mov rdx, qword [rbp + 0x3f0]
test rdx, rdx
je 0x140166397
test rbx, rbx
je 0x140166397
add rdx, rdx
je 0x140166397
mov r8d, 2
mov rcx, rbx
call fcn.1400012f0
test rdi, rdi
jne 0x1401663c5
mov rax, qword [rbp + 0x3c8]
mov qword [rax + 8], r14
mov qword [rax], rsi
mov qword [rax + 0x10], r15
add rsp, 0x498
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov rsi, rbx
mov qword [rbp + 0x400], r14
mov qword [rbp + 0x3f8], rsi
lea rax, [rbp + 0x3b8]
mov qword [rbp + 0x3d0], rax
lea rax, [0x14016c990]
mov qword [rbp + 0x3d8], rax
lea rax, [rbp + 0x3f8]
mov qword [rbp + 0x3e0], rax
lea rax, [fcn.140167c80]
mov qword [rbp + 0x3e8], rax
lea rax, [0x1402e8818]
mov qword [rbp - 0x60], rax
mov qword [rbp - 0x58], 2
mov qword [rbp - 0x50], 0
lea rax, [rbp + 0x3d0]
mov qword [rbp - 0x40], rax
mov qword [rbp - 0x38], 2
lea rdx, [0x1402e8838]
lea rcx, [rbp - 0x60]
call fcn.14019e180
jmp 0x14016645d
lea r8, str.library_std_src_syswindowsmod.rsstrings_passed_to_WinAPI_cannot_contain_NULs
mov rcx, rsi
mov rdx, r15
call fcn.14019e630
ud2