1999-03-14 15:00:22 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
# This script takes as STDIN an output from the Registry
|
|
|
|
# (export from regedit.exe) and prefixes every subkey-value
|
|
|
|
# pair by their hkey,key data member
|
|
|
|
#
|
|
|
|
# Copyright 1999 Sylvain St-Germain
|
|
|
|
#
|
|
|
|
|
|
|
|
${prefix} = "";
|
|
|
|
|
|
|
|
LINE: while(<>) {
|
2002-02-28 22:46:43 +01:00
|
|
|
chomp;
|
|
|
|
s/\r$//; # Get rid of 0x0a
|
1999-03-14 15:00:22 +01:00
|
|
|
|
|
|
|
next LINE if(/^$/); # This is an empty line
|
|
|
|
|
|
|
|
if( /^\[/ ) {
|
|
|
|
${prefix} = ${_}; # assign the prefix for the forthcomming section
|
|
|
|
next LINE;
|
|
|
|
}
|
|
|
|
s/\\\\/\\/g; # Still some more substitutions... To fix paths...
|
|
|
|
|
2002-02-28 22:46:43 +01:00
|
|
|
print "${prefix}$_\n";
|
1999-03-14 15:00:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|