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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4449db
mov eax, dword fs:[0]
push eax
sub esp, 0x568
mov eax, dword [0x45e554]
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.0040e5d0
mov dword [ebp - 4], 0
test esi, esi
jne 0x40fa0b
xor ecx, ecx
jmp 0x40fa1f
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40fa10
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0x530]
call fcn.00402940
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp - 0x534]
push eax
push 0x20019
push 0
push dword [ebp - 0x530]
push SysReAllocStringLen
call ebx
test eax, eax
je 0x40faaf
push str.Wow6432NodeTypeLib_
lea ecx, [ebp - 0x530]
call fcn.004032f0
test esi, esi
jne 0x40fa69
xor ecx, ecx
jmp 0x40fa7f
mov ecx, esi
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40fa70
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0x530]
call fcn.00402940
lea eax, [ebp - 0x534]
push eax
push 0x20019
push 0
push dword [ebp - 0x530]
push SysReAllocStringLen
call ebx
test eax, eax
jne 0x40fd1b
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 0x40fd13
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 0x40fcd2
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 0x40fcc4
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 0x40fc83
lea eax, [ebp - 0x53c]
push eax
push 0x20019
push 0
push str.win32
push dword [ebp - 0x540]
call ebx
test eax, eax
je 0x40fbcb
lea eax, [ebp - 0x53c]
push eax
push 0x20019
push 0
push str.win64
push dword [ebp - 0x540]
call ebx
test eax, eax
jne 0x40fc7b
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 0x40fc73
mov eax, dword [ebp - 0x558]
cmp eax, 1
je 0x40fc0e
cmp eax, 2
jne 0x40fc73
cmp eax, 2
jne 0x40fc4b
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 0x40fc4b
lea eax, [ebp - 0x52c]
push eax
lea eax, [ebp - 0x31c]
push 0x104
push eax
call fcn.00435038
add esp, 0xc
push dword [ebp - 0x55c]
lea eax, [ebp - 0x31c]
push eax
push dword [ebp - 0x560]
call fcn.0040fda0
mov esi, eax
test esi, esi
jg 0x40fd60
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 0x40fb64
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 0x40fb00
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 0x40fd40
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.0042b520
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 0x40fd8d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, esi
jmp 0x40fd42