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

Disassembly:
push 0x944
mov eax, 0x43ef8f
call fcn.004265cd
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
mov dword [ebp - 0x94c], ecx
lea ecx, [ebp - 0x944]
push eax
call fcn.00401fad
xor esi, esi
xor eax, eax
mov dword [ebp - 4], esi
mov word [ebp - 0x110], ax
mov eax, dword [ebp - 0x944]
cmp dword [eax - 0xc], esi
jne 0x40be64
lea ecx, [eax - 0x10]
call fcn.00402052
xor eax, eax
jmp 0x40c203
push str.CLSID
lea ecx, [ebp - 0x944]
call fcn.0040a76c
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp - 0x938]
push eax
push 0x20019
push esi
push dword [ebp - 0x944]
push SysReAllocString
call ebx
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x40bef8
lea eax, [ebp - 0x940]
mov dword [ebp - 0x940], 0x80
push eax
lea eax, [ebp - 0x310]
push eax
lea eax, [ebp - 0x93c]
push eax
push esi
push esi
push dword [ebp - 0x938]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40bef0
cmp dword [ebp - 0x93c], 1
jne 0x40bef0
lea eax, [ebp - 0x310]
push eax
lea eax, [ebp - 0x110]
push 0x40
push eax
call fcn.0042f3c2
add esp, 0xc
push dword [ebp - 0x938]
call edi
lea ecx, [ebp - 0x110]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, si
jne 0x40bf01
sub ecx, edx
sar ecx, 1
jne 0x40bf20
mov ecx, dword [ebp - 0x944]
lea ecx, [ecx - 0x10]
jmp 0x40be58
push str.CLSID_
lea eax, [ebp - 0x210]
push 0x80
push eax
call fcn.0042f3c2
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x210]
push 0x80
push eax
call fcn.0042f60f
add esp, 0x18
lea eax, [ebp - 0x948]
push eax
push 0x20019
push esi
lea eax, [ebp - 0x210]
push eax
push SysReAllocString
call ebx
test eax, eax
je 0x40bfc4
push str.Wow6432NodeCLSID_
lea eax, [ebp - 0x210]
push 0x80
push eax
call fcn.0042f3c2
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x210]
push 0x80
push eax
call fcn.0042f60f
add esp, 0x18
lea eax, [ebp - 0x948]
push eax
push 0x20019
push esi
lea eax, [ebp - 0x210]
push eax
push SysReAllocString
call ebx
test eax, eax
jne 0x40c1f3
lea eax, [ebp - 0x938]
push eax
push 0x20019
push esi
push str.TypeLib
push dword [ebp - 0x948]
call ebx
test eax, eax
jne 0x40c042
lea eax, [ebp - 0x940]
mov dword [ebp - 0x940], 0x80
push eax
lea eax, [ebp - 0x310]
push eax
lea eax, [ebp - 0x93c]
push eax
push esi
push esi
push dword [ebp - 0x938]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40c1eb
cmp dword [ebp - 0x93c], 1
jne 0x40c1eb
push dword [ebp - 0x94c]
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x310]
push eax
call fcn.0040b932
jmp 0x40c1e1
lea eax, [ebp - 0x938]
push eax
push 0x20019
push esi
push str.InprocServer32
push dword [ebp - 0x948]
call ebx
test eax, eax
jne 0x40c125
lea eax, [ebp - 0x940]
mov dword [ebp - 0x940], 0x105
push eax
lea eax, [ebp - 0x728]
push eax
lea eax, [ebp - 0x93c]
push eax
push esi
push esi
push dword [ebp - 0x938]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40c11d
cmp dword [ebp - 0x93c], 1
je 0x40c0ab
cmp dword [ebp - 0x93c], 2
jne 0x40c11d
cmp dword [ebp - 0x93c], 2
jne 0x40c0e9
mov ebx, 0x104
lea eax, [ebp - 0x51c]
push ebx
push eax
lea eax, [ebp - 0x728]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x40c0e9
lea eax, [ebp - 0x51c]
push eax
lea eax, [ebp - 0x728]
push ebx
push eax
call fcn.0042f3c2
add esp, 0xc
push dword [ebp - 0x94c]
lea eax, [ebp - 0x728]
push eax
lea eax, [ebp - 0x110]
push eax
call fcn.0040bc5d
mov ebx, eax
test ebx, ebx
jle 0x40c117
push dword [ebp - 0x938]
call edi
mov esi, ebx
jmp 0x40c1f3
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
push dword [ebp - 0x938]
call edi
lea eax, [ebp - 0x938]
push eax
push 0x20019
push esi
push str.LocalServer32
push dword [ebp - 0x948]
call ebx
test eax, eax
jne 0x40c1f3
lea eax, [ebp - 0x940]
mov dword [ebp - 0x940], 0x105
push eax
lea eax, [ebp - 0x51c]
push eax
lea eax, [ebp - 0x93c]
push eax
push esi
push esi
push dword [ebp - 0x938]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40c1eb
cmp dword [ebp - 0x93c], 1
je 0x40c18a
cmp dword [ebp - 0x93c], 2
jne 0x40c1eb
cmp dword [ebp - 0x93c], 2
jne 0x40c1c8
mov ebx, 0x104
lea eax, [ebp - 0x934]
push ebx
push eax
lea eax, [ebp - 0x51c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x40c1c8
lea eax, [ebp - 0x934]
push eax
lea eax, [ebp - 0x51c]
push ebx
push eax
call fcn.0042f3c2
add esp, 0xc
push dword [ebp - 0x94c]
lea eax, [ebp - 0x51c]
push eax
lea eax, [ebp - 0x110]
push eax
call fcn.0040bc5d
mov ebx, eax
test ebx, ebx
jg 0x40c108
push dword [ebp - 0x938]
call edi
mov ecx, dword [ebp - 0x944]
add ecx, 0xfffffff0
call fcn.00402052
mov eax, esi
call fcn.00426577
ret 8