Function at 0x40c640
Capabilities:
Check if file exists
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x28c
mov eax, dword [0x48c8b0]
xor eax, esp
mov dword [esp + 0x288], eax
push ebx
push esi
push edi
mov edi, ecx
xor ebx, ebx
push 0x40
mov dword [esp + 0x20], edi
mov dword [esp + 0x54], ebx
call fcn.004254a6
mov esi, eax
add esp, 4
test esi, esi
je 0x40c6db
push 0x47c3e0
lea ecx, [esp + 0x30]
call fcn.004169c0
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x24]
push eax
mov ecx, 0x47bb60
mov dword [esp + 0x28], 0x59
mov ebx, 3
call fcn.0041efe0
push eax
mov ecx, 0x47bb90
call fcn.0041efe0
push eax
push str.WindowsInstaller
lea eax, [edi + 0x16c]
push eax
lea eax, [esp + 0x70]
push eax
call fcn.0040de20
add esp, 0xc
mov ecx, esi
push eax
call fcn.00401000
mov dword [esp + 0x3c], eax
jmp 0x40c6df
mov dword [esp + 0x3c], ebx
or ecx, 0xffffffff
test bl, 2
je 0x40c708
mov edx, dword [esp + 0x58]
add edx, 0xfffffff0
and ebx, 0xfffffffd
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40c705
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
or ecx, 0xffffffff
test bl, 1
je 0x40c728
mov edx, dword [esp + 0x2c]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40c728
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [edi + 0x16c]
lea ebx, [edi + 0x16c]
mov dword [esp + 0x24], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x28], 0
mov dword [esp + 0x18], 0
mov eax, dword [eax - 0xc]
add eax, 0x12
push str.WindowsInstaller
xor ecx, ecx
mov dword [esp + 0x54], eax
lea eax, [esp + 0x24]
push ebx
push eax
mov dword [esp + 0x50], ecx
mov dword [esp + 0x54], ecx
mov dword [esp + 0x58], ecx
call fcn.0040de20
add esp, 0xc
lea ecx, [esp + 0x10]
push 0x47bbe4
call fcn.004169c0
mov esi, dword [esp + 0x10]
mov edx, dword [edi + 0xb8]
mov eax, dword [esi - 0xc]
lea ecx, [edi + 0xb8]
add eax, eax
push eax
push esi
call dword [edx + 0x3c]
mov eax, dword [ebx]
test eax, eax
je 0x40cf7e
mov ecx, dword [edi + 0x178]
mov dx, word [ecx]
cmp dx, word [eax]
jne 0x40c7dd
test dx, dx
je 0x40c7d9
mov dx, word [ecx + 2]
cmp dx, word [eax + 2]
jne 0x40c7dd
add ecx, 4
add eax, 4
test dx, dx
jne 0x40c7b7
xor eax, eax
jmp 0x40c7e2
sbb eax, eax
or eax, 1
mov edi, dword [esp + 0x20]
test eax, eax
jne 0x40ca2a
lea eax, [esp + 0x24]
push eax
push 0x20119
push 0
push 0x47bc08
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40cf03
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
cmp dword [esp + 0x24], 0
je 0x40cf03
push 0x17
push 0x47bd6c
lea ecx, [esp + 0x18]
call fcn.00416dd0
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
mov eax, dword [esi - 0xc]
mov edx, dword [ecx + 0xb8]
add ecx, 0xb8
add eax, eax
push eax
push esi
call dword [edx + 0x3c]
lea eax, [esp + 0x40]
push eax
push 0x47bd9c
push dword [esp + 0x2c]
call ebx
test eax, eax
jne 0x40cf03
lea eax, [esp + 0x28]
push eax
push str.Products
push dword [esp + 0x2c]
call ebx
test eax, eax
jne 0x40cf03
push 0x206
push eax
mov word [esp + 0x90], ax
lea eax, [esp + 0x92]
push eax
call fcn.004470b0
add esp, 0xc
lea ecx, [esp + 0x14]
call fcn.00417040
push 0x47bdc0
lea ecx, [esp + 0x14]
mov dword [esp + 0x3c], 4
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], 0
call fcn.00416b50
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x1c]
mov ecx, dword [eax - 0xc]
mov edx, dword [esi + 0xb8]
add ecx, ecx
push ecx
push eax
lea ecx, [esi + 0xb8]
call dword [edx + 0x3c]
push 0x104
lea eax, [esp + 0x8c]
push eax
push 0
push dword [esp + 0x34]
mov dword [esp + 0x30], 0
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyW]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x40ce7b
jmp 0x40c920
cmp word [esp + 0x88], 0
je 0x40ce35
lea eax, [esp + 0x88]
push eax
lea ecx, [esp + 0x18]
call fcn.00416b50
push 0x47bdd8
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x64]
push eax
call fcn.0040de20
add esp, 0xc
lea ecx, [esp + 0x10]
push eax
call fcn.00416f30
mov edx, dword [esp + 0x5c]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40c97f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [esp + 0x1c]
mov edx, dword [eax + 0xb8]
mov eax, dword [esp + 0x10]
mov ecx, dword [eax - 0xc]
add ecx, ecx
push ecx
mov ecx, dword [esp + 0x20]
push eax
lea ecx, [ecx + 0xb8]
call dword [edx + 0x3c]
push str.InstallProperties
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x68]
push eax
call fcn.0040de20
add esp, 0xc
lea ecx, [esp + 0x18]
push ecx
push dword [eax]
push dword [esp + 0x30]
call ebx
mov edx, dword [esp + 0x60]
test eax, eax
sete bl
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40c9e8
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test bl, bl
je 0x40ce4c
push dword [esp + 0x18]
lea ecx, [esp + 0x70]
call fcn.00402f60
push dword [esp + 0x18]
call esi
push 0x47c3e0
push dword [esp + 0x7c]
call fcn.0040e000
add esp, 8
test al, al
je 0x40cabf
lea ecx, [esp + 0x6c]
call fcn.0040cf90
jmp 0x40ce4c
push 0x47bc94
push SysStringLen
call dword [sym.imp.ADVAPI32.dll_RegUnLoadKeyW]
push str.WindowsSystem32configSOFTWARE
lea eax, [esp + 0x24]
push ebx
push eax
call fcn.0040de20
add esp, 0xc
push dword [eax]
push 0x47bc94
push SysStringLen
call dword [sym.imp.ADVAPI32.dll_RegLoadKeyW]
mov edx, dword [esp + 0x20]
test eax, eax
setne bl
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40ca82
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test bl, bl
jne 0x40cf03
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
lea eax, [esp + 0x24]
push eax
push str.159MicrosoftWindowsCurrentVersionInstallerUserDataS_1_5_18
push SysStringLen
call ebx
test eax, eax
je 0x40c818
mov eax, dword [sym.imp.ADVAPI32.dll_RegUnLoadKeyW]
push 0x47bc94
push SysStringLen
call eax
jmp 0x40cf03
mov ecx, dword [esp + 0x48]
mov ebx, dword [esp + 0x44]
sub ecx, ebx
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov esi, edx
shr esi, 0x1f
dec esi
add esi, edx
cmp esi, 0xffffffff
je 0x40cb0d
lea eax, [esi*8]
sub eax, esi
lea ebx, [ebx + eax*4]
mov edi, edi
lea eax, [esp + 0x6c]
push eax
mov ecx, ebx
call fcn.004034b0
test al, al
je 0x40ce07
dec esi
sub ebx, 0x1c
cmp esi, 0xffffffff
jne 0x40caf0
lea eax, [esp + 0x6c]
push eax
lea ecx, [esp + 0x48]
call fcn.0040e660
lea ecx, [esp + 0x6c]
call fcn.0040cf90
push 0x11
push 0x47be38
lea ecx, [esp + 0x18]
call fcn.00416dd0
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x1c]
mov ecx, dword [eax - 0xc]
mov edx, dword [ebx + 0xb8]
add ecx, ecx
add ebx, 0xb8
push ecx
push eax
mov ecx, ebx
call dword [edx + 0x3c]
push 0x47be5c
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x6c]
push eax
call fcn.0040de20
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
add esp, 0xc
lea ecx, [esp + 0x18]
push ecx
push dword [eax]
push dword [esp + 0x30]
call esi
mov edx, dword [esp + 0x64]
test eax, eax
sete bl
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40cba1
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test bl, bl
je 0x40ce2f
push 0x208
lea eax, [esp + 0x8c]
push 0
push eax
call fcn.004470b0
add esp, 0xc
lea eax, [esp + 0x88]
push 0x104
push eax
xor ebx, ebx
push ebx
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyW]
test eax, eax
jne 0x40cdf9
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x8c]
push eax
push dword [esp + 0x20]
call esi
test eax, eax
jne 0x40cdc1
lea eax, [esp + 0x88]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40cc07
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x8c]
push eax
lea ecx, [esp + 0x1c]
call fcn.00416dd0
push 0x47c134
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x5c]
push eax
call fcn.0040de20
add esp, 0xc
lea ecx, [esp + 0x10]
push eax
call fcn.00416f30
mov edx, dword [esp + 0x54]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40cc67
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x1c]
mov ecx, dword [eax - 0xc]
mov edx, dword [esi + 0xb8]
add ecx, ecx
push ecx
push eax
lea ecx, [esi + 0xb8]
call dword [edx + 0x3c]
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x40]
push eax
push 0
push str.State
push dword [esp + 0x44]
call esi
test eax, eax
je 0x40ccd5
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x40]
push eax
push 0
push str.State
push dword [esp + 0x44]
call esi
test eax, eax
jne 0x40cdb1
cmp word [esp + 0x88], 2
jne 0x40cdb1
lea eax, [esp + 0x34]
push eax
push dword [esp + 0x18]
push dword [esp + 0x48]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x40cdb1
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x40]
push eax
push 0
push str.LocalPackage
push dword [esp + 0x48]
call esi
test eax, eax
je 0x40cd45
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x40]
push eax
push 0
push str.LocalPackage
push dword [esp + 0x48]
call esi
test eax, eax
jne 0x40cda7
lea eax, [esp + 0x88]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40cda7
lea eax, [esp + 0x88]
push eax
lea ecx, [esp + 0x18]
call fcn.00416b50
test edi, edi
je 0x40cda7
mov esi, dword [esp + 0x14]
cmp dword [esi - 0xc], 0
jl 0x40cda7
push edi
push esi
call fcn.0043df41
add esp, 8
test eax, eax
je 0x40cda7
sub eax, esi
sar eax, 1
jne 0x40cda7
push dword [esp + 0x50]
lea ecx, [esp + 0x18]
push 0
call fcn.0040da90
mov ecx, dword [esp + 0x3c]
lea eax, [esp + 0x14]
push eax
call fcn.00401e80
push dword [esp + 0x34]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push dword [esp + 0x30]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
push 0x208
lea eax, [esp + 0x8c]
push 0
push eax
call fcn.004470b0
add esp, 0xc
lea eax, [esp + 0x88]
push 0x104
push eax
inc ebx
push ebx
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyW]
test eax, eax
je 0x40cbe2
push dword [esp + 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call esi
jmp 0x40ce35
cmp esi, 0xffffffff
je 0x40cb0d
mov ecx, dword [esp + 0x44]
lea eax, [esp + 0x6c]
push eax
lea eax, [esi*8]
sub eax, esi
lea ecx, [ecx + eax*4]
call fcn.00403510
jmp 0x40cb1b
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x208
lea eax, [esp + 0x8c]
push 0
push eax
call fcn.004470b0
add esp, 0xc
mov eax, dword [esp + 0x20]
push 0x104
lea ecx, [esp + 0x8c]
inc eax
push ecx
push eax
push dword [esp + 0x34]
mov dword [esp + 0x30], eax
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyW]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
je 0x40c920
push 0xd
push str.install
lea ecx, [esp + 0x18]
call fcn.00416dd0
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
mov eax, dword [esi - 0xc]
mov edx, dword [ecx + 0xb8]
add ecx, 0xb8
add eax, eax
push eax
push esi
call dword [edx + 0x3c]
push dword [esp + 0x40]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call ebx
push dword [esp + 0x28]
call ebx
push dword [esp + 0x24]
call ebx
mov eax, dword [sym.imp.ADVAPI32.dll_RegUnLoadKeyW]
push 0x47bc94
push SysStringLen
call eax
mov ecx, dword [esp + 0x1c]
push dword [esp + 0x3c]
lea ecx, [ecx + 0x19c]
call fcn.00402e30
mov edx, dword [esp + 0x14]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40cf03
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 0xfffffff0
or ecx, 0xffffffff
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40cf1d
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
add edi, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40cf37
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov ebx, dword [esp + 0x44]
test ebx, ebx
je 0x40cf67
mov edi, dword [esp + 0x48]
mov esi, ebx
cmp ebx, edi
je 0x40cf5e
lea esp, [esp]
mov ecx, esi
call fcn.0040cf90
add esi, 0x1c
cmp esi, edi
jne 0x40cf50
push ebx
call fcn.004254d3
add esp, 4
mov ecx, dword [esp + 0x294]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.0043ddbb
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00416fc0
int3