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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x48ec1a
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
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 - 0x10], 0
mov esi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push 0x4be7b0
call esi
mov ebx, eax
test ebx, ebx
jne 0x46d9a7
lea eax, [ebp - 0x24]
push eax
push 0x4aa3b0
push reloc.WS2_32.dll_accept
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x46d917
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0x208
push eax
push 0x4be7b0
push ebx
push ebx
push 0x4aa3f4
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push 0x4aa404
push 0x104
push 0x4be7b0
call fcn.00474398
add esp, 0xc
jmp 0x46d92c
push 0x104
push 0x4be7b0
push str._ProgramFiles_Debugging_Tools_for_Windows__x86_dbghelp.dll
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0x4be7b0
call esi
mov ebx, eax
test ebx, ebx
jne 0x46d9a7
push 0x4aa49c
push 0x104
push 0x4be7b0
call fcn.00470605
add esp, 0xc
push 0x4be7b0
call esi
mov ebx, eax
test ebx, ebx
jne 0x46d9a7
push 0x4be7b0
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push 0x4aa4d0
push 0x104
push 0x4be7b0
call fcn.00474398
add esp, 0xc
push 0x4be7b0
call esi
mov ebx, eax
test ebx, ebx
jne 0x46d9a7
push 0x4aa4ec
call esi
mov ebx, eax
test ebx, ebx
jne 0x46d9a7
push 0x4aa504
call esi
mov ebx, eax
lea eax, [ebp - 0x14]
push 0x4aa520
push eax
call fcn.00435300
push 0x5c
push 0x4be7b0
mov dword [ebp - 4], 0
call fcn.00472b95
add esp, 0x10
test eax, eax
je 0x46da0a
sub eax, 0x4be7b0
sar eax, 1
mov ecx, eax
neg ecx
sbb ecx, ecx
add eax, eax
and ecx, 2
push ecx
push 0x490b00
push eax
push 0x4be7b0
call fcn.0046b7a0
mov edi, eax
add esp, 0x10
mov dword [ebp - 0x18], edi
mov esi, dword [ebp - 0x18]
mov byte [ebp - 4], 1
mov dword [ebp - 0x10], 1
jmp 0x46da38
push 0x4be7b0
call fcn.0046b670
push eax
push 0x4be7b0
call fcn.0046b800
mov esi, eax
add esp, 0xc
mov dword [ebp - 0x18], esi
mov edi, dword [ebp - 0x18]
mov dword [ebp - 4], 2
mov dword [ebp - 0x10], 2
lea ecx, [ebp - 0x18]
mov ecx, dword [ecx]
mov dword [ebp - 0x1c], ecx
test ecx, ecx
je 0x46da49
call fcn.0046b5c0
mov eax, dword [ebp - 0x10]
mov dword [ebp - 4], 4
test al, 2
je 0x46da6b
and eax, 0xfffffffd
mov dword [ebp - 0x10], eax
test esi, esi
je 0x46da6b
mov ecx, esi
call fcn.0046b840
mov eax, dword [ebp - 0x10]
mov byte [ebp - 4], 5
test al, 1
je 0x46da7e
test edi, edi
je 0x46da7e
mov ecx, edi
call fcn.0046b840
push 0x4a2e90
call fcn.0046b670
push eax
push 0x4a2e90
call fcn.0046b800
add esp, 0xc
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
mov byte [ebp - 4], 6
push eax
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp - 0x14]
call fcn.0046b3d0
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 7
push ecx
lea ecx, [ebp - 0x10]
push ecx
mov ecx, eax
call fcn.0046b3d0
mov esi, eax
mov ecx, dword [ebp - 0x14]
mov byte [ebp - 4], 8
test ecx, ecx
je 0x46dad2
call fcn.0046b840
mov ecx, dword [esi]
mov dword [ebp - 0x14], ecx
test ecx, ecx
je 0x46dae0
call fcn.0046b5c0
mov ecx, dword [ebp - 0x10]
mov byte [ebp - 4], 7
test ecx, ecx
je 0x46daf0
call fcn.0046b840
mov ecx, dword [ebp - 0x28]
mov byte [ebp - 4], 6
test ecx, ecx
je 0x46db00
call fcn.0046b840
mov ecx, dword [ebp - 0x18]
mov byte [ebp - 4], 5
test ecx, ecx
je 0x46db10
call fcn.0046b840
lea ecx, [ebp - 0x14]
call fcn.0046b310
push eax
push 0x4aa530
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, dword [ebp - 0x1c]
mov byte [ebp - 4], 0
test ecx, ecx
je 0x46db34
call fcn.0046b840
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], 0xffffffff
test ecx, ecx
je 0x46db47
call fcn.0046b840
push 0x104
push 0x4be7b0
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x4be7b0
call fcn.0046e4b0
mov eax, dword [0x4c36b4]
add esp, 4
mov dword [0x4c36e4], 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