Function at 0x140161aa0
Capabilities:
Set environment variable

Disassembly:
push rbx
push r12
push r15
sub rsp, 0x40
xor ebx, ebx
test rcx, rcx
mov r15d, edx
mov dword [rsp + 0x60], ebx
mov r12, rcx
jne 0x140161ae7
call fcn.1401490c0
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x20], rbx
mov dword [rax], 0x16
call fcn.140147cf0
or eax, 0xffffffff
add rsp, 0x40
pop r15
pop r12
pop rbx
ret
mov qword [rsp + 0x68], rbp
mov rbp, qword [rcx]
mov qword [rsp + 0x30], r14
test rbp, rbp
je 0x140161dd4
mov edx, 0x3d
mov rcx, rbp
call fcn.140162f50
test rax, rax
mov r14, rax
je 0x140161dd4
cmp rbp, rax
je 0x140161dd4
cmp byte [rax + 1], bl
mov qword [rsp + 0x78], rdi
mov rdi, qword [0x140205830]
mov qword [rsp + 0x38], r13
mov r13d, ebx
sete r13b
cmp rdi, qword [0x140205838]
jne 0x140161b55
mov rcx, rdi
call fcn.140161a00
mov rdi, rax
mov qword [0x140205830], rax
test rdi, rdi
jne 0x140161bdf
test r15d, r15d
je 0x140161b88
cmp qword [0x140205840], rbx
je 0x140161b88
call fcn.14015dfe0
test eax, eax
je 0x140161bd8
call fcn.1401490c0
mov dword [rax], 0x16
or eax, 0xffffffff
jmp 0x140161da1
test r13d, r13d
je 0x140161b94
xor eax, eax
jmp 0x140161da1
mov ecx, 8
call fcn.14014be30
test rax, rax
mov qword [0x140205830], rax
je 0x140161b80
mov qword [rax], rbx
cmp qword [0x140205840], rbx
jne 0x140161bd8
mov ecx, 8
call fcn.14014be30
test rax, rax
mov qword [0x140205840], rax
je 0x140161b80
mov qword [rax], rbx
mov rdi, qword [0x140205830]
jmp 0x140161bdf
mov rdi, qword [0x140205830]
test rdi, rdi
je 0x140161b80
mov edx, r14d
mov rcx, rbp
mov qword [rsp + 0x70], rsi
sub edx, ebp
call fcn.140161960
test eax, eax
movsxd rsi, eax
js 0x140161c7c
cmp qword [rdi], rbx
je 0x140161c7c
mov rcx, qword [rdi + rsi*8]
mov rbx, rsi
call fcn.1401465e0
test r13d, r13d
je 0x140161c70
cmp qword [rdi + rsi*8], 0
je 0x140161c38
nop
nop
mov rax, qword [rdi + rbx*8 + 8]
add rbx, 1
add esi, 1
mov qword [rdi + rbx*8 - 8], rax
cmp qword [rdi + rbx*8], 0
jne 0x140161c20
movsxd rdx, esi
movabs rax, 0x1fffffffffffffff
cmp rdx, rax
jae 0x140161ce5
mov rcx, qword [0x140205830]
mov r8d, 8
call fcn.14014bfc0
test rax, rax
je 0x140161ce1
mov qword [0x140205830], rax
xor esi, esi
jmp 0x140161ce7
mov qword [rdi + rsi*8], rbp
xor esi, esi
mov qword [r12], rsi
jmp 0x140161ce7
test r13d, r13d
jne 0x140161dc4
test eax, eax
jns 0x140161c8b
neg esi
lea eax, [rsi + 2]
cmp eax, esi
jl 0x140161dbf
movsxd r8, eax
movabs rax, 0x1fffffffffffffff
cmp r8, rax
jae 0x140161dbf
mov rcx, qword [0x140205830]
mov edx, 8
call fcn.14014bfc0
test rax, rax
je 0x140161dbf
movsxd rcx, esi
xor esi, esi
mov qword [rax + rcx*8], rbp
mov qword [rax + rcx*8 + 8], rbx
mov qword [r12], rbx
mov qword [0x140205830], rax
jmp 0x140161ce7
xor esi, esi
jmp 0x140161ce7
xor esi, esi
test r15d, r15d
je 0x140161d87
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, rbp
repne scasb al, byte [rdi]
lea edx, [rax + 1]
not rcx
add rcx, 1
call fcn.14014bea0
test rax, rax
mov rbx, rax
je 0x140161d87
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, rbp
repne scasb al, byte [rdi]
mov r8, rbp
not rcx
lea rdx, [rcx + 1]
mov rcx, rbx
call fcn.140147580
test eax, eax
je 0x140161d47
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x20], rsi
call fcn.140147c10
mov rdx, rbx
mov rcx, rbx
sub rdx, rbp
add rdx, r14
add rdx, 1
test r13d, r13d
mov byte [rdx - 1], 0
cmovne rdx, rsi
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
test eax, eax
jne 0x140161d7f
mov dword [rsp + 0x60], 0xffffffff
call fcn.1401490c0
mov dword [rax], 0x2a
mov rcx, rbx
call fcn.1401465e0
test r13d, r13d
je 0x140161d98
mov rcx, rbp
call fcn.1401465e0
mov qword [r12], rsi
mov eax, dword [rsp + 0x60]
mov rsi, qword [rsp + 0x70]
mov rdi, qword [rsp + 0x78]
mov r13, qword [rsp + 0x38]
mov rbp, qword [rsp + 0x68]
mov r14, qword [rsp + 0x30]
add rsp, 0x40
pop r15
pop r12
pop rbx
ret
or eax, 0xffffffff
jmp 0x140161d9c
mov rcx, rbp
call fcn.1401465e0
mov qword [r12], rbx
xor eax, eax
jmp 0x140161d9c
call fcn.1401490c0
mov dword [rax], 0x16
or eax, 0xffffffff
jmp 0x140161dab