View Full Version : Registry Search with Wildcard?
PodHunter
10-14-2014, 03:38 PM
My DLL should be installed in a sub-directory of third-party vendor's folder. There may be several versions of vendor's product installed, and I need to find the most recent.
Until recently, I could search the Registry for key Vendor.Product.Application. Having found that I could get the product class ID and from there obtain more information.
Unfortunately, the rules seem to have changed. That registry key now looks like Vendor.Product.Application.{class id}. In other words, you need to know the class ID in order to construct the search string to find ... the class ID!
A search string like Vendor.Product.Application.* doesn't work. Is there a way to search the Registry using a wildcard?
linder
10-15-2014, 02:44 AM
Hello,
As I understand it, you would like to "loop" through Registry subkeys. Just use "Get Registry SubKey..." to handle this. You can use "Handle String Operation..." to retrieve the {class id} part.
Does this help?
Friedrich
linder
10-15-2014, 02:46 AM
BTW, if you can post a registry example then I can help to write the code.
Friedrich
PodHunter
10-16-2014, 04:27 AM
BTW, if you can post a registry example then I can help to write the code.
Friedrich
Thanks! Here's a screenshot showing two Bentley.MicroStation.Application.{class ID} keys.
http://www.la-solutions.co.uk/images/Bentley-Registry-Example.png
linder
10-16-2014, 04:40 AM
No problem. I'll post a project later today.
Friedrich
linder
10-16-2014, 06:06 AM
Hello,
I have developed and uploaded a registry scan project for you. It's a processor-intensive task, but doable:
http://www.lindersoft.com/projects/ScanRegistry.zip
Friedrich
linder
10-16-2014, 06:40 AM
Hello,
During my tests, I noticed that scanning through the Registry with many keys is really slooooow. I've found a bottleneck in the function and have optimized the code. It is way faster now. Down from 3+ minutes (SB V8.1) to 4 seconds (SB 8.2). I can send you a re-compiled test executable if you want.
Friedrich
PodHunter
10-16-2014, 07:04 AM
Thanks for the sample code. I don't think I could have come up with that :)
linder
10-16-2014, 07:20 AM
You are welcome :)
The next version comes with the optimized code to "fix" the annoying bottleneck in the process.
Friedrich
PodHunter
10-16-2014, 08:19 AM
Hello,
I noticed that scanning through the Registry with many keys is really slooooow.
It uses a lot of memory too! Searching my Registry, with ~7,000 entries in HK CLASSES, I get memory warnings from Windows.
Also, it reports only the first of two similar keys.
linder
10-16-2014, 08:32 AM
Yes, that memory leak slows down the process. But it's down to nearly zero KB in the fixed version.
Could you please post two more example keys so I can test it?
Friedrich
PodHunter
10-16-2014, 08:59 AM
please post two more example keys so I can test it
My previous screenshot shows two similar keys.
linder
10-16-2014, 09:21 AM
Hmmm, on our test machines, it displays both (but with 4500+ keys only).
Does the re-compiled one work?
http://www.lindersoft.com/projects/ScanRegistryExe.zip
Friedrich
PodHunter
10-16-2014, 10:01 AM
Does the re-compiled one work?
It takes a while to start (~30 seconds), but after the Do you really want to run this exe? dialog it's very fast.
Unfortunately, despite its speed, it doesn't find any keys at all :(
linder
10-16-2014, 10:14 AM
The start delay is caused by your protection software (it scans it for a virus) and has nothing to do with the executable. The executable is lauched AFTER the "Do you really want to run this exe" dialog ;)
Wait, I'll check the scanning process again on a fresh Windows 7 machine...
Friedrich
linder
10-17-2014, 02:23 AM
Hello,
I have code-signed the executable to make your protection software happy ;)
Could you please re-download it?
http://www.lindersoft.com/projects/ScanRegistryExe.zip
Does this work now?
Friedrich
PodHunter
10-17-2014, 02:29 AM
:) Success!
Starts fast
Runs fast with no visible memory leak
Discovers all matched keys
Will that new search algorithm be incorporated into the next SB update?
linder
10-17-2014, 02:42 AM
Thank you for the good news !!! :)
Yes, it will be incorporated into the next SB update.
Friedrich
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.