Function at 0x49ec40
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 0x4d4e6f
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x513b94]
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 0x513670
call esi
mov ebx, eax
test ebx, ebx
jne 0x49ed67
lea eax, [ebp - 0x20]
push eax
push 0x4f2d78
push reloc.WS2_32.dll_accept
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x49ecd7
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0x208
push eax
push 0x513670
push ebx
push ebx
push 0x4f2dbc
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push 0x4f2dcc
push 0x104
push 0x513670
call fcn.004b5462
add esp, 0xc
jmp 0x49ecec
push 0x104
push 0x513670
push str._ProgramFiles_Debugging_Tools_for_Windows__x86_dbghelp.dll
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0x513670
call esi
mov ebx, eax
test ebx, ebx
jne 0x49ed67
push 0x4f2e64
push 0x104
push 0x513670
call fcn.004b4900
add esp, 0xc
push 0x513670
call esi
mov ebx, eax
test ebx, ebx
jne 0x49ed67
push 0x513670
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push 0x4f2e98
push 0x104
push 0x513670
call fcn.004b5462
add esp, 0xc
push 0x513670
call esi
mov ebx, eax
test ebx, ebx
jne 0x49ed67
push 0x4dde70
call esi
mov ebx, eax
test ebx, ebx
jne 0x49ed67
push 0x4f2eb4
call esi
mov ebx, eax
lea eax, [ebp - 0x14]
push 0x4f2ed0
push eax
call fcn.004631b0
push 0x5c
push 0x513670
mov dword [ebp - 4], 0
call fcn.004a500e
add esp, 0x10
test eax, eax
je 0x49edcc
sub eax, 0x513670
sar eax, 1
mov ecx, eax
neg ecx
sbb ecx, ecx
add eax, eax
and ecx, 2
push ecx
push 0x4dd79c
push eax
push 0x513670
call fcn.0049c6b0
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 0x49edfc
push 0x513670
call fcn.0049c580
push eax
push 0x513670
call fcn.0049c710
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 0x49ee08
call fcn.0049c480
mov dword [ebp - 4], 3
mov eax, dword [ebp - 0x10]
test al, 2
je 0x49ee2e
and eax, 0xfffffffd
mov dword [ebp - 0x10], eax
mov byte [ebp - 4], 5
test esi, esi
je 0x49ee2e
mov ecx, esi
call fcn.0049c750
mov eax, dword [ebp - 0x10]
mov byte [ebp - 4], 6
test al, 1
je 0x49ee49
mov byte [ebp - 4], 7
test edi, edi
je 0x49ee45
mov ecx, edi
call fcn.0049c750
mov byte [ebp - 4], 6
push 0x4ecdb4
call fcn.0049c580
push eax
push 0x4ecdb4
call fcn.0049c710
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.0049c250
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 9
push ecx
lea ecx, [ebp - 0x24]
push ecx
mov ecx, eax
call fcn.0049c250
mov esi, eax
mov ecx, dword [ebp - 0x14]
mov byte [ebp - 4], 0xa
test ecx, ecx
je 0x49ee9d
call fcn.0049c750
mov ecx, dword [esi]
mov dword [ebp - 0x14], ecx
test ecx, ecx
je 0x49eeab
call fcn.0049c480
mov ecx, dword [ebp - 0x24]
mov byte [ebp - 4], 0xb
test ecx, ecx
je 0x49eebb
call fcn.0049c750
mov ecx, dword [ebp - 0x28]
mov byte [ebp - 4], 0xc
test ecx, ecx
je 0x49eecb
call fcn.0049c750
mov ecx, dword [ebp - 0x10]
mov byte [ebp - 4], 0xd
test ecx, ecx
je 0x49eedb
call fcn.0049c750
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 6
call fcn.0049c120
push eax
push 0x4f2ee0
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, dword [ebp - 0x18]
mov byte [ebp - 4], 0xe
test ecx, ecx
je 0x49ef03
call fcn.0049c750
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 4], 0xf
test ecx, ecx
je 0x49ef16
call fcn.0049c750
push 0x104
push 0x513670
push ebx
mov dword [ebp - 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x513670
call fcn.0049fb00
mov eax, dword [0x519494]
add esp, 4
mov dword [0x5194c4], 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