Function at 0x140040668
Capabilities:
Set environment variable

Disassembly:
mov qword [rsp + 0x18], rbx
mov dword [rsp + 0x10], edx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
xor esi, esi
mov ebx, edx
mov r15, rcx
test rcx, rcx
jne 0x140040294
call fcn.14002dfd0
mov dword [rax], reloc.WS2_32.dll_shutdown
or rax, 0xffffffffffffffff
jmp 0x14004054d
mov edx, 0x3d
mov rdi, r15
call fcn.14002b6ec
mov r13, rax
test rax, rax
je 0x14004052c
cmp rax, r15
je 0x14004052c
mov r14, qword [0x140095458]
cmp r14, qword [0x140095470]
mov bpl, byte [rax + 1]
mov byte [rsp + 0x70], bpl
jne 0x1400402e1
mov rcx, r14
call fcn.14004057c
mov r14, rax
mov qword [0x140095458], rax
mov r12d, 1
test r14, r14
jne 0x1400403a5
test ebx, ebx
je 0x140040333
cmp qword [0x140095460], rsi
je 0x140040333
call fcn.1400372a8
test rax, rax
je 0x14004052c
mov r14, qword [0x140095458]
cmp r14, qword [0x140095470]
jne 0x1400403a0
mov rcx, r14
call fcn.14004057c
mov r14, rax
mov qword [0x140095458], rax
jmp 0x1400403a0
test bpl, bpl
je 0x14004053b
mov edx, 8
mov rcx, r12
call fcn.140038244
xor ecx, ecx
mov qword [0x140095458], rax
call fcn.14003ae30
mov r14, qword [0x140095458]
test r14, r14
jne 0x14004036c
or rbp, 0xffffffffffffffff
jmp 0x14004053d
cmp qword [0x140095460], rsi
jne 0x1400403a0
mov edx, 8
mov rcx, r12
call fcn.140038244
xor ecx, ecx
mov qword [0x140095460], rax
call fcn.14003ae30
cmp qword [0x140095460], rsi
je 0x140040363
mov r14, qword [0x140095458]
test r14, r14
je 0x140040363
mov r12, r13
mov rbx, r14
sub r12, r15
cmp qword [r14], rsi
je 0x1400403e7
mov rdx, qword [rbx]
mov r8, r12
mov rcx, r15
call fcn.14003ea70
test eax, eax
jne 0x1400403d5
mov rax, qword [rbx]
cmp byte [r12 + rax], 0x3d
je 0x1400403de
cmp byte [r12 + rax], sil
je 0x1400403de
add rbx, 8
cmp qword [rbx], rsi
jmp 0x1400403b1
sub rbx, r14
sar rbx, 3
jmp 0x1400403f1
sub rbx, r14
sar rbx, 3
neg rbx
test rbx, rbx
js 0x14004044d
cmp qword [r14], rsi
je 0x14004044d
mov rcx, qword [r14 + rbx*8]
call fcn.14003ae30
test bpl, bpl
je 0x14004041e
mov qword [r14 + rbx*8], r15
jmp 0x1400404a7
mov rax, qword [r14 + rbx*8 + 8]
mov qword [r14 + rbx*8], rax
inc rbx
cmp qword [r14 + rbx*8], rsi
jne 0x140040412
mov r8d, 8
mov rdx, rbx
mov rcx, r14
call fcn.14002db98
xor ecx, ecx
mov rbx, rax
call fcn.14003ae30
test rbx, rbx
je 0x1400404aa
mov qword [0x140095458], rbx
jmp 0x1400404aa
test bpl, bpl
je 0x14004053f
neg rbx
lea rdx, [rbx + 2]
cmp rdx, rbx
jae 0x14004046b
or rbp, 0xffffffffffffffff
jmp 0x140040541
movabs rax, 0x1fffffffffffffff
cmp rdx, rax
jae 0x140040462
mov r8d, 8
mov rcx, r14
call fcn.14002db98
xor ecx, ecx
mov r14, rax
call fcn.14003ae30
test r14, r14
je 0x140040462
mov qword [r14 + rbx*8], r15
mov qword [r14 + rbx*8 + 8], rsi
mov qword [0x140095458], r14
mov rdi, rsi
cmp dword [rsp + 0x78], esi
je 0x140040543
or rbp, 0xffffffffffffffff
mov r14, rbp
inc r14
cmp byte [r15 + r14], sil
jne 0x1400404bb
mov edx, 1
lea rcx, [r14 + 2]
call fcn.140038244
mov rbx, rax
test rax, rax
je 0x140040522
mov r8, r15
lea rdx, [r14 + 2]
mov rcx, rax
call fcn.1400330e0
test eax, eax
jne 0x140040565
mov rax, rbx
lea rcx, [r13 + 1]
sub rax, r15
add rcx, rax
neg byte [rsp + 0x70]
sbb rdx, rdx
and rdx, rcx
mov byte [rcx - 1], sil
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
test eax, eax
jne 0x140040522
call fcn.14002dfd0
mov esi, ebp
mov dword [rax], 0x2a
mov rcx, rbx
call fcn.14003ae30
jmp 0x140040543
call fcn.14002dfd0
or rsi, 0xffffffffffffffff
mov dword [rax], reloc.WS2_32.dll_shutdown
mov ebp, esi
mov esi, ebp
mov ebp, esi
mov esi, ebp
mov rcx, rdi
call fcn.14003ae30
mov eax, esi
mov rbx, qword [rsp + 0x80]
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
xor r9d, r9d
mov qword [rsp + 0x20], rsi
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call fcn.14002de9c
int3
jmp 0x14004025c