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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x44437b
mov eax, dword fs:[0]
push eax
sub esp, 0x568
mov eax, dword [0x45d554]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
lea ecx, [ebp - 0x530]
mov esi, dword [ebp + 8]
mov dword [ebp - 0x560], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x55c], eax
xor eax, eax
push str.TypeLib_
mov word [ebp - 0x31c], ax
call fcn.0040e630
mov dword [ebp - 4], 0
test esi, esi
jne 0x40fabb
xor ecx, ecx
jmp 0x40facf
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40fac0
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0x530]
call fcn.00402ca0
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp - 0x534]
push eax
push 0x20019
push 0
push dword [ebp - 0x530]
push SysReAllocString
call ebx
test eax, eax
je 0x40fb5f
push str.Wow6432NodeTypeLib_
lea ecx, [ebp - 0x530]
call fcn.00403560
test esi, esi
jne 0x40fb19
xor ecx, ecx
jmp 0x40fb2f
mov ecx, esi
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40fb20
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0x530]
call fcn.00402ca0
lea eax, [ebp - 0x534]
push eax
push 0x20019
push 0
push dword [ebp - 0x530]
push SysReAllocString
call ebx
test eax, eax
jne 0x40fdcb
xor esi, esi
mov dword [ebp - 0x54c], 0x80
lea eax, [ebp - 0x570]
mov dword [ebp - 0x548], 0x40
push eax
push esi
push esi
push esi
lea eax, [ebp - 0x548]
mov dword [ebp - 0x554], esi
push eax
lea eax, [ebp - 0x114]
push eax
push esi
push dword [ebp - 0x534]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x40fdc3
nop
lea eax, [ebp - 0x538]
push eax
push 0x20019
push 0
lea eax, [ebp - 0x114]
push eax
push dword [ebp - 0x534]
call ebx
test eax, eax
jne 0x40fd82
xor esi, esi
mov dword [ebp - 0x544], 0x40
lea eax, [ebp - 0x568]
mov dword [ebp - 0x550], esi
push eax
push esi
push esi
push esi
lea eax, [ebp - 0x544]
push eax
lea eax, [ebp - 0x94]
push eax
push esi
push dword [ebp - 0x538]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
jne 0x40fd74
lea eax, [ebp - 0x540]
push eax
push 0x20019
push 0
lea eax, [ebp - 0x94]
push eax
push dword [ebp - 0x538]
call ebx
test eax, eax
jne 0x40fd33
lea eax, [ebp - 0x53c]
push eax
push 0x20019
push 0
push str.win32
push dword [ebp - 0x540]
call ebx
test eax, eax
je 0x40fc7b
lea eax, [ebp - 0x53c]
push eax
push 0x20019
push 0
push str.win64
push dword [ebp - 0x540]
call ebx
test eax, eax
jne 0x40fd2b
lea eax, [ebp - 0x54c]
mov dword [ebp - 0x54c], 0x105
push eax
lea eax, [ebp - 0x31c]
push eax
lea eax, [ebp - 0x558]
push eax
push 0
push 0
push dword [ebp - 0x53c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40fd23
mov eax, dword [ebp - 0x558]
cmp eax, 1
je 0x40fcbe
cmp eax, 2
jne 0x40fd23
cmp eax, 2
jne 0x40fcfb
push 0x104
lea eax, [ebp - 0x52c]
push eax
lea eax, [ebp - 0x31c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x40fcfb
lea eax, [ebp - 0x52c]
push eax
lea eax, [ebp - 0x31c]
push 0x104
push eax
call fcn.00434f6d
add esp, 0xc
push dword [ebp - 0x55c]
lea eax, [ebp - 0x31c]
push eax
push dword [ebp - 0x560]
call fcn.0040fe50
mov esi, eax
test esi, esi
jg 0x40fe10
mov esi, dword [ebp - 0x550]
push dword [ebp - 0x53c]
call edi
push dword [ebp - 0x540]
call edi
lea eax, [ebp - 0x568]
mov dword [ebp - 0x544], 0x40
push eax
push 0
push 0
push 0
lea eax, [ebp - 0x544]
inc esi
push eax
lea eax, [ebp - 0x94]
mov dword [ebp - 0x550], esi
push eax
push esi
push dword [ebp - 0x538]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
je 0x40fc14
push dword [ebp - 0x538]
call edi
mov esi, dword [ebp - 0x554]
lea eax, [ebp - 0x570]
mov dword [ebp - 0x548], 0x40
push eax
push 0
push 0
push 0
lea eax, [ebp - 0x548]
inc esi
push eax
lea eax, [ebp - 0x114]
mov dword [ebp - 0x554], esi
push eax
push esi
push dword [ebp - 0x534]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
je 0x40fbb0
push dword [ebp - 0x534]
call edi
mov dword [ebp - 4], 0xffffffff
or eax, 0xffffffff
mov edx, dword [ebp - 0x530]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40fdf0
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0042b6e6
mov esp, ebp
pop ebp
ret 0xc
push dword [ebp - 0x53c]
call edi
mov dword [ebp - 4], 0xffffffff
or eax, 0xffffffff
mov edx, dword [ebp - 0x530]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40fe3d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, esi
jmp 0x40fdf2