wwe has asked for the wisdom of the Perl Monks concerning the following question:
It's easy to get following output using Win32::tieRegistry:Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\wwe] "binary"=hex:00,11 "dword"=dword:00000010 "multi-sz"=hex(7):66,00,69,00,72,00,73,00,74,00,20,00,6c,00,69,00,6e,0 +0,65,00,\ 00,00,73,00,65,00,63,00,6f,00,6e,00,64,00,20,00,6c,00,69,00,6e,00,65 +,00,00,\ 00,74,00,68,00,69,00,72,00,64,00,20,00,6c,00,69,00,6e,00,65,00,00,00 +,00,00 "reg-sz"="string" "expand-sz"=hex(2):25,00,70,00,61,00,74,00,68,00,25,00,00,00
if I use this code:"binary"=3:<one or two non-ASCII character displayed here> "dword"=4:0x00000010 "multi-sz"=7:first<null delimiter here>line-second line<null delimiter + here>third line<null delimiter here><null delimiter here> "reg-sz"=1:string "expand-sz"=2:%path%
use Modern::Perl; use Win32::TieRegistry ( Delimiter=>'/', SplitMultis=>0, FixSzNulls => +1, ArrayValues => 0, qw( REG_SZ REG_EXPAND_SZ REG_DWORD REG_BINARY REG_MULTI_SZ KEY_READ KEY_WRITE KEY_ALL_ACCESS ), ); my $reg_obj = $Registry->Open("LMachine/Software/wwe", { Access=>'KEY_ +READ' } ) or die "Error: $^E\n"; foreach my $value ($reg_obj->ValueNames()) { my ($valuedata, $valuetype) = $reg_obj->GetValue( $value ); my %valuetypes = ( ); say qq{"$value"=$valuetype:$valuedata}; }
I'm looking for a long time for a module or a ready script wich exports the registry in the same format but I didn't found anything until now.
Is there a way to get the "regedit" output without doing manual pack/unpack? I don't want to do it as I'm not really familiar with pack. I know about the possibility to call regedit.exe with an /E parameter (or reg.exe) but this not enough I want to process remote machines too. It would be OK if the solution is limited to Windows plattform, I don't think there is some crasy user who want to start it somewhere else :-) I'm also open to any other ideas. Thank you in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32 registry export
by Anonymous Monk on Jun 16, 2010 at 15:56 UTC | |
by wwe (Friar) on Jun 17, 2010 at 08:29 UTC | |
by wwe (Friar) on Jun 17, 2010 at 12:22 UTC | |
by Anonymous Monk on Jun 17, 2010 at 12:37 UTC | |
by wwe (Friar) on Jun 17, 2010 at 15:05 UTC | |
|