Function at 0x40f35d
Capabilities:
Query environment variable
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
mov eax, 0x443be1
call fcn.00428c84
sub esp, 0x550
push ebx
push esi
push edi
mov dword [ebp - 0x38], ecx
xor eax, eax
push str.TypeLib_
lea ecx, [ebp - 0x10]
mov word [ebp - 0x350], ax
call fcn.0040d113
mov edi, dword [ebp + 8]
xor esi, esi
mov dword [ebp - 4], esi
test edi, edi
jne 0x40f399
mov eax, esi
jmp 0x40f3a0
push edi
call fcn.004304f5
pop ecx
push eax
push edi
lea ecx, [ebp - 0x10]
call fcn.0040225c
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp - 0x14]
push eax
push 0x20019
push esi
push dword [ebp - 0x10]
push SysReAllocStringLen
call ebx
test eax, eax
je 0x40f40a
push str.Wow6432NodeTypeLib_
lea ecx, [ebp - 0x10]
call fcn.004028e8
test edi, edi
jne 0x40f3dd
mov eax, esi
jmp 0x40f3e4
push edi
call fcn.004304f5
pop ecx
push eax
push edi
lea ecx, [ebp - 0x10]
call fcn.0040225c
lea eax, [ebp - 0x14]
push eax
push 0x20019
push esi
push dword [ebp - 0x10]
push SysReAllocStringLen
call ebx
test eax, eax
jne 0x40f5d6
lea eax, [ebp - 0x48]
mov dword [ebp - 0x2c], 0x80
push eax
push esi
push esi
push esi
lea eax, [ebp - 0x28]
mov dword [ebp - 0x28], 0x40
push eax
lea eax, [ebp - 0x148]
mov dword [ebp - 0x34], esi
push eax
push esi
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40f5c9
lea eax, [ebp + 8]
push eax
push 0x20019
push esi
lea eax, [ebp - 0x148]
push eax
push dword [ebp - 0x14]
call ebx
test eax, eax
jne 0x40f59f
lea eax, [ebp - 0x40]
mov dword [ebp - 0x30], esi
push eax
push esi
push esi
push esi
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0xc8]
push eax
push esi
jmp 0x40f582
lea eax, [ebp - 0x20]
push eax
push 0x20019
push esi
lea eax, [ebp - 0xc8]
push eax
push dword [ebp + 8]
call ebx
test eax, eax
jne 0x40f568
lea eax, [ebp - 0x18]
push eax
push 0x20019
push esi
push str.win32
push dword [ebp - 0x20]
call ebx
test eax, eax
je 0x40f4cd
lea eax, [ebp - 0x18]
push eax
push 0x20019
push esi
push str.win64
push dword [ebp - 0x20]
call ebx
test eax, eax
jne 0x40f563
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 0x105
push eax
lea eax, [ebp - 0x350]
push eax
lea eax, [ebp - 0x1c]
push eax
push esi
push esi
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40f55e
cmp dword [ebp - 0x1c], 1
je 0x40f4fe
cmp dword [ebp - 0x1c], 2
jne 0x40f55e
cmp dword [ebp - 0x1c], 2
jne 0x40f539
mov ebx, 0x104
lea eax, [ebp - 0x55c]
push ebx
push eax
lea eax, [ebp - 0x350]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x40f539
lea eax, [ebp - 0x55c]
push eax
lea eax, [ebp - 0x350]
push ebx
push eax
call fcn.0043283e
add esp, 0xc
push dword [ebp + 0x10]
mov ecx, dword [ebp - 0x38]
lea eax, [ebp - 0x350]
push eax
push dword [ebp + 0xc]
call fcn.0040f5fd
mov ebx, eax
test ebx, ebx
jg 0x40f5f4
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
push dword [ebp - 0x18]
call edi
push dword [ebp - 0x20]
call edi
mov eax, dword [ebp - 0x30]
lea ecx, [ebp - 0x40]
push ecx
push esi
push esi
push esi
lea ecx, [ebp - 0x24]
inc eax
push ecx
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0x30], eax
push ecx
push eax
push dword [ebp + 8]
mov dword [ebp - 0x24], 0x40
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
je 0x40f47b
push dword [ebp + 8]
call edi
mov eax, dword [ebp - 0x34]
lea ecx, [ebp - 0x48]
push ecx
push esi
push esi
push esi
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x28], 0x40
push ecx
lea ecx, [ebp - 0x148]
inc eax
push ecx
push eax
push dword [ebp - 0x14]
mov dword [ebp - 0x34], eax
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
je 0x40f442
push dword [ebp - 0x14]
call edi
mov ecx, dword [ebp - 0x10]
add ecx, 0xfffffff0
call fcn.00401b78
mov ecx, dword [ebp - 0xc]
mov eax, esi
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 0xc
push dword [ebp - 0x18]
call edi
mov esi, ebx
jmp 0x40f5d6