[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Device detection?



On Thu, 04 Mar, 1999, Randolph Chung wrote:
> This is not my idea, and I'm not claiming credit for it. Someone brought
> this up in IRC. sorry i forgot who it was....
> 
> What do people think about writing code that will derive users hardware
> information from the Windows registry? While this obviously doesn't work as
> well as real detection, it can potentially help a lot of people who are
> migrating from the Windows realm.
> 
> Is this feasible? Are people interested in doing this? Is there
> documentation out there about the registry format?
> 
> I'd be willing to work on this, though I probably won't get to it for a few
> weeks.
> 
> comments welcome, flames to /dev/null please :)


Try exporting the windows registry to a file: random.reg

then run the attached perl script: perl ./play random.reg

well it is a start.

-- 
GNU does not eliminate all the world's problems, only some of them.
                                                -- The GNU Manifesto
#!/usr/bin/perl -w
use strict;
my @getkeys = ('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\User information',
               'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class');
while(<>) {
	if (/^\[(.*)]\r$/) {
		foreach my $key (@getkeys) {
			if (!index($1, $key)) {
				print "$1\n";
				while(<> =~ /^(.+)\r$/) {
					print "$1\n";
				}
				print "\n";
			}
		}
	}
}

Reply to: