Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
877 B

  1. #
  2. # process arguments
  3. #
  4. for (@ARGV) {
  5. if (/^-input=(.*)$/i) { $in_fname = $1; next; }
  6. if (/^-output=(.*)$/i) { $out_fname = $1; next; }
  7. }
  8. open INFILE, $in_fname or die "Could not open 1: $in_fname\n";
  9. open OUTFILE, ">$out_fname" or die "Could not open: $out_fname\n";
  10. @FileLines = <INFILE>;
  11. %Assoc = ( 'HKLM,"SOFTWARE', 'HKLM,"SOFTWARE\Wow6432Node',
  12. 'HKCR,"', 'HKLM,"SOFTWARE\Classes\Wow6432Node\\' );
  13. foreach $Line ( @FileLines ) {
  14. foreach $Pattern ( keys( %Assoc ) ) {
  15. @foo = grep( /Wow6432Node/, $Line);
  16. if (@foo == 0) {
  17. $Line =~ s/^$Pattern/$Assoc{ $Pattern }/i;
  18. $Line =~ s/SOFTWARE\Q\Wow6432Node\Classes/SOFTWARE\\\Classes\\\Wow6432Node/i;
  19. } else {
  20. # $Line =~ s/^$Pattern/$Assoc{ $Pattern }/i;
  21. }
  22. }
  23. print OUTFILE $Line ;
  24. }
  25. close INFILE;
  26. close OUTFILE;