Quote:
Originally Posted by id10t
So include a copy of strings!
Its already on *nix systems - including OS X - and there are win32 versions available precompiled.
|
Thanks - yes Windows strings is at:
http://technet.microsoft.com/en-us/s.../bb897439.aspx
I downloaded unzipped and placed this in the same folder as the Perl script.
It works straight out of the box (on Windows XP at least) but be aware that first time it is run it will ask for a license agreement, thereafter you wont be asked.
Just for info, I can then regex match the string I am looking for from this - and extract it out using the following code
Code:
# get just printable character sequences from binary file called the string stored in $binaryFilename
my $fileStrings = `strings $binaryFilename`; # note backward single quote to capture output of executing command enclosed
# $fileStrings is just the printable character sequences in the file (minimum 3 chars - see technet link above about how to change)
# do the regex
if ( $fileStrings =~ # a regex here # )
{
# if got here regex found match
# so
# get start and beginning of string using $` and $& Perl global system variables set to values from the last regex
my $embeddedStringStart = length($`);
my $embeddedStringLength = length($&);
my $embeddedString = substr( $fileStrings, $embeddedStringStart, $embeddedStringLength );
# go on to do something with the $embeddedString ...
}
Recent comments
14 hours 52 min ago
19 hours 50 min ago
21 hours 17 min ago
22 hours 10 min ago
23 hours 53 min ago
1 day 4 hours ago
1 day 5 hours ago
1 day 7 hours ago
1 day 20 hours ago
1 day 22 hours ago