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

Disassembly:
push 0x20
mov eax, 0x446ba9
call fcn.0042bfb7
mov eax, ecx
mov dword [ebp - 0x24], eax
lea esi, [eax + 4]
xor ebx, ebx
push esi
mov dword [ebp - 0x2c], ebx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
jne 0x410752
lea eax, [ebp - 0x18]
push eax
push 0x44c748
push SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x4106a8
lea eax, [ebp - 0x28]
mov dword [ebp - 0x28], 0x208
push eax
push esi
push ebx
push ebx
push 0x44c78c
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push 0x44c79c
push 0x104
push esi
call fcn.0042a4b5
add esp, 0xc
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
jne 0x410752
mov eax, ebx
mov dword [ebp - 0x14], ebx
push 0x104
push esi
push dword [eax + 0x44c7b4]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
jne 0x410752
mov eax, dword [ebp - 0x14]
add eax, 4
mov dword [ebp - 0x14], eax
cmp eax, 0x10
jb 0x4106be
push 0x44c7c4
push 0x104
push esi
call fcn.0042a521
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
jne 0x410752
push esi
mov edi, 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push 0x44c7f8
push edi
push esi
call fcn.0042a4b5
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
jne 0x410752
push 0x44c814
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
jne 0x410752
push 0x44c82c
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
lea eax, [ebp - 0x14]
push 0x44c848
push eax
call fcn.0040889f
pop ecx
pop ecx
push 0x104
push esi
push edi
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x5c
push esi
call fcn.0042a57d
pop ecx
pop ecx
test eax, eax
je 0x41079b
sub eax, dword [ebp - 0x24]
sub eax, 4
sar eax, 1
push eax
lea eax, [ebp - 0x20]
push esi
push eax
call fcn.00408a15
add esp, 0xc
xor ecx, ecx
inc ecx
jmp 0x4107a7
push esi
lea ecx, [ebp - 0x1c]
call fcn.004051c4
push 2
pop ecx
mov esi, dword [eax]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x2c], esi
test esi, esi
je 0x4107bd
lea eax, [esi + 8]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov eax, dword [ebp - 0x10]
mov dword [ebp - 4], 2
test al, 2
je 0x4107e3
mov ecx, dword [ebp - 0x1c]
and eax, 0xfffffffd
mov dword [ebp - 0x10], eax
test ecx, ecx
je 0x4107e3
call fcn.00403368
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], ebx
mov byte [ebp - 4], 3
test al, 1
je 0x4107fa
mov ecx, dword [ebp - 0x20]
test ecx, ecx
je 0x4107fa
call fcn.00403368
mov dword [ebp - 0x20], ebx
push 0x44c858
lea ecx, [ebp - 0x28]
call fcn.004051c4
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x24]
push eax
lea ecx, [ebp - 0x14]
call fcn.00405319
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 5
push ecx
lea ecx, [ebp - 0x10]
push ecx
mov ecx, eax
call fcn.00405319
push eax
lea ecx, [ebp - 0x14]
call fcn.0040399c
mov ecx, dword [ebp - 0x10]
test ecx, ecx
je 0x410846
call fcn.00403368
mov dword [ebp - 0x10], ebx
mov ecx, dword [ebp - 0x24]
test ecx, ecx
je 0x410855
call fcn.00403368
mov dword [ebp - 0x24], ebx
mov ecx, dword [ebp - 0x28]
test ecx, ecx
je 0x410861
call fcn.00403368
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x41086a
mov ebx, dword [eax]
push ebx
push 0x44c85c
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test esi, esi
je 0x410881
mov ecx, esi
call fcn.00403368
mov ecx, dword [ebp - 0x14]
test ecx, ecx
je 0x41088d
call fcn.00403368
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
xor eax, eax
test edi, edi
setne al
call fcn.0042bf85
ret