Function at 0x140070050
Capabilities:
Query environment variable

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x58
lea rbp, [rsp + 0x50]
mov r15, qword [rcx]
sub rsp, 0x60
mov qword [rbp + 0x58], rdx
mov rbx, rcx
lea rax, [rsp + 0x30]
mov qword [rbp - 8], rax
test r15, r15
je 0x140070423
mov r13, qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov rdi, rcx
mov r14d, 1
xor esi, esi
nop word [rax + rax]
mov edx, 0x3d
mov rcx, r15
call sub.msvcrt.dll_strchr
test rax, rax
je 0x1400700e7
xor edx, edx
mov r9d, 0xffffffff
mov r8, r15
mov ecx, 0xfde9
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
call r13
test eax, eax
jle 0x140070400
cdqe
add r14, 1
add rsi, rax
mov r15, qword [rdi + 8]
add rdi, 8
test r15, r15
jne 0x1400700a0
lea rcx, [rsi + rsi]
call fcn.140082d10
mov qword [rbp - 0x20], rax
mov rdx, rax
test rax, rax
je 0x14007043b
lea rax, [r14*8 + 0xf]
and rax, 0xfffffffffffffff0
call fcn.1400c97d0
mov r13, qword [rbx]
sub rsp, rax
lea rcx, [rsp + 0x30]
mov r12, rcx
mov r15, rcx
test r13, r13
je 0x1400701b0
mov qword [rbp - 0x10], rcx
mov r12, r13
mov rdi, rdx
mov r13, rdx
mov qword [rbp - 0x18], rcx
nop dword [rax]
mov edx, 0x3d
mov rcx, r12
call sub.msvcrt.dll_strchr
test rax, rax
je 0x14007019b
mov rax, rdi
mov edx, esi
mov qword [rsp + 0x20], rdi
mov r9d, 0xffffffff
sub rax, r13
mov r8, r12
mov ecx, 0xfde9
sar rax, 1
sub edx, eax
mov dword [rsp + 0x28], edx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jle 0x14007040b
cdqe
mov qword [r15], rdi
add r15, 8
lea rdi, [rdi + rax*2]
mov r12, qword [rbx + 8]
add rbx, 8
test r12, r12
jne 0x140070148
mov r12, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x18]
lea rdx, [r14 - 1]
mov r8d, 8
mov qword [rbp - 0x10], rcx
xor edi, edi
mov qword [r15], 0
lea r9, [0x140070040]
xor r15d, r15d
call sub.msvcrt.dll_qsort
mov rbx, qword [rbp - 0x10]
mov r14, qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov r8, qword [rbx]
test r8, r8
je 0x140070226
lea rdx, [0x140227180]
lea rax, [rdi + r15]
lea rax, [rdx + rax*8]
mov rcx, qword [rax + 8]
mov edx, dword [rax + 0x10]
call fcn.14006ff00
test eax, eax
js 0x140070226
add rbx, 8
test eax, eax
jne 0x1400701e1
add r15, 1
cmp r15, 0xb
je 0x14007025e
mov r8, qword [rbx]
lea rdi, [r15 + r15]
test r8, r8
jne 0x1400701e9
lea rax, [0x140227180]
add rdi, r15
xor edx, edx
xor r8d, r8d
lea rdi, [rax + rdi*8]
mov rcx, qword [rdi]
call r14
mov rdx, qword [rbp - 8]
mov dword [rdx + r15*4], eax
test eax, eax
je 0x140070210
add rsi, qword [rdi + 0x10]
mov eax, eax
add r15, 1
add rsi, rax
cmp r15, 0xb
jne 0x14007021a
lea rcx, [rsi + rsi + 2]
xor ebx, ebx
call fcn.140082d10
mov qword [rbp - 0x10], rax
mov r15, rax
test rax, rax
je 0x140070432
mov qword [rbp - 0x18], rsi
mov r13, qword [rbp - 8]
jmp 0x1400702fa
cmp rbx, 0xa
ja 0x140070320
lea rax, [rbx + rbx*2]
lea rsi, [0x140227180]
lea rsi, [rsi + rax*8]
mov r14d, dword [rsi + 0x10]
mov dword [rbp - 8], r14d
mov r14, r12
mov rcx, qword [rsi + 8]
mov edx, dword [rbp - 8]
call fcn.14006ff00
mov r12d, eax
test eax, eax
js 0x1400703f8
mov rcx, qword [r14]
add r14, 8
call sub.msvcrt.dll_wcslen
mov rdx, qword [r14 - 8]
mov rcx, r15
lea edi, [rax + 1]
movsxd rdi, edi
add rdi, rdi
mov r8, rdi
call sub.msvcrt.dll_memcpy
test r12d, r12d
jne 0x1400703e2
mov r12, r14
add rbx, 1
add r15, rdi
mov r8, qword [r12]
test r8, r8
jne 0x140070288
cmp rbx, 0xa
ja 0x140070350
movsxd rdi, dword [r13 + rbx*4]
test edi, edi
jne 0x140070380
add rbx, 1
add rdi, rdi
jmp 0x1400702f7
mov rcx, r8
call sub.msvcrt.dll_wcslen
mov rdx, qword [r12]
mov rcx, r15
add r12, 8
lea ebx, [rax + 1]
movsxd rbx, ebx
add rbx, rbx
mov r8, rbx
add r15, rbx
call sub.msvcrt.dll_memcpy
mov rcx, qword [r12]
test rcx, rcx
jne 0x140070323
xor eax, eax
mov rcx, qword [rbp - 0x20]
mov word [r15], ax
call fcn.140082d30
mov rax, qword [rbp + 0x58]
mov rsi, qword [rbp - 0x10]
mov qword [rax], rsi
xor eax, eax
lea rsp, [rbp + 8]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
lea rax, [rbx + rbx*2]
lea rsi, [0x140227180]
mov rcx, r15
lea r14, [rsi + rax*8]
mov rdx, qword [r14 + 8]
call sub.msvcrt.dll_wcscpy
mov rax, qword [r14 + 0x10]
mov rsi, qword [rbp - 0x10]
mov r8d, dword [rbp - 0x18]
mov rcx, qword [r14]
lea r15, [r15 + rax*2]
mov rax, r15
mov rdx, r15
sub rax, rsi
sar rax, 1
sub r8d, eax
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea edx, [rdi - 1]
cmp edx, eax
je 0x140070312
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.GetEnvironmentVariableW
mov ecx, eax
call fcn.140060590
mov r8, qword [r14]
add r15, rdi
test r8, r8
jne 0x1400702ac
nop dword [rax]
mov r12, r14
jmp 0x140070309
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x14007036c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [rbp - 0x20]
mov ebx, eax
call fcn.140082d30
mov eax, ebx
jmp 0x14007036c
xor ecx, ecx
mov r14d, 1
xor esi, esi
jmp 0x1400700f8
mov rcx, qword [rbp - 0x20]
call fcn.140082d30
mov eax, 0xe
jmp 0x14007036c