Function at 0x14005e2e8
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, [0x140107de8]
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 0x14005e341
test bpl, 0x40
je 0x14005e348
xor ebp, ebp
mov sil, bpl
jmp 0x14005e34a
xor ebp, ebp
lea rdx, str.RANDOM
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
cmp eax, ebp
jne 0x14005e372
call fcn.1400512e8
movabs rcx, 0x7fffffffffffffff
and rax, rcx
jmp 0x14005e38e
lea rdx, str.__THIS
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
cmp eax, ebp
jne 0x14005e3f5
lea rax, [r12 + 0x75bd036]
lea rcx, [rsp + 0x20]
mov rdx, rax
mov word [rsp + 0x20], bp
call fcn.1400bc100
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.1400560cc
sub edi, 1
mov r12, qword [r14]
mov rsi, r12
js 0x14005e550
lea rcx, [rsp + 0x20]
sub rcx, r12
movzx eax, word [rcx + rsi]
mov word [rsi], ax
add rsi, 2
sub edi, 1
jns 0x14005e3e0
jmp 0x14005e550
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov r13b, bpl
movsx r15d, sil
cmp byte [rsp + 0xf8], bpl
jne 0x14005e422
cmp word [rdi], 0x26
je 0x14005e4fc
cmp sil, bpl
jne 0x14005e4d3
mov edx, 0x52
mov rcx, r14
call fcn.1400560cc
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 0x14005e4a2
cmp word [r12], ax
jne 0x14005e49a
lea ecx, [rbp + 0xc]
movsxd rdx, ecx
mov rcx, r14
call fcn.1400560cc
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 0x14005e547
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
jne 0x14005e541
xor ebp, ebp
cmp r13b, bpl
jne 0x14005e541
mov r13b, 1
cmp byte [rsp + 0xf8], bpl
jne 0x14005e541
mov r12, qword [rsp + 0xe0]
or r9d, 0xffffffff
xor r8d, r8d
mov rdx, rdi
mov rcx, r12
call fcn.14001aea0
cmp rax, rbp
jne 0x14005e508
cmp r15d, ebp
jne 0x14005e516
cmp r13b, bpl
jne 0x14005e516
mov r13b, 1
jmp 0x14005e422
add rdi, 2
mov r15d, 1
jmp 0x14005e4d3
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.1400560cc
mov r12, qword [r14]
mov rsi, r12
jmp 0x14005e53a
movzx eax, word [rdi]
mov word [rsi], ax
add rsi, 2
add rdi, 2
sub ebp, 1
jns 0x14005e52c
jmp 0x14005e54e
xor eax, eax
cmp ebp, eax
jle 0x14005e54e
movsxd rcx, ebp
lea rsi, [r12 + rcx*2]
xor ebp, ebp
mov word [rsi], bp
cmp rbx, rbp
je 0x14005e561
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