1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
Description: modify rip.pl for use on *nix
Forwarded: not-needed
Author: Jan Gruber <j4n6ru@gmail.com>
Last-Update: 2025-12-21
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/rip.pl
+++ b/rip.pl
@@ -1,4 +1,4 @@
-#! c:\perl\bin\perl.exe
+#!/usr/bin/perl
#-------------------------------------------------------------------------
# Rip - RegRipper, CLI version
# Use this utility to run a plugins file or a single plugin against a Reg
@@ -31,6 +31,9 @@
# Author: H. Carvey, keydet89@yahoo.com
#-------------------------------------------------------------------------
use strict;
+# Add /usr/lib/regripper to the include path, to ensure that the patched
+# versions of Parse::Win32Registry's Base.pm, File.pm and Key.pm are used
+use lib '/usr/lib/regripper';
use Parse::Win32Registry qw(:REG_);
use Getopt::Long;
use Time::Local;
@@ -59,24 +62,15 @@
Getopt::Long::Configure("prefix_pattern=(-|\/)");
GetOptions(\%config,qw(reg|r=s file|f=s csv|c dirty|d auto|a autoTLN|aT guess|g user|u=s sys|s=s plugin|p=s update|uP list|l help|?|h));
-# Code updated 20090102
-my @path;
-# Code updated 20241031
-my $str = abs_path($0);
-($^O eq "MSWin32") ? (@path = split(/\\/,$0))
- : (@path = split(/\//,$0));
-$str =~ s/($path[scalar(@path) - 1])//;
-
-# Suggested addition by Hal Pomeranz for compatibility with Linux
-#push(@INC,$str);
-# code updated 20190318
-my $plugindir;
-($^O eq "MSWin32") ? ($plugindir = $str."plugins/")
- : ($plugindir = File::Spec->catfile($str, "plugins"));
-#my $plugindir = $str."plugins/";
-#my $plugindir = File::Spec->catfile("plugins");
-#print "Plugins Dir = ".$plugindir."\n";
-# End code update
+# Retrieves the absolute path to rip.pl, even if called by a symlink
+my $scriptpath = Cwd::realpath($0);
+
+# Retrieves the absolute path of rip.pl's parent directory
+my $scriptdir = File::Basename::dirname($scriptpath);
+
+# Sets plugin directory
+my $plugindir = File::Spec->catdir($scriptdir, "plugins");
+
my $VERSION = "3\.0";
my @alerts = ();
|