手机版
你好,游客 登录 注册
背景:
阅读新闻

Linux下读取Windows注册表

[日期:2011-04-04] 来源:Linux社区  作者:vah101 [字体:大 中 小]

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

linux
相关资讯       Linux教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款