Function at 0x46af00
Capabilities:
Get common file path
Query environment variable
Query or enumerate registry value
Set environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x48aada
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x4b31cc]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x14], 0
mov esi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push 0x4b5868
call esi
mov edi, eax
test edi, edi
jne 0x46b027
lea eax, [ebp - 0x24]
push eax
push 0x4a1b10
push reloc.WS2_32.dll_accept
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x46af97
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0x208
push eax
push 0x4b5868
push edi
push edi
push 0x4a1b54
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push 0x4a1b64
push 0x104
push 0x4b5868
call fcn.00470e68
add esp, 0xc
jmp 0x46afac
push 0x104
push 0x4b5868
push str._ProgramFiles_Debugging_Tools_for_Windows__x86_dbghelp.dll
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0x4b5868
call esi
mov edi, eax
test edi, edi
jne 0x46b027
push 0x4a1bfc
push 0x104
push 0x4b5868
call fcn.0046d74c
add esp, 0xc
push 0x4b5868
call esi
mov edi, eax
test edi, edi
jne 0x46b027
push 0x4b5868
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push 0x4a1c30
push 0x104
push 0x4b5868
call fcn.00470e68
add esp, 0xc
push 0x4b5868
call esi
mov edi, eax
test edi, edi
jne 0x46b027
push 0x4a1c4c
call esi
mov edi, eax
test edi, edi
jne 0x46b027
push 0x4a1c64
call esi
mov edi, eax
lea eax, [ebp - 0x10]
push 0x4a1c80
push eax
call fcn.00433a80
push 0x5c
push 0x4b5868
mov dword [ebp - 4], 0
call fcn.0046f665
add esp, 0x10
test eax, eax
je 0x46b076
sub eax, 0x4b5868
sar eax, 1
push eax
lea eax, [ebp - 0x28]
push 0x4b5868
push eax
call fcn.00433af0
add esp, 0xc
mov esi, dword [ebp - 0x18]
mov ebx, 1
mov byte [ebp - 4], 1
jmp 0x46b0a2
push 0x4b5868
call fcn.00468d70
push eax
push 0x4b5868
call fcn.00468f00
mov esi, eax
add esp, 0xc
mov dword [ebp - 0x18], esi
lea eax, [ebp - 0x18]
mov dword [ebp - 4], 2
mov ebx, 2
mov ecx, dword [eax]
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x1c], ecx
test ecx, ecx
je 0x46b0b3
call fcn.00468c60
mov dword [ebp - 4], 4
test bl, 2
je 0x46b0d0
and ebx, 0xfffffffd
mov dword [ebp - 0x14], ebx
test esi, esi
je 0x46b0d0
mov ecx, esi
call fcn.00468f40
mov byte [ebp - 4], 5
test bl, 1
je 0x46b0e5
mov ecx, dword [ebp - 0x28]
test ecx, ecx
je 0x46b0e5
call fcn.00468f40
push 0x49a8fc
call fcn.00468d70
push eax
push 0x49a8fc
call fcn.00468f00
add esp, 0xc
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
mov byte [ebp - 4], 6
push eax
lea eax, [ebp - 0x2c]
push eax
lea ecx, [ebp - 0x10]
call fcn.00468a70
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 7
push ecx
lea ecx, [ebp - 0x14]
push ecx
mov ecx, eax
call fcn.00468a70
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 8
call fcn.004688f0
mov ecx, dword [ebp - 0x14]
mov byte [ebp - 4], 7
test ecx, ecx
je 0x46b144
call fcn.00468f40
mov ecx, dword [ebp - 0x2c]
mov byte [ebp - 4], 6
test ecx, ecx
je 0x46b154
call fcn.00468f40
mov ecx, dword [ebp - 0x18]
mov byte [ebp - 4], 5
test ecx, ecx
je 0x46b164
call fcn.00468f40
lea ecx, [ebp - 0x10]
call fcn.004689b0
push eax
push 0x4a1c90
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, dword [ebp - 0x1c]
mov byte [ebp - 4], 0
test ecx, ecx
je 0x46b188
call fcn.00468f40
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 4], 0xffffffff
test ecx, ecx
je 0x46b19b
call fcn.00468f40
push 0x104
push 0x4b5868
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x4b5868
call fcn.0046bb00
mov eax, dword [0x4ba768]
add esp, 4
mov dword [0x4ba798], eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret