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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x444101
mov eax, dword fs:[0]
push eax
sub esp, 0xb44
mov eax, dword [0x45d554]
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 ebx, ecx
mov esi, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
push str.winmgmts
push esi
mov dword [ebp - 0xb44], eax
call fcn.00430d3a
add esp, 8
test eax, eax
je 0x40ddcf
push esi
lea ecx, [ebp - 0xb38]
call fcn.004025f0
xor eax, eax
mov dword [ebp - 4], 0
mov word [ebp - 0x218], ax
mov word [ebp - 0x518], ax
mov eax, dword [ebp - 0xb38]
cmp dword [eax - 0xc], 0
jne 0x40d909
lea edx, [eax - 0x10]
mov dword [ebp - 4], 0xffffffff
or eax, 0xffffffff
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40ddcf
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40ddcf
push str.CLSID
lea ecx, [ebp - 0xb38]
call fcn.0040e250
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp - 0xb2c]
push eax
push 0x20019
push 0
push dword [ebp - 0xb38]
push SysReAllocString
call edi
test eax, eax
jne 0x40d9a5
lea eax, [ebp - 0xb30]
mov dword [ebp - 0xb30], 0x200
push eax
lea eax, [ebp - 0xb28]
push eax
lea eax, [ebp - 0xb34]
push eax
push 0
push 0
push dword [ebp - 0xb2c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40d992
cmp dword [ebp - 0xb34], 1
jne 0x40d992
lea eax, [ebp - 0xb28]
push eax
lea eax, [ebp - 0x518]
push 0x40
push eax
call fcn.00434f6d
add esp, 0xc
push dword [ebp - 0xb2c]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call esi
jmp 0x40db0e
push esi
lea ecx, [ebp - 0xb48]
call fcn.004025f0
push str.CurVer
lea ecx, [ebp - 0xb48]
mov byte [ebp - 4], 1
call fcn.0040e250
lea eax, [ebp - 0xb50]
push eax
push 0x20019
push 0
push dword [ebp - 0xb48]
push SysReAllocString
call edi
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x40daff
lea eax, [ebp - 0xb30]
mov dword [ebp - 0xb30], 0x200
push eax
lea eax, [ebp - 0xb28]
push eax
lea eax, [ebp - 0xb34]
push eax
push 0
push 0
push dword [ebp - 0xb50]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40daff
cmp dword [ebp - 0xb34], 1
jne 0x40daff
lea eax, [ebp - 0xb28]
push eax
lea ecx, [ebp - 0xb40]
call fcn.004025f0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0xb40]
mov eax, dword [ebp - 0xb40]
cmp dword [eax - 0xc], 0
jne 0x40da6f
call fcn.00402750
lea ecx, [ebp - 0xb48]
call fcn.00402750
jmp 0x40ddc4
push str.CLSID
call fcn.0040e250
lea eax, [ebp - 0xb3c]
push eax
push 0x20019
push 0
push dword [ebp - 0xb40]
push SysReAllocString
call edi
test eax, eax
jne 0x40daf4
lea eax, [ebp - 0xb30]
mov dword [ebp - 0xb30], 0x200
push eax
lea eax, [ebp - 0xb28]
push eax
lea eax, [ebp - 0xb34]
push eax
push 0
push 0
push dword [ebp - 0xb3c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40daec
cmp dword [ebp - 0xb34], 1
jne 0x40daec
lea eax, [ebp - 0xb28]
push eax
lea eax, [ebp - 0x518]
push 0x40
push eax
call fcn.00434f6d
add esp, 0xc
push dword [ebp - 0xb3c]
call esi
lea ecx, [ebp - 0xb40]
call fcn.00402750
lea ecx, [ebp - 0xb48]
mov byte [ebp - 4], 0
call fcn.00402750
push str.CLSID_
lea eax, [ebp - 0x318]
push 0x80
push eax
call fcn.00434f6d
add esp, 0xc
lea eax, [ebp - 0x518]
push eax
lea eax, [ebp - 0x318]
push 0x80
push eax
call fcn.00434fd1
add esp, 0xc
lea eax, [ebp - 0xb4c]
push eax
push 0x20019
push 0
lea eax, [ebp - 0x318]
push eax
push SysReAllocString
call edi
test eax, eax
jne 0x40ddc4
lea eax, [ebp - 0xb2c]
push eax
push 0x20019
push 0
push str.TypeLib
push dword [ebp - 0xb4c]
call edi
test eax, eax
jne 0x40dbf9
lea eax, [ebp - 0xb30]
mov dword [ebp - 0xb30], 0x80
push eax
lea eax, [ebp - 0xb28]
push eax
lea eax, [ebp - 0xb34]
push eax
push 0
push 0
push dword [ebp - 0xb2c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40ddbc
cmp dword [ebp - 0xb34], 1
jne 0x40ddbc
push dword [ebp - 0xb2c]
call esi
push dword [ebp - 0xb44]
lea eax, [ebp - 0xb28]
mov ecx, ebx
push eax
call fcn.0040d410
lea ecx, [ebp - 0xb38]
mov esi, eax
call fcn.00402750
mov eax, esi
jmp 0x40ddd1
lea eax, [ebp - 0xb2c]
push eax
push 0x20019
push 0
push str.InprocServer32
push dword [ebp - 0xb4c]
call edi
test eax, eax
jne 0x40dd52
lea eax, [ebp - 0xb30]
mov dword [ebp - 0xb30], 0x105
push eax
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0xb34]
push eax
push 0
push 0
push dword [ebp - 0xb2c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40dd4a
mov eax, dword [ebp - 0xb34]
cmp eax, 1
je 0x40dc9f
cmp eax, 2
jne 0x40dd4a
push 0x104
lea eax, [ebp - 0x728]
push eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x40dc9f
lea eax, [ebp - 0x728]
push eax
lea eax, [ebp - 0x218]
push 0x104
push eax
call fcn.00434f6d
add esp, 0xc
push dword [ebp - 0xb2c]
call esi
lea eax, [ebp - 0xb44]
push eax
push 2
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.OLEAUT32.dll_SystemTimeToVariantTime]
test eax, eax
js 0x40dd36
mov eax, dword [ebp - 0xb44]
lea edx, [ebp - 0xb3c]
push edx
push eax
mov ecx, dword [eax]
call dword [ecx + 0x1c]
test eax, eax
jne 0x40dd36
mov esi, dword [ebx + 0x5c]
test esi, esi
je 0x40dcfb
mov ecx, dword [ebp - 0xb3c]
mov edx, dword [esi]
push eax
movzx eax, word [ecx + 0x1a]
push eax
movzx eax, word [ecx + 0x18]
push eax
push ecx
push esi
call dword [edx + 0x24]
test eax, eax
jne 0x40dd36
mov esi, dword [ebx + 0x6c]
test esi, esi
je 0x40dd1f
mov ecx, dword [ebp - 0xb3c]
mov edx, dword [esi]
push 0
movzx eax, word [ecx + 0x1a]
push eax
movzx eax, word [ecx + 0x18]
push eax
push ecx
push esi
call dword [edx + 0x24]
test eax, eax
jne 0x40dd36
lea ecx, [ebp - 0xb38]
mov esi, 1
call fcn.00402750
mov eax, esi
jmp 0x40ddd1
lea ecx, [ebp - 0xb38]
xor esi, esi
call fcn.00402750
mov eax, esi
jmp 0x40ddd1
push dword [ebp - 0xb2c]
call esi
lea eax, [ebp - 0xb2c]
push eax
push 0x20019
push 0
push str.LocalServer32
push dword [ebp - 0xb4c]
call edi
test eax, eax
jne 0x40ddc4
lea eax, [ebp - 0xb30]
mov dword [ebp - 0xb30], 0x105
push eax
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0xb34]
push eax
push 0
push 0
push dword [ebp - 0xb2c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40ddbc
mov eax, dword [ebp - 0xb34]
cmp eax, 1
je 0x40dc9f
cmp eax, 2
je 0x40dc67
push dword [ebp - 0xb2c]
call esi
lea ecx, [ebp - 0xb38]
call fcn.00402750
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.0042b6e6
mov esp, ebp
pop ebp
ret 8