Function at 0x140054510
Capabilities:
Query environment variable
Query or enumerate registry value
Set environment variable

Disassembly:
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0x4f0
mov rax, qword [0x1400e6470]
xor rax, rsp
mov qword [rsp + 0x4e0], rax
mov qword [rsp + 0x98], 0
xor eax, eax
mov word [rsp + 0xd0], ax
lea rax, [rsp + 0xd2]
mov rdi, rax
xor eax, eax
mov ecx, 0x208
rep stosb byte [rdi], al
mov qword [rsp + 0x58], 0
mov qword [rsp + 0x60], 0
mov qword [rsp + 0x70], 0
mov dword [rsp + 0x78], 0x100
mov dword [rsp + 0x6c], 0
mov dword [rsp + 0x4c], 0
mov dword [rsp + 0x44], 0
mov rdx, qword [rsp + 0x500]
lea rcx, str.USERPROFILE
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetEnvironmentVariableW]
mov eax, 2
imul rax, rax, 0
mov rcx, qword [rsp + 0x500]
movzx eax, word [rcx + rax]
test eax, eax
je 0x14005465e
mov eax, 2
imul rax, rax, 1
mov rcx, qword [rsp + 0x500]
movzx eax, word [rcx + rax]
cmp eax, 0x3a
jne 0x14005465e
mov rax, qword [rsp + 0x500]
add rax, 4
mov rdx, rax
lea rcx, [0x1400deed8]
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetEnvironmentVariableW]
mov eax, 2
imul rax, rax, 2
mov rcx, qword [rsp + 0x500]
movzx eax, word [rcx + rax]
mov word [rsp + 0x68], ax
mov eax, 2
imul rax, rax, 2
xor ecx, ecx
mov rdx, qword [rsp + 0x500]
mov word [rdx + rax], cx
mov rdx, qword [rsp + 0x500]
lea rcx, str.HOMEDRIVE
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetEnvironmentVariableW]
mov eax, 2
imul rax, rax, 2
mov rcx, qword [rsp + 0x500]
movzx edx, word [rsp + 0x68]
mov word [rcx + rax], dx
jmp 0x140054673
mov rdx, qword [rsp + 0x500]
lea rcx, str.HOMEPATH
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetEnvironmentVariableW]
mov r9, qword [rsp + 0x500]
lea r8, str._sAppDataLocal
mov edx, 0x105
lea rcx, [rsp + 0xd0]
call fcn.140054bc0
lea rdx, [rsp + 0xd0]
lea rcx, str.LOCALAPPDATA
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetEnvironmentVariableW]
mov r9, qword [rsp + 0x500]
lea r8, str._sAppDataRoaming
mov edx, 0x105
lea rcx, [rsp + 0xd0]
call fcn.140054bc0
lea rdx, [rsp + 0xd0]
lea rcx, str.APPDATA
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetEnvironmentVariableW]
lea rax, [rsp + 0x98]
mov qword [rsp + 0x20], rax
mov r9d, 1
xor r8d, r8d
lea rdx, str.Environment
mov rcx, 0xffffffff80000001
call qword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
mov dword [rsp + 0x48], eax
cmp dword [rsp + 0x48], 0
je 0x14005471e
jmp 0x140054aae
xor eax, eax
cmp eax, 1
je 0x140054a5f
mov qword [rsp + 0x50], 0
mov eax, dword [rsp + 0x6c]
shl rax, 1
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x78], 0x100
mov eax, dword [rsp + 0x44]
mov dword [rsp + 0xa0], eax
lea rax, [rsp + 0x40]
mov qword [rsp + 0x38], rax
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x7c]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x78]
lea r8, [rsp + 0x2e0]
mov edx, dword [rsp + 0xa0]
mov rcx, qword [rsp + 0x98]
call qword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegEnumValueW]
mov dword [rsp + 0x48], eax
mov eax, dword [rsp + 0x44]
inc eax
mov dword [rsp + 0x44], eax
cmp dword [rsp + 0x48], 0x103
jne 0x1400547b8
jmp 0x140054a5f
cmp dword [rsp + 0x48], 0xea
je 0x1400547ce
mov eax, dword [rsp + 0x6c]
shl eax, 1
cmp dword [rsp + 0x40], eax
jbe 0x140054812
cmp qword [rsp + 0x58], 0
je 0x1400547e0
mov rcx, qword [rsp + 0x58]
call fcn.140077f70
mov eax, dword [rsp + 0x40]
mov ecx, eax
call fcn.14000b820
mov qword [rsp + 0x58], rax
xor edx, edx
mov eax, dword [rsp + 0x40]
mov ecx, 2
div ecx
mov dword [rsp + 0x6c], eax
mov eax, dword [rsp + 0x44]
dec eax
mov dword [rsp + 0x44], eax
jmp 0x14005471e
cmp dword [rsp + 0x48], 0
je 0x14005481e
jmp 0x140054a5f
cmp dword [rsp + 0x7c], 1
jne 0x140054831
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x50], rax
jmp 0x1400548a8
cmp dword [rsp + 0x7c], 2
jne 0x1400548a8
mov r8d, dword [rsp + 0x4c]
mov rdx, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_ExpandEnvironmentStringsW]
mov dword [rsp + 0x40], eax
mov eax, dword [rsp + 0x4c]
cmp dword [rsp + 0x40], eax
jbe 0x14005489e
cmp qword [rsp + 0x60], 0
je 0x14005486d
mov rcx, qword [rsp + 0x60]
call fcn.140077f70
mov eax, dword [rsp + 0x40]
shl eax, 1
mov eax, eax
mov ecx, eax
call fcn.14000b820
mov qword [rsp + 0x60], rax
mov eax, dword [rsp + 0x40]
mov dword [rsp + 0x4c], eax
mov r8d, dword [rsp + 0x4c]
mov rdx, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_ExpandEnvironmentStringsW]
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x50], rax
lea rdx, [0x1400deff0]
lea rcx, [rsp + 0x2e0]
call fcn.140084c64
test eax, eax
jne 0x140054a3f
xor r8d, r8d
xor edx, edx
lea rcx, [0x1400df008]
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetEnvironmentVariableW]
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0
je 0x140054a3f
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0xa8], rax
mov qword [rsp + 0x80], 0xffffffffffffffff
inc qword [rsp + 0x80]
mov rax, qword [rsp + 0xa8]
mov rcx, qword [rsp + 0x80]
cmp word [rax + rcx*2], 0
jne 0x1400548fe
mov rax, qword [rsp + 0x80]
mov ecx, dword [rsp + 0x40]
lea rax, [rax + rcx + 1]
shl rax, 1
mov rcx, rax
call fcn.14000b820
mov qword [rsp + 0x70], rax
mov r8d, dword [rsp + 0x40]
mov rdx, qword [rsp + 0x70]
lea rcx, [0x1400df018]
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetEnvironmentVariableW]
mov eax, dword [rsp + 0x40]
dec eax
mov eax, eax
mov ecx, 0x3b
mov rdx, qword [rsp + 0x70]
mov word [rdx + rax*2], cx
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0xb0], rax
mov qword [rsp + 0x88], 0xffffffffffffffff
inc qword [rsp + 0x88]
mov rax, qword [rsp + 0xb0]
mov rcx, qword [rsp + 0x88]
cmp word [rax + rcx*2], 0
jne 0x140054984
mov rax, qword [rsp + 0x88]
lea rax, [rax + rax + 2]
mov rcx, qword [rsp + 0x50]
mov qword [rsp + 0xb8], rcx
mov qword [rsp + 0x90], 0xffffffffffffffff
inc qword [rsp + 0x90]
mov rcx, qword [rsp + 0xb8]
mov rdx, qword [rsp + 0x90]
cmp word [rcx + rdx*2], 0
jne 0x1400549c9
mov rcx, qword [rsp + 0x90]
lea rcx, [rcx + rcx + 2]
mov edx, dword [rsp + 0x40]
mov rdi, qword [rsp + 0x70]
lea rdx, [rdi + rdx*2]
mov qword [rsp + 0xc0], rdx
mov r9, rax
mov r8, qword [rsp + 0x50]
mov rdx, rcx
mov rax, qword [rsp + 0xc0]
mov rcx, rax
call fcn.1400738f0
test eax, eax
je 0x140054a2b
jmp 0x140054a5f
xor eax, eax
test eax, eax
jne 0x14005496b
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x50], rax
cmp qword [rsp + 0x50], 0
je 0x140054a5a
mov rdx, qword [rsp + 0x50]
lea rcx, [rsp + 0x2e0]
call qword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetEnvironmentVariableW]
jmp 0x14005471e
cmp qword [rsp + 0x98], 0
je 0x140054a78
mov rcx, qword [rsp + 0x98]
call qword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
cmp qword [rsp + 0x58], 0
je 0x140054a8a
mov rcx, qword [rsp + 0x58]
call fcn.140077f70
cmp qword [rsp + 0x60], 0
je 0x140054a9c
mov rcx, qword [rsp + 0x60]
call fcn.140077f70
cmp qword [rsp + 0x70], 0
je 0x140054aae
mov rcx, qword [rsp + 0x70]
call fcn.140077f70
mov rcx, qword [rsp + 0x4e0]
xor rcx, rsp
call fcn.140075860
add rsp, 0x4f0
pop rdi
ret