Function at 0x404042
Capabilities:
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42ea78
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xfd8
push edi
mov dword [ebp - 0xfdc], 0
mov dword [ebp - 4], 1
lea eax, [ebp - 0x18]
push eax
mov ecx, dword [ebp + 0xc]
and ecx, 0xff
neg ecx
sbb ecx, ecx
and ecx, 6
add ecx, 0x20019
push ecx
push 0
push 0
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [ebp + 0xc]
and eax, 0xff
neg eax
sbb eax, eax
and eax, 6
add eax, 0x20019
push eax
push 0
push 0x43a5ac
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea edx, [ebp - 0x14]
push edx
mov eax, dword [ebp + 0xc]
and eax, 0xff
neg eax
sbb eax, eax
and eax, 6
add eax, 0x20019
push eax
push 0
push 0x43a5b8
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea edx, [ebp - 0x20]
push edx
mov eax, dword [ebp + 0xc]
and eax, 0xff
neg eax
sbb eax, eax
and eax, 6
add eax, 0x20019
push eax
push 0
push 0x43a5c4
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea ecx, [ebp - 0x10]
call fcn.00406220
mov byte [ebp - 4], 2
mov edx, dword [ebp + 0xc]
and edx, 0xff
test edx, edx
je 0x404289
mov al, byte [0x440410]
mov byte [ebp - 0x7f4], al
mov ecx, 0x1f3
xor eax, eax
lea edi, [ebp - 0x7f3]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov dword [ebp - 0x24], 0
lea ecx, [ebp + 0x10]
call fcn.00406280
test eax, eax
jne 0x404258
push 0x43a5dc
lea ecx, [ebp - 0x7f8]
push ecx
lea ecx, [ebp + 0x10]
call fcn.0041bfde
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x7f8]
call fcn.00406240
add eax, 1
push eax
lea edx, [ebp - 0xfd8]
push edx
lea ecx, [ebp + 0x10]
call fcn.0041be06
mov dword [ebp - 0xfe0], eax
mov eax, dword [ebp - 0xfe0]
mov dword [ebp - 0xfe4], eax
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0xfe4]
push ecx
lea ecx, [ebp + 0x10]
call fcn.0041dfb7
mov byte [ebp - 4], 3
lea ecx, [ebp - 0xfd8]
call fcn.0041de7e
lea ecx, [ebp - 0x7f8]
call fcn.00406280
test eax, eax
jne 0x404244
push str.WINCCFLEXIBLE
lea edx, [ebp - 0x7f8]
push edx
call fcn.00406330
and eax, 0xff
test eax, eax
je 0x404244
lea ecx, [ebp - 0x7f8]
call fcn.004062a0
push eax
mov eax, dword [ebp - 0x24]
lea ecx, [ebp + eax - 0x7f4]
push ecx
call fcn.00408c20
add esp, 8
lea ecx, [ebp - 0x7f8]
call fcn.00406240
mov edx, dword [ebp - 0x24]
add edx, eax
mov dword [ebp - 0x24], edx
mov eax, dword [ebp - 0x24]
mov byte [ebp + eax - 0x7f4], 0
mov ecx, dword [ebp - 0x24]
add ecx, 1
mov dword [ebp - 0x24], ecx
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x7f8]
call fcn.0041de7e
jmp 0x40415b
mov edx, dword [ebp - 0x24]
mov byte [ebp + edx - 0x7f4], 0
mov eax, dword [ebp - 0x24]
add eax, 1
push eax
lea ecx, [ebp - 0x7f4]
push ecx
push 7
push 0
push 0x43a5f0
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
jmp 0x404338
mov dword [ebp - 0x804], 0x7d0
mov al, byte [0x440414]
mov byte [ebp - 0xfd4], al
mov ecx, 0x1f3
xor eax, eax
lea edi, [ebp - 0xfd3]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea ecx, [ebp - 0x804]
push ecx
lea edx, [ebp - 0xfd4]
push edx
lea eax, [ebp - 0x800]
push eax
push 0
push str.InstalledInstances
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea edx, [ebp - 0xfd4]
mov dword [ebp - 0x7fc], edx
mov eax, dword [ebp - 0x7fc]
movsx ecx, byte [eax]
test ecx, ecx
je 0x404338
lea ecx, [ebp - 0x10]
call fcn.00406280
test eax, eax
jne 0x404308
push 0x43a618
lea ecx, [ebp - 0x10]
call fcn.0041e25a
mov edx, dword [ebp - 0x7fc]
push edx
lea ecx, [ebp - 0x10]
call fcn.0041e25a
mov eax, dword [ebp - 0x7fc]
push eax
call fcn.00408ba0
add esp, 4
mov ecx, dword [ebp - 0x7fc]
lea edx, [ecx + eax + 1]
mov dword [ebp - 0x7fc], edx
jmp 0x4042e2
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea ecx, [ebp - 0x10]
push ecx
mov ecx, dword [ebp + 8]
call fcn.0041dbf3
mov edx, dword [ebp - 0xfdc]
or edx, 1
mov dword [ebp - 0xfdc], edx
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x10]
call fcn.0041de7e
mov byte [ebp - 4], 0
lea ecx, [ebp + 0x10]
call fcn.0041de7e
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
mov esp, ebp
pop ebp
ret