Function at 0x14005f790
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, [0x14010ce50]
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 0x14005f7e9
test bpl, 0x40
je 0x14005f7f0
xor ebp, ebp
mov sil, bpl
jmp 0x14005f7f2
xor ebp, ebp
lea rdx, str.RANDOM
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
cmp eax, ebp
jne 0x14005f81a
call fcn.140052044
movabs rcx, 0x7fffffffffffffff
and rax, rcx
jmp 0x14005f836
lea rdx, str.__THIS
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
cmp eax, ebp
jne 0x14005f89d
lea rax, [r12 + 0x75bd036]
lea rcx, [rsp + 0x20]
mov rdx, rax
mov word [rsp + 0x20], bp
call fcn.1400c1728
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.140057254
sub edi, 1
mov r12, qword [r14]
mov rsi, r12
js 0x14005f9f8
lea rcx, [rsp + 0x20]
sub rcx, r12
movzx eax, word [rcx + rsi]
mov word [rsi], ax
add rsi, 2
sub edi, 1
jns 0x14005f888
jmp 0x14005f9f8
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov r13b, bpl
movsx r15d, sil
cmp byte [rsp + 0xf8], bpl
jne 0x14005f8ca
cmp word [rdi], 0x26
je 0x14005f9a4
cmp sil, bpl
jne 0x14005f97b
mov edx, 0x52
mov rcx, r14
call fcn.140057254
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 0x14005f94a
cmp word [r12], ax
jne 0x14005f942
lea ecx, [rbp + 0xc]
movsxd rdx, ecx
mov rcx, r14
call fcn.140057254
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 0x14005f9ef
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
jne 0x14005f9e9
xor ebp, ebp
cmp r13b, bpl
jne 0x14005f9e9
mov r13b, 1
cmp byte [rsp + 0xf8], bpl
jne 0x14005f9e9
mov r12, qword [rsp + 0xe0]
or r9d, 0xffffffff
xor r8d, r8d
mov rdx, rdi
mov rcx, r12
call fcn.14001b2ac
cmp rax, rbp
jne 0x14005f9b0
cmp r15d, ebp
jne 0x14005f9be
cmp r13b, bpl
jne 0x14005f9be
mov r13b, 1
jmp 0x14005f8ca
add rdi, 2
mov r15d, 1
jmp 0x14005f97b
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.140057254
mov r12, qword [r14]
mov rsi, r12
jmp 0x14005f9e2
movzx eax, word [rdi]
mov word [rsi], ax
add rsi, 2
add rdi, 2
sub ebp, 1
jns 0x14005f9d4
jmp 0x14005f9f6
xor eax, eax
cmp ebp, eax
jle 0x14005f9f6
movsxd rcx, ebp
lea rsi, [r12 + rcx*2]
xor ebp, ebp
mov word [rsi], bp
cmp rbx, rbp
je 0x14005fa09
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