Function at 0x140016310
Capabilities:
Query environment variable

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x478
mov r14, rcx
movabs r15, 0x8000000000000000
lea rcx, [rsp + 0x78]
call fcn.140016690
mov rcx, qword [rsp + 0x78]
mov rax, rcx
neg rax
jno 0x1400163af
mov rdi, qword [rsp + 0x80]
mov eax, edi
and eax, 3
cmp eax, 1
jne 0x1400163a7
mov rbx, qword [rdi - 1]
mov rsi, qword [rdi + 7]
mov rax, qword [rsi]
test rax, rax
je 0x14001636e
mov rcx, rbx
call rax
dec rdi
cmp qword [rsi + 8], 0
je 0x140016395
cmp qword [rsi + 0x10], 0x11
jb 0x140016383
mov rbx, qword [rbx - 8]
mov rcx, qword [0x14002d0f0]
xor edx, edx
mov r8, rbx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [0x14002d0f0]
xor edx, edx
mov r8, rdi
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [r14], r15
jmp 0x14001661f
mov qword [rsp + 0x48], rcx
mov qword [rsp + 0x50], r14
mov rdi, qword [rsp + 0x80]
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x38], 2
mov qword [rsp + 0x40], 0
mov r8d, 0x200
mov esi, 2
xor r14d, r14d
xor r15d, r15d
cmp r8, 0x201
jae 0x140016420
jmp 0x14001640f
jae 0x1400164ed
cmp r8, 0x201
jae 0x140016420
mov ebx, 0x200
lea r12, [rsp + 0x78]
mov r13, r8
jmp 0x140016452
sub r8, r15
mov rax, r14
sub rax, r15
cmp r8, rax
ja 0x1400164c2
mov eax, 0xffffffff
cmp r14, rax
mov r15d, 0xffffffff
cmovb r15, r14
mov qword [rsp + 0x40], r15
mov rbx, r15
mov r12, rsi
mov r13, r15
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rdi
mov rdx, r12
mov r8d, r13d
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov ebp, eax
test eax, eax
jne 0x14001647d
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1400165a4
mov r8d, ebp
cmp r13, r8
jne 0x140016400
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x140016634
lea r8, [r13*2]
cmp r13, 0x7fffffff
mov eax, 0xffffffff
cmova r8, rax
cmp r8, 0x201
jb 0x14001640f
jmp 0x140016420
mov qword [rsp + 0x20], 2
mov r9d, 2
lea rcx, [rsp + 0x30]
mov rdx, r15
call fcn.140020ba0
mov r14, qword [rsp + 0x30]
mov rsi, qword [rsp + 0x38]
jmp 0x140016432
cmp rbx, r8
jb 0x140016634
lea rcx, [rsp + 0x58]
mov rdx, r12
call fcn.1400169e0
cmp qword [rsp + 0x30], 0
mov rsi, qword [rsp + 0x50]
movabs rbx, 0x8000000000000000
je 0x14001652e
mov r8, qword [rsp + 0x38]
mov rcx, qword [0x14002d0f0]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r15, qword [rsp + 0x48]
cmp qword [rsp + 0x58], rbx
jne 0x1400165f7
mov qword [rsi], rbx
mov rsi, qword [rsp + 0x60]
mov eax, esi
and eax, 3
cmp eax, 1
jne 0x140016608
mov rbx, qword [rsi - 1]
mov r14, qword [rsi + 7]
mov rax, qword [r14]
test rax, rax
je 0x140016569
mov rcx, rbx
call rax
dec rsi
cmp qword [r14 + 8], 0
je 0x140016590
cmp qword [r14 + 0x10], 0x11
jb 0x14001657e
mov rbx, qword [rbx - 8]
mov rcx, qword [0x14002d0f0]
xor edx, edx
mov r8, rbx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [0x14002d0f0]
xor edx, edx
mov r8, rsi
call qword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x140016608
call qword [sym.imp.KERNEL32.dll_GetLastError]
shl rax, 0x20
or rax, 2
mov qword [rsp + 0x60], rax
movabs rbx, 0x8000000000000000
mov qword [rsp + 0x58], rbx
cmp qword [rsp + 0x30], 0
je 0x1400165e2
mov r8, qword [rsp + 0x38]
mov rcx, qword [0x14002d0f0]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rsi, qword [rsp + 0x50]
mov r15, qword [rsp + 0x48]
cmp qword [rsp + 0x58], rbx
je 0x14001653e
movups xmm0, xmmword [rsp + 0x58]
movups xmm1, xmmword [rsp + 0x68]
movups xmmword [rsi + 0x10], xmm1
movups xmmword [rsi], xmm0
test r15, r15
je 0x14001661f
mov rcx, qword [0x14002d0f0]
xor edx, edx
mov r8, rdi
call qword [sym.imp.KERNEL32.dll_HeapFree]
nop
add rsp, 0x478
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
ud2