Function at 0x140060818
Capabilities:
Query environment variable

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xa0
mov r12, rcx
lea rbx, [0x14010ee80]
mov ebp, r9d
mov rcx, rbx
mov r14, r8
mov rdi, rdx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov sil, byte [r12 + 0xd]
xor ecx, ecx
cmp ebp, ecx
setl al
and sil, 0x11
mov byte [rsp + 0xf8], al
cmp al, cl
jne 0x140060871
test bpl, 0x40
je 0x140060878
xor ebp, ebp
mov sil, bpl
jmp 0x14006087a
xor ebp, ebp
lea rdx, str.RANDOM
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
cmp eax, ebp
jne 0x1400608a2
call fcn.140052f38
movabs rcx, 0x7fffffffffffffff
and rax, rcx
jmp 0x1400608be
lea rdx, str.__THIS
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
cmp eax, ebp
jne 0x140060925
lea rax, [r12 + 0x75bd036]
lea rcx, [rsp + 0x20]
mov rdx, rax
mov word [rsp + 0x20], bp
call fcn.1400c3bd4
lea rcx, [rsp + 0x20]
mov word [rsp + 0x9a], bp
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov edi, eax
cmp eax, 1
cmovl edi, ebp
lea ecx, [rdi + 2]
movsxd rdx, ecx
mov rcx, r14
call fcn.14005828c
sub edi, 1
mov r12, qword [r14]
mov rsi, r12
js 0x140060a80
lea rcx, [rsp + 0x20]
sub rcx, r12
movzx eax, word [rcx + rsi]
mov word [rsi], ax
add rsi, 2
sub edi, 1
jns 0x140060910
jmp 0x140060a80
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov r13b, bpl
movsx r15d, sil
cmp byte [rsp + 0xf8], bpl
jne 0x140060952
cmp word [rdi], 0x26
je 0x140060a2c
cmp sil, bpl
jne 0x140060a03
mov edx, 0x52
mov rcx, r14
call fcn.14005828c
mov r12, qword [r14]
xor ecx, ecx
mov word [r12], bp
mov rsi, r12
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rdx, qword [r14]
mov r8d, 0x50
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov ebp, eax
xor eax, eax
cmp ebp, eax
jle 0x1400609d2
cmp word [r12], ax
jne 0x1400609ca
lea ecx, [rbp + 0xc]
movsxd rdx, ecx
mov rcx, r14
call fcn.14005828c
mov r12, qword [r14]
xor eax, eax
xor ecx, ecx
mov word [r12], ax
mov rsi, r12
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rdx, qword [r14]
lea r8d, [rbp + 0xa]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov ebp, eax
xor eax, eax
cmp ebp, eax
jg 0x140060a77
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
jne 0x140060a71
xor ebp, ebp
cmp r13b, bpl
jne 0x140060a71
mov r13b, 1
cmp byte [rsp + 0xf8], bpl
jne 0x140060a71
mov r12, qword [rsp + 0xe0]
or r9d, 0xffffffff
xor r8d, r8d
mov rdx, rdi
mov rcx, r12
call fcn.14001b570
cmp rax, rbp
jne 0x140060a38
cmp r15d, ebp
jne 0x140060a46
cmp r13b, bpl
jne 0x140060a46
mov r13b, 1
jmp 0x140060952
add rdi, 2
mov r15d, 1
jmp 0x140060a03
mov rdi, qword [rax]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebp, eax
lea ecx, [rbp + 2]
movsxd rdx, ecx
mov rcx, r14
call fcn.14005828c
mov r12, qword [r14]
mov rsi, r12
jmp 0x140060a6a
movzx eax, word [rdi]
mov word [rsi], ax
add rsi, 2
add rdi, 2
sub ebp, 1
jns 0x140060a5c
jmp 0x140060a7e
xor eax, eax
cmp ebp, eax
jle 0x140060a7e
movsxd rcx, ebp
lea rsi, [r12 + rcx*2]
xor ebp, ebp
mov word [rsi], bp
cmp rbx, rbp
je 0x140060a91
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, r12
mov rbx, qword [rsp + 0xe8]
add rsp, 0xa0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret