Reading Windows Registry from Linux

Since I’m involved in Live CD projects like Metadistros, I’ve been thinking about making easier to setup systems after they come up.

Many LiveCD systems are used onWindows installed machines, so why not to “steal” all this information from Windows registry to setup our Linux system? The idea is straight forward: e.g. take network configuration from Windows and boot a Live system which can connect directly to the Internet, without prompting users about IP confs.

Today I’ve been collecting base tools to do it:

  • dumphive: a tool written in Pascal to get a Windows registry binary hive file and dump it to a text file
  • Win32::Registry::File, a Perl library to access a text .reg file

To dump the hardware hive from my Thinkpad Windows XP partition:


$ dumphive /mnt/winxp/WINDOWS/system32/config/SYSTEM /tmp/system.reg

And to read SYSTEM\ControlSet001\Control (I don’t know what the hell is this) using Win32::Registry::File:


use Win32::Registry::File;
$reg = new Win32::Registry::File();
$reg->open('/tmp/system.reg');
use Data::Dumper;
print Dumper($reg->get(['SYSTEM\ControlSet001\Control']));

Now, the only thing left is to find the information we’re looking for among all those nightmare registry entries, and make it work on every Windows host.

Ho, ho, ho


About this entry