Function at 0x401740
Capabilities:
Check if file exists
Get file attributes
Get installed programs
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x478016
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x378
mov eax, dword [0x4bc364]
push ebx
push esi
mov esi, ecx
push edi
mov edi, dword [esi + 0x18]
cmp edi, 0x10
mov dword [esp + 0x37c], eax
mov dword [esp + 0xc], esi
lea ecx, [esi + 4]
jb 0x401785
mov edx, dword [ecx]
jmp 0x401787
mov edx, ecx
mov eax, dword [esi + 0x14]
add eax, edx
cmp edi, 0x10
jb 0x401793
mov ecx, dword [ecx]
push eax
push ecx
lea eax, [esp + 0x24]
push eax
mov ecx, esi
call fcn.00401350
lea ecx, [esp + 0x10]
push ecx
push 0x20019
xor ebx, ebx
push ebx
push str.SOFTWAREMicrosoftWindowsCurrentVersionUninstall
push reloc.OLEAUT32.dll_SysReAllocString
mov byte [esi + 0x1c], bl
mov dword [esp + 0x24], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x401a99
mov ecx, dword [esp + 0x10]
push ebx
push ebx
push ebx
push ebx
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x284]
push eax
push ebx
push ecx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x38], 0x104
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
cmp eax, 0x103
je 0x401a99
mov esi, 0xf
cmp eax, ebx
jne 0x401a12
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x14]
push edx
push 0x20019
push ebx
lea eax, [esp + 0x27c]
push eax
push ecx
mov dword [esp + 0x28], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x401a12
mov ecx, 0x41
lea edi, [esp + 0x168]
rep stosd dword es:[edi], eax
mov ecx, 0x41
lea edi, [esp + 0x60]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x14]
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov eax, 0x103
lea edx, [esp + 0x20]
push edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
lea eax, [esp + 0x16c]
push eax
push ebx
push ebx
push str.ConsoleBrand
push ecx
call edi
cmp eax, ebx
jne 0x40189b
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x64]
push eax
push ebx
push ebx
push str.ConsoleExePath
push ecx
call edi
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [esp + 0x168]
mov dword [esp + 0x5c], esi
mov dword [esp + 0x58], ebx
mov byte [esp + 0x48], bl
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4018c0
sub eax, edx
push eax
lea eax, [esp + 0x16c]
push eax
lea ecx, [esp + 0x4c]
call fcn.004015a0
lea eax, [esp + 0x60]
mov dword [esp + 0x38c], ebx
mov dword [esp + 0x40], esi
mov dword [esp + 0x3c], ebx
mov byte [esp + 0x2c], bl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4018f5
sub eax, edx
push eax
lea ecx, [esp + 0x64]
push ecx
lea ecx, [esp + 0x30]
call fcn.004015a0
cmp dword [esp + 0x58], ebx
mov byte [esp + 0x38c], 1
je 0x4019c2
cmp dword [esp + 0x3c], ebx
je 0x4019c2
mov eax, dword [esp + 0x40]
mov edi, 0x10
cmp eax, edi
mov eax, dword [esp + 0x2c]
jae 0x40193e
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40198b
mov eax, dword [ebp + 8]
cmp dword [eax + 0x18], edi
jb 0x401957
mov eax, dword [eax + 4]
jmp 0x40195a
add eax, 4
cmp dword [esp + 0x5c], edi
mov ecx, dword [esp + 0x48]
jae 0x401968
lea ecx, [esp + 0x48]
push eax
push ecx
call fcn.0045f1e4
add esp, 8
test eax, eax
push 0xffffffffffffffff
lea ecx, [esp + 0x2c]
push ebx
push ecx
je 0x401a4d
mov ecx, dword [esp + 0x18]
call fcn.004014b0
cmp dword [esp + 0x40], edi
jb 0x40199e
mov edx, dword [esp + 0x2c]
push edx
call fcn.004694c8
add esp, 4
cmp dword [esp + 0x5c], edi
mov dword [esp + 0x40], esi
mov dword [esp + 0x3c], ebx
mov byte [esp + 0x2c], bl
mov dword [esp + 0x38c], 0xffffffff
jb 0x401a06
mov eax, dword [esp + 0x48]
push eax
jmp 0x4019fe
mov eax, dword [esp + 0x40]
mov edi, 0x10
cmp eax, edi
jb 0x4019dc
mov ecx, dword [esp + 0x2c]
push ecx
call fcn.004694c8
add esp, 4
cmp dword [esp + 0x5c], edi
mov dword [esp + 0x40], esi
mov dword [esp + 0x3c], ebx
mov byte [esp + 0x2c], bl
mov dword [esp + 0x38c], 0xffffffff
jb 0x401a06
mov edx, dword [esp + 0x48]
push edx
call fcn.004694c8
add esp, 4
mov dword [esp + 0x5c], esi
mov dword [esp + 0x58], ebx
mov byte [esp + 0x48], bl
mov eax, dword [esp + 0x1c]
push ebx
push ebx
push ebx
push ebx
lea ecx, [esp + 0x28]
push ecx
inc eax
lea edx, [esp + 0x284]
push edx
push eax
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x2c]
push eax
mov dword [esp + 0x38], 0x104
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
cmp eax, 0x103
jne 0x401806
jmp 0x401a95
mov edi, dword [esp + 0x18]
mov ecx, edi
call fcn.004014b0
mov eax, dword [esp + 0x40]
mov byte [edi + 0x1c], 1
mov edi, 0x10
cmp eax, edi
jb 0x401a76
mov edx, dword [esp + 0x2c]
push edx
call fcn.004694c8
add esp, 4
cmp dword [esp + 0x5c], edi
mov dword [esp + 0x40], esi
mov dword [esp + 0x3c], ebx
mov byte [esp + 0x2c], bl
jb 0x401a95
mov eax, dword [esp + 0x48]
push eax
call fcn.004694c8
add esp, 4
mov esi, dword [esp + 0xc]
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x401aa8
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor eax, eax
cmp byte [ebp + 0xc], bl
je 0x401abc
mov edx, dword [esi + 0x14]
xor ecx, ecx
cmp ecx, edx
sbb eax, eax
neg eax
jmp 0x401abf
mov al, byte [esi + 0x1c]
mov ecx, dword [esp + 0x384]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x37c]
call fcn.0044ea94
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8