Function at 0x4502c0
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, 0x70
mov r12, rcx
mov qword [rbp + 0x28], rdx
lea r14, [rsp + 0x30]
test r15, r15
je 0x4506a8
mov r13, qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov rsi, rcx
mov ebx, 1
xor edi, edi
mov edx, 0x3d
mov rcx, r15
call sub.msvcrt.dll_strchr
test rax, rax
je 0x45034c
xor edx, edx
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9d, 0xffffffff
mov r8, r15
mov ecx, 0xfde9
call r13
test eax, eax
jle 0x4505b0
cdqe
add rbx, 1
add rdi, rax
add rsi, 8
mov r15, qword [rsi]
test r15, r15
jne 0x450305
lea rcx, [rdi + rdi]
call fcn.0043d450
test rax, rax
mov rdx, rax
mov qword [rbp - 0x50], rax
je 0x450590
lea rax, [rbx*8 + 0x1e]
and rax, 0xfffffffffffffff0
call fcn.0046fa50
mov r8, qword [r12]
sub rsp, rax
lea rax, [rsp + 0x30]
test r8, r8
mov qword [rbp - 0x38], rax
mov rsi, rax
je 0x4506c9
mov qword [rbp - 0x40], rbx
mov r15, rax
mov r13, rdx
mov qword [rbp - 0x48], rax
mov rbx, rdx
mov rsi, r8
mov edx, 0x3d
mov rcx, rsi
call sub.msvcrt.dll_strchr
test rax, rax
je 0x450406
mov rax, r13
mov edx, edi
mov qword [rsp + 0x20], r13
sub rax, rbx
mov r9d, 0xffffffff
mov r8, rsi
sar rax, 1
mov ecx, 0xfde9
sub edx, eax
mov dword [rsp + 0x28], edx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jle 0x450690
cdqe
mov qword [r15], r13
add r15, 8
lea r13, [r13 + rax*2]
add r12, 8
mov rsi, qword [r12]
test rsi, rsi
jne 0x4503b2
sub r13, qword [rbp - 0x50]
mov rbx, qword [rbp - 0x40]
mov rsi, qword [rbp - 0x48]
sar r13, 1
cmp rdi, r13
mov qword [r15], 0
je 0x450447
lea rdx, str.src_win_process.c
lea rcx, str.env_len__ptr___dst_copy
mov r8d, 0x2e6
call fcn.00472160
mov r15, qword [rbp - 0x38]
lea rdx, [rbx - 1]
lea r9, [0x004502b0]
mov r8d, 8
xor r13d, r13d
lea r12, [0x0051c2c0]
mov rcx, r15
call sub.msvcrt.dll_qsort
jmp 0x45049a
lea rax, [r13 + r13*2]
lea rax, [r12 + rax*8]
mov edx, dword [rax + 0x10]
mov rcx, qword [rax + 8]
call fcn.004500c0
test eax, eax
js 0x4504a2
add r15, 8
cmp eax, 1
adc r13, 0
cmp r13, 0xa
ja 0x4504d4
mov r8, qword [r15]
test r8, r8
jne 0x450470
lea rax, [r13 + r13*2]
xor r8d, r8d
xor edx, edx
lea rbx, [r12 + rax*8]
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
mov dword [r14 + r13*4], eax
je 0x4504ca
add rdi, qword [rbx + 0x10]
mov eax, eax
add rdi, rax
add r13, 1
cmp r13, 0xa
jbe 0x45049a
lea rcx, [rdi + rdi + 2]
call fcn.0043d450
test rax, rax
mov qword [rbp - 0x38], rax
je 0x4506b6
mov rbx, rax
xor r15d, r15d
mov qword [rbp - 0x40], rdi
jmp 0x450524
call sub.msvcrt.dll_wcslen
lea r13d, [rax + 1]
mov rdx, qword [rsi]
mov rcx, rbx
add rsi, 8
movsxd r13, r13d
add r13, r13
mov r8, r13
call sub.msvcrt.dll_memcpy
add rbx, r13
mov rcx, qword [rsi]
test rcx, rcx
je 0x4505c0
cmp r15, 0xa
ja 0x450500
lea rax, [r15 + r15*2]
mov r8, rcx
lea rax, [r12 + rax*8]
mov edx, dword [rax + 0x10]
mov rcx, qword [rax + 8]
call fcn.004500c0
test eax, eax
js 0x4505c6
mov rcx, qword [rsi]
mov dword [rbp - 0x48], eax
add rsi, 8
call sub.msvcrt.dll_wcslen
lea r13d, [rax + 1]
mov rdx, qword [rsi - 8]
mov rcx, rbx
movsxd r13, r13d
add r13, r13
mov r8, r13
call sub.msvcrt.dll_memcpy
mov r10d, dword [rbp - 0x48]
cmp r10d, 1
adc r15, 0
jmp 0x450521
mov eax, 0xe
lea rsp, [rbp - 0x28]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x450595
cmp r15, 0xa
ja 0x4505db
movsxd r13, dword [r14 + r15*4]
test r13d, r13d
jne 0x450630
add r15, 1
add r13, r13
jmp 0x450521
mov rax, rbx
sub rax, qword [rbp - 0x38]
mov rdi, qword [rbp - 0x40]
sar rax, 1
cmp rdi, rax
je 0x450607
lea rdx, str.src_win_process.c
lea rcx, str.env_len___ptr___dst_
mov r8d, 0x332
call fcn.00472160
mov rcx, qword [rbp - 0x50]
xor eax, eax
mov word [rbx], ax
call fcn.0043d460
mov rax, qword [rbp + 0x28]
mov rdi, qword [rbp - 0x38]
mov qword [rax], rdi
xor eax, eax
jmp 0x450595
lea rax, [r15 + r15*2]
mov rcx, rbx
lea rdi, [r12 + rax*8]
mov rdx, qword [rdi + 8]
call sub.msvcrt.dll_wcscpy
mov rax, qword [rdi + 0x10]
mov r8d, dword [rbp - 0x40]
mov rcx, qword [rdi]
lea rbx, [rbx + rax*2]
mov rax, rbx
sub rax, qword [rbp - 0x38]
mov rdx, rbx
sar rax, 1
sub r8d, eax
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea edx, [r13 - 1]
cmp eax, edx
je 0x4505cf
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.GetEnvironmentVariableW
mov ecx, eax
call fcn.00440240
nop dword [rax]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [rbp - 0x50]
mov ebx, eax
call fcn.0043d460
mov eax, ebx
jmp 0x450595
xor ecx, ecx
mov ebx, 1
xor edi, edi
jmp 0x45035c
mov rcx, qword [rbp - 0x50]
call fcn.0043d460
mov eax, 0xe
jmp 0x450595
mov r15, qword [rbp - 0x38]
xor r13d, r13d
jmp 0x450422