Function at 0x4a22e0
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 0x4d8dcf
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x517ba0]
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 0x517678
call esi
mov ebx, eax
test ebx, ebx
jne 0x4a2407
lea eax, [ebp - 0x20]
push eax
push 0x4f6d98
push reloc.WS2_32.dll_accept
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x4a2377
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0x208
push eax
push 0x517678
push ebx
push ebx
push 0x4f6ddc
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push 0x4f6dec
push 0x104
push 0x517678
call fcn.004b8a72
add esp, 0xc
jmp 0x4a238c
push 0x104
push 0x517678
push str._ProgramFiles_Debugging_Tools_for_Windows__x86_dbghelp.dll
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0x517678
call esi
mov ebx, eax
test ebx, ebx
jne 0x4a2407
push 0x4f6e84
push 0x104
push 0x517678
call fcn.004b7f10
add esp, 0xc
push 0x517678
call esi
mov ebx, eax
test ebx, ebx
jne 0x4a2407
push 0x517678
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push 0x4f6eb8
push 0x104
push 0x517678
call fcn.004b8a72
add esp, 0xc
push 0x517678
call esi
mov ebx, eax
test ebx, ebx
jne 0x4a2407
push 0x4e2170
call esi
mov ebx, eax
test ebx, ebx
jne 0x4a2407
push 0x4f6ed4
call esi
mov ebx, eax
lea eax, [ebp - 0x14]
push 0x4f6ef0
push eax
call fcn.00465be0
push 0x5c
push 0x517678
mov dword [ebp - 4], 0
call fcn.004a861e
add esp, 0x10
test eax, eax
je 0x4a246c
sub eax, 0x517678
sar eax, 1
mov ecx, eax
neg ecx
sbb ecx, ecx
add eax, eax
and ecx, 2
push ecx
push 0x4e1a9c
push eax
push 0x517678
call fcn.0049fd00
mov edi, eax
add esp, 0x10
mov dword [ebp - 0x24], edi
mov esi, dword [ebp - 0x24]
mov ecx, edi
mov byte [ebp - 4], 1
mov dword [ebp - 0x10], 1
jmp 0x4a249c
push 0x517678
call fcn.0049fbd0
push eax
push 0x517678
call fcn.0049fd60
mov esi, eax
add esp, 0xc
mov dword [ebp - 0x24], esi
mov edi, dword [ebp - 0x24]
mov ecx, esi
mov dword [ebp - 4], 2
mov dword [ebp - 0x10], 2
mov dword [ebp - 0x18], ecx
test ecx, ecx
je 0x4a24a8
call fcn.0049fad0
mov dword [ebp - 4], 3
mov eax, dword [ebp - 0x10]
test al, 2
je 0x4a24ce
and eax, 0xfffffffd
mov dword [ebp - 0x10], eax
mov byte [ebp - 4], 5
test esi, esi
je 0x4a24ce
mov ecx, esi
call fcn.0049fda0
mov eax, dword [ebp - 0x10]
mov byte [ebp - 4], 6
test al, 1
je 0x4a24e9
mov byte [ebp - 4], 7
test edi, edi
je 0x4a24e5
mov ecx, edi
call fcn.0049fda0
mov byte [ebp - 4], 6
push 0x4f0d9c
call fcn.0049fbd0
push eax
push 0x4f0d9c
call fcn.0049fd60
add esp, 0xc
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x10]
mov byte [ebp - 4], 8
push eax
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp - 0x14]
call fcn.0049f8a0
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 9
push ecx
lea ecx, [ebp - 0x24]
push ecx
mov ecx, eax
call fcn.0049f8a0
mov esi, eax
mov ecx, dword [ebp - 0x14]
mov byte [ebp - 4], 0xa
test ecx, ecx
je 0x4a253d
call fcn.0049fda0
mov ecx, dword [esi]
mov dword [ebp - 0x14], ecx
test ecx, ecx
je 0x4a254b
call fcn.0049fad0
mov ecx, dword [ebp - 0x24]
mov byte [ebp - 4], 0xb
test ecx, ecx
je 0x4a255b
call fcn.0049fda0
mov ecx, dword [ebp - 0x28]
mov byte [ebp - 4], 0xc
test ecx, ecx
je 0x4a256b
call fcn.0049fda0
mov ecx, dword [ebp - 0x10]
mov byte [ebp - 4], 0xd
test ecx, ecx
je 0x4a257b
call fcn.0049fda0
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 6
call fcn.0049f770
push eax
push 0x4f6f00
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, dword [ebp - 0x18]
mov byte [ebp - 4], 0xe
test ecx, ecx
je 0x4a25a3
call fcn.0049fda0
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], 0xf
test ecx, ecx
je 0x4a25b6
call fcn.0049fda0
push 0x104
push 0x517678
push ebx
mov dword [ebp - 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x517678
call fcn.004a31b0
mov eax, dword [0x51d4ec]
add esp, 4
mov dword [0x51d51c], 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