Function at 0x110133c84
Capabilities:
Set environment variable

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
xor ebp, ebp
mov r13d, edx
mov dword [rsp + 0x60], ebp
mov r14, rcx
test rcx, rcx
jne 0x110133cd5
call sym.msvcrt.dll__errno
xor r9d, r9d
mov qword [rsp + 0x20], rbp
xor r8d, r8d
xor edx, edx
xor ecx, ecx
mov dword [rax], 0x16
call sym.msvcrt.dll__invalid_parameter
jmp 0x110133d7e
mov rdi, qword [rcx]
test rdi, rdi
je 0x110133d73
mov edx, 0x3d
mov rcx, rdi
call sym.msvcrt.dll_wcschr
mov r15, rax
test rax, rax
je 0x110133d73
cmp rdi, rax
je 0x110133d73
mov rcx, qword [sym.msvcrt.dll__wenviron]
cmp rcx, qword [sym.msvcrt.dll___winitenv]
movzx r12d, word [rax + 2]
jne 0x110133d1f
call fcn.110134030
mov rcx, rax
mov qword [sym.msvcrt.dll__wenviron], rax
test rcx, rcx
jne 0x110133df0
mov rax, qword [sym.msvcrt.dll__environ]
test r13d, r13d
je 0x110133d9e
test rax, rax
je 0x110133d9e
call fcn.11013091c
mov qword [0x1101945a8], rax
call fcn.11013c2ac
mov rcx, qword [sym.msvcrt.dll__wenviron]
mov ebx, eax
call fcn.110134030
mov qword [sym.msvcrt.dll__wenviron], rax
mov rcx, rax
test ebx, ebx
jns 0x110133df0
call fcn.110130784
test eax, eax
je 0x110133de9
call sym.msvcrt.dll__errno
mov dword [rax], 0x16
or eax, 0xffffffff
mov rbx, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
ret
test r12w, r12w
jne 0x110133da8
xor eax, eax
jmp 0x110133d81
test rax, rax
jne 0x110133dd0
lea ecx, [rax + 8]
call fcn.110119f74
mov qword [sym.msvcrt.dll__environ], rax
test rax, rax
je 0x110133d7e
mov qword [rax], rbp
mov rcx, qword [sym.msvcrt.dll__wenviron]
test rcx, rcx
jne 0x110133df0
mov ecx, 8
call fcn.110119f74
mov qword [sym.msvcrt.dll__wenviron], rax
test rax, rax
je 0x110133d7e
mov qword [rax], rbp
mov rcx, qword [sym.msvcrt.dll__wenviron]
mov rsi, rcx
test rcx, rcx
je 0x110133d7e
mov rax, qword [rcx]
sub r15, rdi
sar r15, 1
mov rbx, rcx
test rax, rax
je 0x110133e4d
movsxd rbp, r15d
mov r8, rbp
mov rdx, rax
mov rcx, rdi
call sym.msvcrt.dll__wcsnicoll
xor ecx, ecx
test eax, eax
jne 0x110133e3a
mov rax, qword [rbx]
lea edx, [rcx + 0x3d]
cmp word [rax + rbp*2], dx
je 0x110133ee4
cmp word [rax + rbp*2], cx
je 0x110133ee4
add rbx, 8
mov rax, qword [rbx]
test rax, rax
jne 0x110133e0c
mov rcx, qword [sym.msvcrt.dll__wenviron]
sub rbx, rcx
sar rbx, 3
neg ebx
xor ebp, ebp
test ebx, ebx
js 0x110133eff
cmp qword [rsi], rbp
je 0x110133eff
movsxd rax, ebx
lea rsi, [rsi + rax*8]
mov rax, qword [rsi]
cmp rax, qword [sym.msvcrt.dll___winitenv]
jb 0x110133e85
cmp rax, qword [0x110195b50]
jbe 0x110133e94
mov rcx, rax
call sym.msvcrt.dll_free
mov rcx, qword [sym.msvcrt.dll__wenviron]
test r12w, r12w
jne 0x110133ef7
cmp qword [rsi], rbp
je 0x110133eb8
mov rcx, qword [rsi + 8]
inc ebx
mov qword [rsi], rcx
lea rsi, [rsi + 8]
test rcx, rcx
jne 0x110133e9f
mov rcx, qword [sym.msvcrt.dll__wenviron]
movsxd rdx, ebx
movabs rax, 0x1fffffffffffffff
cmp rdx, rax
jae 0x110133f62
mov r8d, 8
call fcn.11011a080
test rax, rax
je 0x110133f62
jmp 0x110133f5b
mov rcx, qword [sym.msvcrt.dll__wenviron]
sub rbx, rcx
sar rbx, 3
jmp 0x110133e56
mov qword [rsi], rdi
mov qword [r14], rbp
jmp 0x110133f62
test r12w, r12w
je 0x110134018
mov eax, ebx
cdq
mov r8d, eax
xor r8d, edx
sub r8d, edx
lea eax, [r8 + 2]
cmp eax, r8d
jl 0x110133d7e
movsxd rbx, r8d
movabs rax, 0x1fffffffffffffff
lea r8, [rbx + 2]
cmp r8, rax
jae 0x110133d7e
mov edx, 8
call fcn.11011a080
test rax, rax
je 0x110133d7e
mov qword [rax + rbx*8], rdi
mov qword [rax + rbx*8 + 8], rbp
mov qword [r14], rbp
mov qword [sym.msvcrt.dll__wenviron], rax
test r13d, r13d
je 0x110133ffe
or rcx, 0xffffffffffffffff
inc rcx
cmp word [rdi + rcx*2], bp
jne 0x110133f6f
mov esi, 2
add rcx, rsi
mov edx, esi
call fcn.110119eec
mov rbx, rax
test rax, rax
je 0x110133ffe
or rdx, 0xffffffffffffffff
inc rdx
cmp word [rdi + rdx*2], bp
jne 0x110133f93
add rdx, rsi
mov r8, rdi
mov rcx, rbx
call sym.msvcrt.dll_wcscpy_s
test eax, eax
je 0x110133fc2
xor r9d, r9d
mov qword [rsp + 0x20], rbp
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call fcn.11012bc8c
lea rcx, [rbx + r15*2]
movzx eax, r12w
mov word [rcx], bp
add rcx, rsi
neg ax
sbb rdx, rdx
and rdx, rcx
mov rcx, rbx
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetEnvironmentVariableW]
test eax, eax
jne 0x110133ff6
or dword [rsp + 0x60], 0xffffffff
call sym.msvcrt.dll__errno
mov dword [rax], 0x2a
mov rcx, rbx
call sym.msvcrt.dll_free
test r12w, r12w
jne 0x11013400f
mov rcx, rdi
call sym.msvcrt.dll_free
mov qword [r14], rbp
mov eax, dword [rsp + 0x60]
jmp 0x110133d81
mov rcx, rdi
call sym.msvcrt.dll_free
mov qword [r14], rbp
jmp 0x110133da4