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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x444761
mov eax, dword fs:[0]
push eax
sub esp, 0xb44
mov eax, dword [0x45e554]
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 0x40dd6f
push esi
lea ecx, [ebp - 0xb38]
call fcn.004022b0
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 0x40d8a9
lea edx, [eax - 0x10]
mov dword [ebp - 4], 0xffffffff
or eax, 0xffffffff
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40dd6f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40dd6f
push str.CLSID
lea ecx, [ebp - 0xb38]
call fcn.0040e1f0
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp - 0xb2c]
push eax
push 0x20019
push 0
push dword [ebp - 0xb38]
push SysReAllocStringLen
call edi
test eax, eax
jne 0x40d945
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 0x40d932
cmp dword [ebp - 0xb34], 1
jne 0x40d932
lea eax, [ebp - 0xb28]
push eax
lea eax, [ebp - 0x518]
push 0x40
push eax
call fcn.00435038
add esp, 0xc
push dword [ebp - 0xb2c]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call esi
jmp 0x40daae
push esi
lea ecx, [ebp - 0xb48]
call fcn.004022b0
push str.CurVer
lea ecx, [ebp - 0xb48]
mov byte [ebp - 4], 1
call fcn.0040e1f0
lea eax, [ebp - 0xb50]
push eax
push 0x20019
push 0
push dword [ebp - 0xb48]
push SysReAllocStringLen
call edi
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x40da9f
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 0x40da9f
cmp dword [ebp - 0xb34], 1
jne 0x40da9f
lea eax, [ebp - 0xb28]
push eax
lea ecx, [ebp - 0xb40]
call fcn.004022b0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0xb40]
mov eax, dword [ebp - 0xb40]
cmp dword [eax - 0xc], 0
jne 0x40da0f
call fcn.00402410
lea ecx, [ebp - 0xb48]
call fcn.00402410
jmp 0x40dd64
push str.CLSID
call fcn.0040e1f0
lea eax, [ebp - 0xb3c]
push eax
push 0x20019
push 0
push dword [ebp - 0xb40]
push SysReAllocStringLen
call edi
test eax, eax
jne 0x40da94
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 0x40da8c
cmp dword [ebp - 0xb34], 1
jne 0x40da8c
lea eax, [ebp - 0xb28]
push eax
lea eax, [ebp - 0x518]
push 0x40
push eax
call fcn.00435038
add esp, 0xc
push dword [ebp - 0xb3c]
call esi
lea ecx, [ebp - 0xb40]
call fcn.00402410
lea ecx, [ebp - 0xb48]
mov byte [ebp - 4], 0
call fcn.00402410
push str.CLSID_
lea eax, [ebp - 0x318]
push 0x80
push eax
call fcn.00435038
add esp, 0xc
lea eax, [ebp - 0x518]
push eax
lea eax, [ebp - 0x318]
push 0x80
push eax
call fcn.0043509c
add esp, 0xc
lea eax, [ebp - 0xb4c]
push eax
push 0x20019
push 0
lea eax, [ebp - 0x318]
push eax
push SysReAllocStringLen
call edi
test eax, eax
jne 0x40dd64
lea eax, [ebp - 0xb2c]
push eax
push 0x20019
push 0
push str.TypeLib
push dword [ebp - 0xb4c]
call edi
test eax, eax
jne 0x40db99
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 0x40dd5c
cmp dword [ebp - 0xb34], 1
jne 0x40dd5c
push dword [ebp - 0xb2c]
call esi
push dword [ebp - 0xb44]
lea eax, [ebp - 0xb28]
mov ecx, ebx
push eax
call fcn.0040d3b0
lea ecx, [ebp - 0xb38]
mov esi, eax
call fcn.00402410
mov eax, esi
jmp 0x40dd71
lea eax, [ebp - 0xb2c]
push eax
push 0x20019
push 0
push str.InprocServer32
push dword [ebp - 0xb4c]
call edi
test eax, eax
jne 0x40dcf2
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 0x40dcea
mov eax, dword [ebp - 0xb34]
cmp eax, 1
je 0x40dc3f
cmp eax, 2
jne 0x40dcea
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 0x40dc3f
lea eax, [ebp - 0x728]
push eax
lea eax, [ebp - 0x218]
push 0x104
push eax
call fcn.00435038
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 0x40dcd6
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 0x40dcd6
mov esi, dword [ebx + 0x5c]
test esi, esi
je 0x40dc9b
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 0x40dcd6
mov esi, dword [ebx + 0x6c]
test esi, esi
je 0x40dcbf
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 0x40dcd6
lea ecx, [ebp - 0xb38]
mov esi, 1
call fcn.00402410
mov eax, esi
jmp 0x40dd71
lea ecx, [ebp - 0xb38]
xor esi, esi
call fcn.00402410
mov eax, esi
jmp 0x40dd71
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 0x40dd64
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 0x40dd5c
mov eax, dword [ebp - 0xb34]
cmp eax, 1
je 0x40dc3f
cmp eax, 2
je 0x40dc07
push dword [ebp - 0xb2c]
call esi
lea ecx, [ebp - 0xb38]
call fcn.00402410
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.0042b520
mov esp, ebp
pop ebp
ret 8