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

Disassembly:
sub rsp, 0x308
mov rax, qword [0x010667f0]
xor rax, rsp
mov qword [rsp + 0x2f8], rax
mov qword [rsp + 0x280], 0
mov dword [rsp + 0x250], 0x104
mov dword [rsp + 0x25c], 0
mov qword [rsp + 0x278], 0
mov qword [rsp + 0x260], 0
mov qword [rsp + 0x268], 0
mov qword [rsp + 0x288], 0
mov dword [rsp + 0x258], 0
mov dword [rsp + 0x274], 0
mov dword [rsp + 0x254], 0x409
lea rax, [rsp + 0x280]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, [0x0100f150]
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov dword [rsp + 0x270], eax
cmp dword [rsp + 0x270], 0
je 0x105a36c
jmp 0x105aa5e
lea rax, [rsp + 0x250]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x40]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x0100eb98]
mov rcx, qword [rsp + 0x280]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov dword [rsp + 0x270], eax
cmp dword [rsp + 0x270], 0
je 0x105a3b4
jmp 0x105aa5e
lea rcx, [0x0100f130]
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
lea rdx, [0x0100f118]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x268], rax
lea rcx, [0x0100f130]
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
lea rdx, [0x0100f100]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x288], rax
cmp qword [rsp + 0x268], 0
je 0x105a414
cmp qword [rsp + 0x288], 0
jne 0x105a424
mov dword [rsp + 0x274], 1
jmp 0x105a639
xor edx, edx
xor ecx, ecx
call qword [rsp + 0x288]
mov dword [rsp + 0x25c], eax
mov eax, dword [rsp + 0x25c]
mov dword [rsp + 0x250], eax
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [rsp + 0x250]
lea eax, [rcx + rax + 2]
mov dword [rsp + 0x250], eax
cmp qword [rsp + 0x278], 0
je 0x105a501
mov qword [rsp + 0x290], 0
mov eax, dword [rsp + 0x250]
shl rax, 1
mov qword [rsp + 0x2c8], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, qword [rsp + 0x2c8]
mov r9, rcx
mov r8, qword [rsp + 0x278]
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
mov qword [rsp + 0x290], rax
cmp qword [rsp + 0x290], 0
jne 0x105a4ef
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x278]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsp + 0x278], 0
jmp 0x105a4ff
mov rax, qword [rsp + 0x290]
mov qword [rsp + 0x278], rax
jmp 0x105a53a
mov eax, dword [rsp + 0x250]
shl rax, 1
mov qword [rsp + 0x2d0], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, qword [rsp + 0x2d0]
mov r8, rcx
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x278], rax
cmp qword [rsp + 0x278], 0
je 0x105a562
mov rdx, qword [rsp + 0x278]
mov ecx, dword [rsp + 0x250]
call qword [rsp + 0x288]
mov dword [rsp + 0x25c], eax
cmp qword [rsp + 0x278], 0
je 0x105a581
mov eax, dword [rsp + 0x250]
cmp dword [rsp + 0x25c], eax
jae 0x105a424
cmp qword [rsp + 0x278], 0
je 0x105a59b
mov rax, qword [rsp + 0x278]
movzx eax, word [rax]
test eax, eax
jne 0x105a5c5
lea rcx, [rsp + 0x40]
call qword [rsp + 0x268]
mov dword [rsp + 0x258], eax
cmp dword [rsp + 0x258], 0
jne 0x105a5c3
mov dword [rsp + 0x274], 1
jmp 0x105a639
mov dword [rsp + 0x28], 0xffffffff
lea rax, [rsp + 0x40]
mov qword [rsp + 0x20], rax
mov r9d, 0xffffffff
mov r8, qword [rsp + 0x278]
mov edx, 1
mov ecx, dword [rsp + 0x254]
call qword [sym.imp.KERNEL32.dll_CompareStringW]
cmp eax, 2
je 0x105a62e
mov dword [rsp + 0x274], 1
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x278]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsp + 0x278], 0
jmp 0x105a639
mov dword [rsp + 0x258], 1
cmp dword [rsp + 0x274], 0
je 0x105aa5e
xor r8d, r8d
xor edx, edx
lea rcx, [0x0100f0f0]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov dword [rsp + 0x25c], eax
mov eax, dword [rsp + 0x25c]
mov dword [rsp + 0x250], eax
cmp dword [rsp + 0x250], 0
jne 0x105a696
lea rdx, [rsp + 0x40]
lea rcx, [0x0100f0f0]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov dword [rsp + 0x258], eax
jmp 0x105aa5e
mov dword [rsp + 0x2a8], 0
mov qword [rsp + 0x2a0], 0
mov dword [rsp + 0x298], 0
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 1
mov dword [rsp + 0x29c], eax
mov eax, dword [rsp + 0x25c]
mov dword [rsp + 0x250], eax
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [rsp + 0x250]
lea eax, [rcx + rax + 2]
mov dword [rsp + 0x250], eax
cmp qword [rsp + 0x278], 0
je 0x105a798
mov qword [rsp + 0x2b0], 0
mov eax, dword [rsp + 0x250]
shl rax, 1
mov qword [rsp + 0x2d8], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, qword [rsp + 0x2d8]
mov r9, rcx
mov r8, qword [rsp + 0x278]
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
mov qword [rsp + 0x2b0], rax
cmp qword [rsp + 0x2b0], 0
jne 0x105a786
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x278]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsp + 0x278], 0
jmp 0x105a796
mov rax, qword [rsp + 0x2b0]
mov qword [rsp + 0x278], rax
jmp 0x105a7d1
mov eax, dword [rsp + 0x250]
shl rax, 1
mov qword [rsp + 0x2e0], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, qword [rsp + 0x2e0]
mov r8, rcx
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x278], rax
cmp qword [rsp + 0x278], 0
je 0x105a800
mov r8d, dword [rsp + 0x250]
mov rdx, qword [rsp + 0x278]
lea rcx, [0x0100f0f0]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov dword [rsp + 0x25c], eax
cmp qword [rsp + 0x278], 0
je 0x105a81f
mov eax, dword [rsp + 0x250]
cmp dword [rsp + 0x25c], eax
jae 0x105a6cd
mov rax, qword [rsp + 0x278]
mov qword [rsp + 0x2a0], rax
mov eax, dword [rsp + 0x25c]
add eax, 1
mov dword [rsp + 0x298], eax
cmp dword [rsp + 0x2a8], 0
jne 0x105a97c
mov eax, dword [rsp + 0x29c]
cmp dword [rsp + 0x298], eax
jb 0x105a97c
mov dword [rsp + 0x2bc], 0
mov dword [rsp + 0x2b8], 0
mov word [rsp + 0x2c0], 0
mov eax, dword [rsp + 0x2bc]
mov rcx, qword [rsp + 0x2a0]
movzx eax, word [rcx + rax*2]
mov word [rsp + 0x2c0], ax
movzx eax, word [rsp + 0x2c0]
mov ecx, dword [rsp + 0x2bc]
movzx ecx, word [rsp + rcx*2 + 0x40]
cmp eax, ecx
jne 0x105a8c2
mov dword [rsp + 0x2e8], 1
jmp 0x105a8cd
mov dword [rsp + 0x2e8], 0
mov eax, dword [rsp + 0x2e8]
mov dword [rsp + 0x2b8], eax
cmp dword [rsp + 0x2b8], 0
je 0x105a910
mov eax, dword [rsp + 0x29c]
sub eax, 1
cmp dword [rsp + 0x2bc], eax
jne 0x105a8fa
jmp 0x105a910
mov eax, dword [rsp + 0x2bc]
add eax, 1
mov dword [rsp + 0x2bc], eax
jmp 0x105a882
cmp dword [rsp + 0x2b8], 0
je 0x105a927
mov dword [rsp + 0x2a8], 1
jmp 0x105a952
mov eax, dword [rsp + 0x29c]
sub eax, 1
cmp dword [rsp + 0x2bc], eax
jne 0x105a952
movzx eax, word [rsp + 0x2c0]
cmp eax, 0x3b
jne 0x105a952
mov dword [rsp + 0x2a8], 1
mov rax, qword [rsp + 0x2a0]
add rax, 2
mov qword [rsp + 0x2a0], rax
mov eax, dword [rsp + 0x298]
sub eax, 1
mov dword [rsp + 0x298], eax
jmp 0x105a840
cmp dword [rsp + 0x2a8], 0
je 0x105a996
mov dword [rsp + 0x258], 1
jmp 0x105aa5e
mov eax, dword [rsp + 0x250]
shl rax, 1
mov qword [rsp + 0x2f0], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, qword [rsp + 0x2f0]
mov r8, rcx
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x260], rax
cmp qword [rsp + 0x278], 0
je 0x105aa5e
cmp qword [rsp + 0x260], 0
je 0x105aa5e
mov eax, dword [rsp + 0x250]
lea r8, [rsp + 0x40]
mov rdx, rax
mov rcx, qword [rsp + 0x260]
call fcn.0105ab90
mov eax, dword [rsp + 0x250]
lea r8, [0x01007e58]
mov rdx, rax
mov rcx, qword [rsp + 0x260]
call fcn.01015bf0
mov eax, dword [rsp + 0x250]
mov r8, qword [rsp + 0x278]
mov rdx, rax
mov rcx, qword [rsp + 0x260]
call fcn.01015bf0
mov rdx, qword [rsp + 0x260]
lea rcx, [0x0100f0f0]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov dword [rsp + 0x258], eax
cmp qword [rsp + 0x278], 0
je 0x105aa8e
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x278]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsp + 0x278], 0
cmp qword [rsp + 0x260], 0
je 0x105aabe
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x260]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsp + 0x260], 0
cmp qword [rsp + 0x280], 0
je 0x105aad7
mov rcx, qword [rsp + 0x280]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [rsp + 0x258]
mov rcx, qword [rsp + 0x2f8]
xor rcx, rsp
call fcn.01059ab0
add rsp, 0x308
ret