Function at 0x46c800
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 0x48d65a
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x4bc1dc]
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 0x4be8b0
call esi
mov edi, eax
test edi, edi
jne 0x46c927
lea eax, [ebp - 0x24]
push eax
push 0x4a9e00
push reloc.WS2_32.dll_accept
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x46c897
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0x208
push eax
push 0x4be8b0
push edi
push edi
push 0x4a9e44
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push 0x4a9e54
push 0x104
push 0x4be8b0
call fcn.00472de8
add esp, 0xc
jmp 0x46c8ac
push 0x104
push 0x4be8b0
push str._ProgramFiles_Debugging_Tools_for_Windows__x86_dbghelp.dll
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0x4be8b0
call esi
mov edi, eax
test edi, edi
jne 0x46c927
push 0x4a9eec
push 0x104
push 0x4be8b0
call fcn.0046f05c
add esp, 0xc
push 0x4be8b0
call esi
mov edi, eax
test edi, edi
jne 0x46c927
push 0x4be8b0
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push 0x4a9f20
push 0x104
push 0x4be8b0
call fcn.00472de8
add esp, 0xc
push 0x4be8b0
call esi
mov edi, eax
test edi, edi
jne 0x46c927
push 0x4a9f3c
call esi
mov edi, eax
test edi, edi
jne 0x46c927
push 0x4a9f54
call esi
mov edi, eax
lea eax, [ebp - 0x10]
push 0x4a9f70
push eax
call fcn.00434a30
push 0x5c
push 0x4be8b0
mov dword [ebp - 4], 0
call fcn.004715e5
add esp, 0x10
test eax, eax
je 0x46c976
sub eax, 0x4be8b0
sar eax, 1
push eax
lea eax, [ebp - 0x28]
push 0x4be8b0
push eax
call fcn.00434aa0
add esp, 0xc
mov esi, dword [ebp - 0x18]
mov ebx, 1
mov byte [ebp - 4], 1
jmp 0x46c9a2
push 0x4be8b0
call fcn.0046a680
push eax
push 0x4be8b0
call fcn.0046a810
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 0x46c9b3
call fcn.0046a570
mov dword [ebp - 4], 4
test bl, 2
je 0x46c9d0
and ebx, 0xfffffffd
mov dword [ebp - 0x14], ebx
test esi, esi
je 0x46c9d0
mov ecx, esi
call fcn.0046a850
mov byte [ebp - 4], 5
test bl, 1
je 0x46c9e5
mov ecx, dword [ebp - 0x28]
test ecx, ecx
je 0x46c9e5
call fcn.0046a850
push 0x4a296c
call fcn.0046a680
push eax
push 0x4a296c
call fcn.0046a810
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.0046a380
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 7
push ecx
lea ecx, [ebp - 0x14]
push ecx
mov ecx, eax
call fcn.0046a380
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 8
call fcn.0046a200
mov ecx, dword [ebp - 0x14]
mov byte [ebp - 4], 7
test ecx, ecx
je 0x46ca44
call fcn.0046a850
mov ecx, dword [ebp - 0x2c]
mov byte [ebp - 4], 6
test ecx, ecx
je 0x46ca54
call fcn.0046a850
mov ecx, dword [ebp - 0x18]
mov byte [ebp - 4], 5
test ecx, ecx
je 0x46ca64
call fcn.0046a850
lea ecx, [ebp - 0x10]
call fcn.0046a2c0
push eax
push 0x4a9f80
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, dword [ebp - 0x1c]
mov byte [ebp - 4], 0
test ecx, ecx
je 0x46ca88
call fcn.0046a850
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 4], 0xffffffff
test ecx, ecx
je 0x46ca9b
call fcn.0046a850
push 0x104
push 0x4be8b0
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x4be8b0
call fcn.0046d400
mov eax, dword [0x4c37b0]
add esp, 4
mov dword [0x4c37e0], 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