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

Disassembly:
sub rsp, 0x308
mov rax, qword [0x010657f0]
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, [0x0100eed0]
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov dword [rsp + 0x270], eax
cmp dword [rsp + 0x270], 0
je 0x10594ac
jmp 0x1059b7f
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, [0x0100e918]
mov rcx, qword [rsp + 0x280]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov dword [rsp + 0x270], eax
cmp dword [rsp + 0x270], 0
je 0x10594f4
jmp 0x1059b7f
lea rcx, [0x0100eeb0]
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
lea rdx, [0x0100ee98]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x268], rax
lea rcx, [0x0100eeb0]
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
lea rdx, [0x0100ee80]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x288], rax
cmp qword [rsp + 0x268], 0
je 0x1059554
cmp qword [rsp + 0x288], 0
jne 0x1059564
mov dword [rsp + 0x274], 1
jmp 0x1059779
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 0x1059641
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 0x105962f
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 0x105963f
mov rax, qword [rsp + 0x290]
mov qword [rsp + 0x278], rax
jmp 0x105967a
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 0x10596a2
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 0x10596c1
mov eax, dword [rsp + 0x250]
cmp dword [rsp + 0x25c], eax
jae 0x1059564
cmp qword [rsp + 0x278], 0
je 0x10596db
mov rax, qword [rsp + 0x278]
movzx eax, word [rax]
test eax, eax
jne 0x1059705
lea rcx, [rsp + 0x40]
call qword [rsp + 0x268]
mov dword [rsp + 0x258], eax
cmp dword [rsp + 0x258], 0
jne 0x1059703
mov dword [rsp + 0x274], 1
jmp 0x1059779
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 0x105976e
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 0x1059779
mov dword [rsp + 0x258], 1
cmp dword [rsp + 0x274], 0
je 0x1059b7f
xor r8d, r8d
xor edx, edx
lea rcx, [0x0100ee70]
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 0x10597d6
lea rdx, [rsp + 0x40]
lea rcx, [0x0100ee70]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov dword [rsp + 0x258], eax
jmp 0x1059b7f
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 0x10598d8
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 0x10598c6
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 0x10598d6
mov rax, qword [rsp + 0x2b0]
mov qword [rsp + 0x278], rax
jmp 0x1059911
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 0x1059940
mov r8d, dword [rsp + 0x250]
mov rdx, qword [rsp + 0x278]
lea rcx, [0x0100ee70]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov dword [rsp + 0x25c], eax
cmp qword [rsp + 0x278], 0
je 0x105995f
mov eax, dword [rsp + 0x250]
cmp dword [rsp + 0x25c], eax
jae 0x105980d
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 0x1059abc
mov eax, dword [rsp + 0x29c]
cmp dword [rsp + 0x298], eax
jb 0x1059abc
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 0x1059a02
mov dword [rsp + 0x2e8], 1
jmp 0x1059a0d
mov dword [rsp + 0x2e8], 0
mov eax, dword [rsp + 0x2e8]
mov dword [rsp + 0x2b8], eax
cmp dword [rsp + 0x2b8], 0
je 0x1059a50
mov eax, dword [rsp + 0x29c]
sub eax, 1
cmp dword [rsp + 0x2bc], eax
jne 0x1059a3a
jmp 0x1059a50
mov eax, dword [rsp + 0x2bc]
add eax, 1
mov dword [rsp + 0x2bc], eax
jmp 0x10599c2
cmp dword [rsp + 0x2b8], 0
je 0x1059a67
mov dword [rsp + 0x2a8], 1
jmp 0x1059a92
mov eax, dword [rsp + 0x29c]
sub eax, 1
cmp dword [rsp + 0x2bc], eax
jne 0x1059a92
movzx eax, word [rsp + 0x2c0]
cmp eax, 0x3b
jne 0x1059a92
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 0x1059980
cmp dword [rsp + 0x2a8], 0
je 0x1059ad6
mov dword [rsp + 0x258], 1
jmp 0x1059b7f
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 0x1059b7f
cmp qword [rsp + 0x260], 0
je 0x1059b7f
lea rdx, [rsp + 0x40]
mov rcx, qword [rsp + 0x260]
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
lea rdx, [0x01007bc8]
mov rcx, qword [rsp + 0x260]
call qword [sym.imp.KERNEL32.dll_lstrcatW]
mov rdx, qword [rsp + 0x278]
mov rcx, qword [rsp + 0x260]
call qword [sym.imp.KERNEL32.dll_lstrcatW]
mov rdx, qword [rsp + 0x260]
lea rcx, [0x0100ee70]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov dword [rsp + 0x258], eax
cmp qword [rsp + 0x278], 0
je 0x1059baf
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 0x1059bdf
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 0x1059bf8
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.010588f0
add rsp, 0x308
ret