Function at 0x40d160
Capabilities:
Get installed programs
Set registry value

Disassembly:
mov eax, dword [0x422040]
sub esp, 0x17c
cmp eax, 0xffffffff
je 0x40d179
push eax
call fcn.004012c0
add esp, 4
push esi
call fcn.0040e790
mov eax, dword [0x4276a4]
xor esi, esi
cmp eax, esi
jne 0x40d533
mov eax, dword [0x4271f4]
push edi
cmp byte [eax], 0
je 0x40d427
push ebx
push ebp
push 2
push eax
call fcn.00401040
mov ebp, eax
push esi
push ebp
call fcn.004011a0
push ebp
call fcn.00401140
mov ebx, eax
mov eax, dword [0x427690]
push eax
mov word [esp + 0x34], 0x1235
mov word [esp + 0x36], si
mov dword [esp + 0x38], esi
call fcn.00402060
lea ecx, [esp + 0x30]
push 4
push ecx
push ebp
mov dword [esp + 0x3c], esi
call fcn.00401100
mov eax, dword [0x427288]
mov edi, dword [0x427284]
add esp, 0x24
cmp eax, esi
mov dword [esp + 0x10], esi
jbe 0x40d2ae
push edi
call fcn.0040d560
mov edx, dword [0x4271fc]
add esp, 4
cmp byte [edx], 0
je 0x40d289
mov ecx, dword [edi + 0x16]
test ch, 2
je 0x40d21d
push esi
jmp 0x40d277
mov ax, word [edi + 2]
cmp ax, 0x17
je 0x40d239
cmp ax, 0x19
je 0x40d239
cmp ax, 0x1f4
je 0x40d239
cmp ax, 0x1f5
jne 0x40d289
test cl, 0x80
jne 0x40d289
mov eax, dword [edi + 0x1a]
mov byte [esp + 0x14], 0
cmp eax, esi
je 0x40d254
test ch, 4
je 0x40d254
mov byte [esp + 0x14], 1
test cl, 1
je 0x40d25e
or byte [esp + 0x14], 8
cmp eax, 3
jne 0x40d268
or byte [esp + 0x14], 2
test ch, 0x10
je 0x40d272
or byte [esp + 0x14], 4
mov eax, dword [esp + 0x14]
push eax
push ebp
call fcn.0040b8b0
mov eax, dword [esp + 0x20]
add esp, 8
inc eax
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x10]
push edi
inc eax
mov dword [esp + 0x14], eax
call fcn.004037b0
mov ecx, dword [esp + 0x14]
mov edi, eax
mov eax, dword [0x427288]
add esp, 4
cmp ecx, eax
jb 0x40d1fe
push ebp
call fcn.00401140
sub eax, ebx
add ebx, 0xfffffff8
push ebx
push ebp
mov dword [esp + 0x2c], eax
call fcn.00401160
lea edx, [esp + 0x28]
push 8
push edx
push ebp
call fcn.00401100
lea eax, [esp + 0x30]
push 4
push eax
push ebp
call fcn.00401100
mov ecx, dword [esp + 0x44]
add ecx, 0xfffffffc
push ecx
push ebp
call fcn.00401180
push ebp
call fcn.0040bdd0
mov eax, dword [0x427590]
add esp, 0x30
mov ebx, dword [eax + 0xc]
cmp ebx, esi
je 0x40d3d2
cmp byte [ebx], 0
je 0x40d3d2
test byte [eax], 0x20
je 0x40d3d2
mov edi, str.SoftwareMicrosoftWindowsCurrentVersionUninstall_
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x24]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x24]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x10]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x28]
push ecx
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
test eax, eax
jne 0x40d3d0
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov edx, dword [esp + 0x10]
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
not ecx
dec ecx
push ecx
push ebx
push 1
push eax
push str.DisplayName
push edx
call esi
mov edx, dword [0x4271f4]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push edx
push 1
push eax
mov eax, dword [esp + 0x20]
push str.UninstallString
push eax
call esi
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor esi, esi
mov ecx, dword [0x42768c]
mov eax, dword [ecx*4 + 0x4272d0]
cmp eax, esi
je 0x40d3f5
mov edx, dword [ecx*4 + 0x427290]
push edx
push eax
push ebp
call fcn.00401100
add esp, 0xc
push ebp
call fcn.00401140
lea eax, [esp + 0x20]
push 8
push eax
push ebp
mov word [esp + 0x2c], 0x7f7f
mov word [esp + 0x2e], 2
mov dword [esp + 0x30], esi
call fcn.00401100
push ebp
call fcn.004012c0
add esp, 0x14
pop ebp
pop ebx
jmp 0x40d431
push 0xffffffffffffffff
call fcn.0040bdd0
add esp, 4
cmp dword [0x427698], esi
jne 0x40d522
mov ecx, dword [0x427690]
push ecx
call fcn.004020b0
mov edx, dword [0x427590]
add esp, 4
test byte [edx], 4
je 0x40d4c9
cmp dword [edx + 0x2c], esi
je 0x40d4c9
mov edi, dword [0x427690]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov eax, dword [edx + 0x28]
not ecx
dec ecx
mov edi, ecx
inc edi
cmp eax, 0x10
jb 0x40d47e
mov eax, dword [0x422048]
jmp 0x40d485
mov eax, dword [eax*4 + 0x422044]
mov edx, dword [edx + 0x2c]
lea ecx, [esp + 8]
push ecx
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
test eax, eax
jne 0x40d4c3
mov eax, dword [0x427690]
mov ecx, dword [0x427590]
push edi
push eax
mov edx, dword [ecx + 0x30]
mov eax, dword [esp + 0x10]
push 1
push esi
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov ecx, dword [esp + 8]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, dword [0x427590]
test byte [edx], 8
je 0x40d504
mov ecx, dword [edx + 0x38]
cmp ecx, esi
je 0x40d504
mov eax, dword [edx + 0x3c]
cmp eax, esi
je 0x40d504
mov edx, dword [edx + 0x40]
cmp edx, esi
je 0x40d504
mov edi, dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
push ecx
mov ecx, dword [0x427690]
push ecx
push edx
push eax
call edi
mov edx, dword [0x427590]
mov eax, dword [edx + 0x38]
push eax
push esi
push esi
push esi
call edi
call fcn.0040c730
call fcn.0040c980
call fcn.0040cc00
mov ecx, dword [0x427690]
push ecx
call fcn.00402060
add esp, 4
push 1
push esi
push 0x1000000
call fcn.004037c0
add esp, 0xc
pop edi
cmp word [0x422030], 0xffff
jne 0x40d548
push 6
call fcn.00409db0
add esp, 4
mov dword [0x427214], esi
pop esi
add esp, 0x17c
ret