Function at 0x18004c248
Capabilities:
Query environment variable
Set environment variable

Disassembly:
mov rax, rsp
push r13
sub rsp, 0x2b0
mov qword [rsp + 0x58], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], r12
mov rax, qword [0x1800ba600]
xor rax, rsp
mov qword [rsp + 0x2a0], rax
mov r12, rcx
mov qword [rsp + 0x50], rcx
mov rbx, qword [0x1800bd5a0]
test rbx, rbx
je 0x18004c2a8
cmp qword [rbx + 8], 0
jne 0x18004c2a2
mov rcx, qword [rbx]
call fcn.18007d5b0
mov qword [rbx + 8], rax
mov rcx, qword [rbx + 8]
jmp 0x18004c2aa
xor ecx, ecx
mov r13d, 0x104
mov r8d, r13d
lea rdx, [rsp + 0x190]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x18004c5b8
and dword [rsp + 0x30], 0
and qword [rsp + 0x38], 0
mov qword [rsp + 0x180], SafeArrayUnaccessData
and qword [rsp + 0x178], 0
mov byte [rsp + 0x168], 0
lea rcx, [rsp + 0x190]
call fcn.180064df0
mov r8, rax
lea rdx, [rsp + 0x190]
lea rcx, [rsp + 0x160]
call fcn.180005ecc
lea rcx, [0x180094694]
call fcn.180064df0
mov r9, rax
xor r8d, r8d
lea rdx, [0x180094694]
lea rcx, [rsp + 0x160]
call fcn.18000e3d8
mov rbx, rax
lea rcx, [0x180094690]
call fcn.180064df0
mov qword [rsp + 0x20], rax
lea r9, [0x180094690]
mov r8d, 1
mov rdx, rbx
lea rcx, [rsp + 0x160]
call fcn.180047a28
mov edx, 3
lea r8d, [rdx - 2]
lea rcx, [rsp + 0x60]
call fcn.18004b84c
nop
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
and dword [rsp + rcx + 0x88], 0xfffff9ff
bts dword [rsp + rcx + 0x88], 0xb
lea rdx, [rsp + 0x160]
lea rcx, [rsp + 0x70]
call fcn.18004b1c4
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x60]
call fcn.18004b6f0
lea rdx, [rsp + 0x30]
lea rcx, [rsp + 0x60]
call fcn.18004b54c
mov rsi, qword [rsp + 0x38]
mov eax, dword [rsp + 0x30]
sub eax, 1
mov dword [rsp + 0x30], eax
jne 0x18004c4ef
test rsi, rsi
je 0x18004c427
mov rbx, qword [r12]
test rbx, rbx
je 0x18004c40b
cmp qword [rbx + 8], 0
jne 0x18004c405
mov rcx, qword [rbx]
call fcn.18007d5b0
mov qword [rbx + 8], rax
mov rdx, qword [rbx + 8]
jmp 0x18004c40d
xor edx, edx
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + 0x20]
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + 0x38]
mov rcx, rsi
call fcn.18006419c
mov rbx, qword [0x1800bd5a0]
test rbx, rbx
je 0x18004c44c
cmp qword [rbx + 8], 0
jne 0x18004c446
mov rcx, qword [rbx]
call fcn.18007d5b0
mov qword [rbx + 8], rax
mov rcx, qword [rbx + 8]
jmp 0x18004c44e
xor ecx, ecx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
mov r13, qword [0x1800bd590]
mov rsi, qword [r13]
mov qword [rsp + 0x48], rsi
mov rax, qword [0x1800bd560]
mov rbx, rax
mov qword [rsp + 0x40], rax
test rbx, rbx
je 0x18004c47f
cmp rbx, rax
je 0x18004c484
call fcn.180065948
cmp rsi, r13
je 0x18004c4de
test rbx, rbx
jne 0x18004c498
call fcn.180065948
xor r11d, r11d
jmp 0x18004c49b
mov r11, qword [rbx]
cmp rsi, qword [r11 + 0x30]
jne 0x18004c4a6
call fcn.180065948
mov rcx, qword [rsi + 0x20]
test rcx, rcx
je 0x18004c4ba
mov rax, qword [rcx]
call qword [rax + 0x10]
and qword [rsi + 0x20], 0
lea rcx, [rsp + 0x40]
call fcn.180045ff0
mov rsi, qword [rsp + 0x48]
mov rbx, qword [rsp + 0x40]
mov r13, qword [0x1800bd590]
mov rax, qword [0x1800bd560]
jmp 0x18004c475
lea rcx, [0x1800bd560]
call fcn.180047da4
jmp 0x18004c575
mov dword [rsp + 0x20], eax
mov r9, rsi
lea r8, str._lp__d
mov rdx, r13
lea rcx, [rsp + 0x190]
call fcn.18000d8e4
mov rbx, qword [0x1800bd5a0]
test rbx, rbx
je 0x18004c532
cmp qword [rbx + 8], 0
jne 0x18004c52c
mov rcx, qword [rbx]
call fcn.18007d5b0
mov qword [rbx + 8], rax
mov rcx, qword [rbx + 8]
jmp 0x18004c534
xor ecx, ecx
lea rdx, [rsp + 0x190]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
test rsi, rsi
je 0x18004c575
mov rbx, qword [r12]
test rbx, rbx
je 0x18004c569
cmp qword [rbx + 8], 0
jne 0x18004c563
mov rcx, qword [rbx]
call fcn.18007d5b0
mov qword [rbx + 8], rax
mov rdx, qword [rbx + 8]
jmp 0x18004c56b
xor edx, edx
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + 0x20]
nop
lea rcx, [rsp + 0xf8]
call fcn.1800469c0
lea rax, vtable.std::ios_base.0
mov qword [rsp + 0xf8], rax
lea rcx, [rsp + 0xf8]
call fcn.18007e11c
nop
cmp qword [rsp + 0x180], 0x10
jb 0x18004c5b8
mov rcx, qword [rsp + 0x168]
call fcn.18006419c
nop
jmp 0x18004c5bf
mov rbx, qword [r12]
test rbx, rbx
je 0x18004c604
or eax, 0xffffffff
lock xadd dword [rbx + 0x10], eax
add eax, 0xffffffff
jne 0x18004c5ff
test rbx, rbx
je 0x18004c5ff
cmp qword [rbx], 0
je 0x18004c5e9
mov rcx, qword [rbx]
call qword [sym.imp.OLEAUT32.dll_SysStringLen]
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x18004c5f7
call fcn.180064200
mov rcx, rbx
call fcn.18006419c
and qword [r12], 0
mov al, 1
mov rcx, qword [rsp + 0x2a0]
xor rcx, rsp
call fcn.180064d20
lea r11, [rsp + 0x2b0]
mov rbx, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x20]
mov r12, qword [r11 + 0x28]
mov rsp, r11
pop r13
ret