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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41de3b
mov eax, dword fs:[0]
push eax
sub esp, 0x944
mov eax, dword [0x42b008]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
mov dword [ebp - 0x94c], ecx
lea ecx, [ebp - 0x93c]
push eax
call fcn.00409400
xor eax, eax
mov dword [ebp - 4], 0
mov word [ebp - 0x110], ax
mov eax, dword [ebp - 0x93c]
cmp dword [eax - 0xc], 0
jne 0x406acc
lea edx, [eax - 0x10]
mov dword [ebp - 4], 0xffffffff
or eax, 0xffffffff
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jmp 0x406ee5
mov ecx, dword [eax - 0x10]
test ecx, ecx
je 0x406adc
mov eax, dword [ecx]
call dword [eax + 0x10]
test eax, eax
jne 0x406ae8
call fcn.00405220
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
push eax
push ecx
lea ecx, [ebp - 0x950]
call fcn.00409b70
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x93c]
mov eax, dword [ebp - 0x950]
push dword [eax - 0xc]
push eax
call fcn.0040a110
mov byte [ebp - 4], 0
or esi, 0xffffffff
mov edx, dword [ebp - 0x950]
mov eax, esi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x406b32
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp - 0x938]
push eax
push 0x20019
push 0
push dword [ebp - 0x93c]
push SysReAllocString
call ebx
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x406bb9
lea eax, [ebp - 0x940]
mov dword [ebp - 0x940], 0x80
push eax
lea eax, [ebp - 0x310]
push eax
lea eax, [ebp - 0x944]
push eax
push 0
push 0
push dword [ebp - 0x938]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x406bb1
cmp dword [ebp - 0x944], 1
jne 0x406bb1
lea eax, [ebp - 0x310]
push eax
lea eax, [ebp - 0x110]
push 0x40
push eax
call fcn.00411a06
add esp, 0xc
push dword [ebp - 0x938]
call edi
lea ecx, [ebp - 0x110]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406bc2
sub ecx, edx
sar ecx, 1
je 0x406ecd
push str.CLSID_
lea eax, [ebp - 0x210]
push 0x80
push eax
call fcn.00411a06
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x210]
push 0x80
push eax
call fcn.00411a6a
add esp, 0x18
lea eax, [ebp - 0x948]
push eax
push 0x20019
push 0
lea eax, [ebp - 0x210]
push eax
push SysReAllocString
call ebx
test eax, eax
je 0x406c7d
push str.Wow6432NodeCLSID_
lea eax, [ebp - 0x210]
push 0x80
push eax
call fcn.00411a06
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x210]
push 0x80
push eax
call fcn.00411a6a
add esp, 0x18
lea eax, [ebp - 0x948]
push eax
push 0x20019
push 0
lea eax, [ebp - 0x210]
push eax
push SysReAllocString
call ebx
test eax, eax
jne 0x406ecd
lea eax, [ebp - 0x938]
push eax
push 0x20019
push 0
push str.TypeLib
push dword [ebp - 0x948]
call ebx
test eax, eax
jne 0x406cff
lea eax, [ebp - 0x940]
mov dword [ebp - 0x940], 0x80
push eax
lea eax, [ebp - 0x310]
push eax
lea eax, [ebp - 0x944]
push eax
mov eax, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push 0
push 0
push dword [ebp - 0x938]
call eax
test eax, eax
jne 0x406ec5
cmp dword [ebp - 0x944], 1
jne 0x406ec5
push dword [ebp - 0x94c]
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x310]
push eax
call fcn.00406360
jmp 0x406ebb
lea eax, [ebp - 0x938]
push eax
push 0x20019
push 0
push str.InprocServer32
push dword [ebp - 0x948]
call ebx
test eax, eax
jne 0x406e04
lea eax, [ebp - 0x940]
mov dword [ebp - 0x940], 0x105
push eax
lea eax, [ebp - 0x728]
push eax
lea eax, [ebp - 0x944]
push eax
mov eax, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push 0
push 0
push dword [ebp - 0x938]
call eax
test eax, eax
jne 0x406dfc
mov eax, dword [ebp - 0x944]
cmp eax, 1
je 0x406da6
cmp eax, 2
jne 0x406dfc
push 0x104
lea eax, [ebp - 0x51c]
push eax
lea eax, [ebp - 0x728]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x406da6
lea eax, [ebp - 0x51c]
push eax
lea eax, [ebp - 0x728]
push 0x104
push eax
call fcn.00411a06
add esp, 0xc
push dword [ebp - 0x94c]
lea eax, [ebp - 0x728]
push eax
lea eax, [ebp - 0x110]
push eax
call fcn.004066f0
mov ebx, eax
test ebx, ebx
jle 0x406df6
push dword [ebp - 0x938]
call edi
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x93c]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], esi
dec esi
test esi, esi
jg 0x406def
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, ebx
jmp 0x406ef1
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
push dword [ebp - 0x938]
call edi
lea eax, [ebp - 0x938]
push eax
push 0x20019
push 0
push str.LocalServer32
push dword [ebp - 0x948]
call ebx
test eax, eax
jne 0x406ecd
lea eax, [ebp - 0x940]
mov dword [ebp - 0x940], 0x105
push eax
lea eax, [ebp - 0x51c]
push eax
lea eax, [ebp - 0x944]
push eax
push 0
push 0
push dword [ebp - 0x938]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x406ec5
mov eax, dword [ebp - 0x944]
cmp eax, 1
je 0x406ea2
cmp eax, 2
jne 0x406ec5
push 0x104
lea eax, [ebp - 0x934]
push eax
lea eax, [ebp - 0x51c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x406ea2
lea eax, [ebp - 0x934]
push eax
lea eax, [ebp - 0x51c]
push 0x104
push eax
call fcn.00411a06
add esp, 0xc
push dword [ebp - 0x94c]
lea eax, [ebp - 0x51c]
push eax
lea eax, [ebp - 0x110]
push eax
call fcn.004066f0
mov ebx, eax
test ebx, ebx
jg 0x406dc5
push dword [ebp - 0x938]
call edi
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x93c]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], esi
dec esi
test esi, esi
jg 0x406eef
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 - 0x10]
xor ecx, ebp
call fcn.0040b5ff
mov esp, ebp
pop ebp
ret 8