Function at 0x140040340
Capabilities:
Query environment variable

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x4b8
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x430], 0xfffffffffffffffe
mov rdi, rcx
lea rcx, [rbp - 0x60]
call fcn.140050050
mov r14, qword [rbp - 0x58]
test r14, r14
je 0x140040503
mov qword [rbp + 0x3f0], rdi
mov rcx, qword [rbp - 0x60]
mov rax, qword [rbp - 0x50]
mov qword [rbp + 0x3f8], rcx
mov qword [rbp + 0x3b8], rcx
mov qword [rbp + 0x3c0], r14
mov qword [rbp + 0x3c8], rax
mov qword [rbp + 0x400], 0
mov qword [rbp + 0x408], 2
mov qword [rbp + 0x410], 0
mov r8d, 0x200
mov eax, 2
mov qword [rbp + 0x428], rax
xor eax, eax
mov qword [rbp + 0x420], rax
xor edi, edi
xor esi, esi
cmp r8, 0x201
jae 0x140040430
jmp 0x140040412
mov r14, rbx
jae 0x14004056d
cmp r8, 0x201
jae 0x140040430
lea r13, [rbp - 0x60]
mov r15d, 0x200
mov r12, r8
jmp 0x140040492
sub r8, rsi
sub rdi, rsi
cmp rdi, r8
jae 0x140040466
lea rcx, [rbp + 0x400]
mov rdx, rsi
call fcn.140072c30
mov rax, qword [rbp + 0x400]
mov qword [rbp + 0x420], rax
mov rax, qword [rbp + 0x408]
mov qword [rbp + 0x428], rax
mov rdi, qword [rbp + 0x420]
mov eax, 0xffffffff
cmp rdi, rax
mov esi, 0xffffffff
cmovb rsi, rdi
mov qword [rbp + 0x410], rsi
mov r13, qword [rbp + 0x428]
mov r15, rsi
mov r12, rsi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rbx, r14
mov rcx, r14
mov rdx, r13
mov r8d, r12d
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov r14d, eax
test eax, eax
jne 0x1400404c1
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1400405bb
mov r8d, r14d
cmp r12, r8
jne 0x140040400
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x1400406ba
mov r14, rbx
add r12, r12
mov eax, 0xffffffff
cmp r12, rax
cmovae r12, rax
mov r8, r12
cmp r8, 0x201
jb 0x140040412
jmp 0x140040430
mov rdx, qword [rbp - 0x60]
mov eax, edx
and eax, 3
cmp eax, 1
jne 0x140040564
lea rax, [rdx - 1]
mov qword [rbp + 0x420], rax
mov rcx, qword [rdx - 1]
mov qword [rbp + 0x428], rdx
mov rax, qword [rdx + 7]
call qword [rax]
mov rax, qword [rbp + 0x428]
mov rax, qword [rax + 7]
cmp qword [rax + 8], 0
mov rsi, qword [rbp + 0x420]
je 0x140040552
mov r8, qword [rax + 0x10]
mov rcx, qword [rsi]
call fcn.14004ad30
mov rcx, qword [0x1400a7c58]
xor edx, edx
mov r8, rsi
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov byte [rdi + 0x18], 2
jmp 0x1400406a3
cmp r15, r8
jb 0x1400406d4
lea rcx, [rbp + 0x3d0]
mov rdx, r13
call fcn.140045590
mov r15, qword [rbp + 0x3d0]
movups xmm0, xmmword [rbp + 0x3d8]
movaps xmmword [rbp + 0x3a0], xmm0
movzx esi, byte [rbp + 0x3e8]
mov eax, dword [rbp + 0x3e9]
mov dword [rbp + 0x418], eax
mov eax, dword [rbp + 0x3ec]
mov dword [rbp + 0x41b], eax
jmp 0x1400405d2
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r15d, eax
shl r15, 0x20
or r15, 2
mov sil, 2
mov r14, rbx
cmp qword [rbp + 0x420], 0
mov rdi, qword [rbp + 0x3f0]
je 0x1400405f9
mov rcx, qword [0x1400a7c58]
xor edx, edx
mov r8, qword [rbp + 0x428]
call qword [sym.imp.KERNEL32.dll_HeapFree]
cmp sil, 2
jne 0x140040663
mov byte [rdi + 0x18], 2
mov eax, r15d
and eax, 3
cmp eax, 1
jne 0x140040687
lea rax, [r15 - 1]
mov qword [rbp + 0x420], rax
mov rcx, qword [r15 - 1]
mov rax, qword [r15 + 7]
mov qword [rbp + 0x428], r15
call qword [rax]
mov rax, qword [rbp + 0x428]
mov rax, qword [rax + 7]
cmp qword [rax + 8], 0
mov rsi, qword [rbp + 0x420]
je 0x14004064f
mov r8, qword [rax + 0x10]
mov rcx, qword [rsi]
call fcn.14004ad30
mov rcx, qword [0x1400a7c58]
xor edx, edx
mov r8, rsi
call qword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x140040687
movaps xmm0, xmmword [rbp + 0x3a0]
movups xmmword [rdi + 8], xmm0
mov eax, dword [rbp + 0x418]
mov ecx, dword [rbp + 0x41b]
mov dword [rdi + 0x19], eax
mov dword [rdi + 0x1c], ecx
mov qword [rdi], r15
mov byte [rdi + 0x18], sil
cmp qword [rbp + 0x3f8], 0
je 0x1400406a3
mov rcx, qword [0x1400a7c58]
xor edx, edx
mov r8, r14
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rax, rdi
add rsp, 0x4b8
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
lea rcx, [0x14008427b]
lea r8, str.library_std_src_syswindowsmod.rs
mov edx, 0x28
call fcn.140071a80
jmp 0x1400406e9
lea rax, str.md_b_
mov rcx, r8
mov rdx, r15
mov r8, rax
call fcn.140071e50
ud2