Function at 0x4ce380
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 + 0x80]
mov r15, qword [rcx]
sub rsp, 0x60
mov qword [rbp + 0x28], rdx
mov rdi, rcx
lea rax, [rsp + 0x30]
mov qword [rbp - 0x38], rax
test r15, r15
je 0x4ce758
mov r12, qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov rbx, rcx
mov r13d, 1
xor esi, esi
nop word [rax + rax]
mov edx, 0x3d
mov rcx, r15
call sub.msvcrt.dll_strchr
test rax, rax
je 0x4ce417
xor edx, edx
mov r9d, 0xffffffff
mov r8, r15
mov ecx, 0xfde9
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
call r12
test eax, eax
jle 0x4ce6e0
cdqe
add r13, 1
add rsi, rax
mov r15, qword [rbx + 8]
add rbx, 8
test r15, r15
jne 0x4ce3d0
lea rcx, [rsi + rsi]
call fcn.004b75d0
mov qword [rbp - 0x48], rax
test rax, rax
jne 0x4ce43f
test rsi, rsi
jne 0x4ce74e
lea rax, [r13*8 + 0xf]
and rax, 0xfffffffffffffff0
call fcn.00522bc0
mov r8, qword [rdi]
sub rsp, rax
lea rbx, [rsp + 0x30]
test r8, r8
je 0x4ce78c
mov r12, qword [rbp - 0x48]
mov r15, rbx
nop dword [rax + rax]
mov edx, 0x3d
mov rcx, r8
mov qword [rbp - 0x40], r8
call sub.msvcrt.dll_strchr
test rax, rax
je 0x4ce4c9
mov rax, r12
sub rax, qword [rbp - 0x48]
mov ecx, esi
xor edx, edx
sar rax, 1
mov qword [rsp + 0x20], r12
mov r8, qword [rbp - 0x40]
mov r9d, 0xffffffff
sub ecx, eax
mov dword [rsp + 0x28], ecx
mov ecx, 0xfde9
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jle 0x4ce736
cdqe
mov qword [r15], r12
add r15, 8
lea r12, [r12 + rax*2]
mov r8, qword [rdi + 8]
add rdi, 8
test r8, r8
jne 0x4ce470
mov qword [r15], 0
test rsi, rsi
jne 0x4ce707
lea rdx, [r13 - 1]
mov r8d, 8
mov rcx, rbx
mov rdi, rbx
lea r9, [0x004ce370]
xor r15d, r15d
lea r12, [0x0071cd20]
call sub.msvcrt.dll_qsort
mov r13, qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
jmp 0x4ce541
lea rax, [r15 + r15*2]
lea rax, [r12 + rax*8]
mov edx, dword [rax + 0x10]
mov rcx, qword [rax + 8]
call fcn.004ce1a0
test eax, eax
js 0x4ce549
add rdi, 8
cmp eax, 1
adc r15, 0
cmp r15, 0xb
je 0x4ce57b
mov r8, qword [rdi]
test r8, r8
jne 0x4ce518
lea rax, [r15 + r15*2]
xor r8d, r8d
xor edx, edx
lea r14, [r12 + rax*8]
mov rcx, qword [r14]
call r13
mov rcx, qword [rbp - 0x38]
mov dword [rcx + r15*4], eax
test eax, eax
je 0x4ce571
add rsi, qword [r14 + 0x10]
mov eax, eax
add rsi, rax
add r15, 1
cmp r15, 0xb
jne 0x4ce541
lea rcx, [rsi + rsi + 2]
xor r15d, r15d
call fcn.004b75d0
mov qword [rbp - 0x40], rax
mov r13, rax
test rax, rax
jne 0x4ce5c9
jmp 0x4ce7a1
mov rcx, r8
add rbx, 8
call sub.msvcrt.dll_wcslen
mov rdx, qword [rbx - 8]
mov rcx, r13
lea r8d, [rax + 1]
movsxd r8, r8d
lea r14, [r8 + r8]
mov r8, r14
call sub.msvcrt.dll_memcpy
add r13, r14
mov r8, qword [rbx]
test r8, r8
je 0x4ce620
cmp r15, 0xa
ja 0x4ce5a0
lea rax, [r15 + r15*2]
lea rax, [r12 + rax*8]
mov edx, dword [rax + 0x10]
mov rcx, qword [rax + 8]
call fcn.004ce1a0
mov edi, eax
test eax, eax
js 0x4ce626
mov rcx, qword [rbx]
add rbx, 8
call sub.msvcrt.dll_wcslen
mov rdx, qword [rbx - 8]
mov rcx, r13
lea r8d, [rax + 1]
movsxd r8, r8d
lea r14, [r8 + r8]
mov r8, r14
call sub.msvcrt.dll_memcpy
cmp edi, 1
adc r15, 0
jmp 0x4ce5c6
cmp r15, 0xa
ja 0x4ce640
mov rax, qword [rbp - 0x38]
mov edi, dword [rax + r15*4]
test edi, edi
jne 0x4ce688
movsxd r8, edi
add r15, 1
lea r14, [r8 + r8]
jmp 0x4ce5c6
mov rax, r13
sub rax, qword [rbp - 0x40]
sar rax, 1
cmp rax, rsi
jne 0x4ce6e8
xor eax, eax
mov rcx, qword [rbp - 0x48]
mov word [r13], ax
call fcn.004b75f0
mov rax, qword [rbp + 0x28]
mov rsi, qword [rbp - 0x40]
mov qword [rax], rsi
xor eax, eax
lea rsp, [rbp - 0x28]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
lea rax, [r15 + r15*2]
mov rcx, r13
lea r14, [r12 + rax*8]
mov rdx, qword [r14 + 8]
call sub.msvcrt.dll_wcscpy
mov rax, qword [r14 + 0x10]
mov r8d, esi
mov rcx, qword [r14]
lea r13, [r13 + rax*2]
mov rax, r13
sub rax, qword [rbp - 0x40]
mov rdx, r13
sar rax, 1
sub r8d, eax
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea edx, [rdi - 1]
cmp edx, eax
je 0x4ce632
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.GetEnvironmentVariableW
mov ecx, eax
call fcn.004bb090
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4ce670
mov r8d, 0x332
lea rdx, str.src_win_process.c
lea rcx, str.env_len___size_t___ptr___dst_
call qword [sym.imp.msvcrt.dll__assert]
jmp 0x4ce653
sub r12, qword [rbp - 0x48]
sar r12, 1
cmp r12, rsi
je 0x4ce4e6
mov r8d, 0x2e6
lea rdx, str.src_win_process.c
lea rcx, str.env_len__0__env_len___size_t___ptr___dst_copy_
call qword [sym.imp.msvcrt.dll__assert]
jmp 0x4ce4e6
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [rbp - 0x48]
mov ebx, eax
call fcn.004b75f0
mov eax, ebx
jmp 0x4ce670
mov eax, 0xe
jmp 0x4ce670
xor ecx, ecx
xor esi, esi
mov r13d, 1
call fcn.004b75d0
mov r8, qword [rdi]
sub rsp, 0x10
mov qword [rbp - 0x48], rax
lea rbx, [rsp + 0x30]
test r8, r8
jne 0x4ce464
mov qword [rbx], 0
jmp 0x4ce4e6
mov qword [rbx], 0
test rsi, rsi
jne 0x4ce717
jmp 0x4ce4e6
mov rcx, qword [rbp - 0x48]
call fcn.004b75f0
mov eax, 0xe
jmp 0x4ce670