From 4231e55a1bca84c55a53748944bcd7bada4689ec Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 21 Sep 2016 02:38:57 -0400 Subject: add a couple more perl utils --- grepbytes.pl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 grepbytes.pl (limited to 'grepbytes.pl') diff --git a/grepbytes.pl b/grepbytes.pl new file mode 100644 index 0000000..f356278 --- /dev/null +++ b/grepbytes.pl @@ -0,0 +1,9 @@ +#!/usr/bin/perl -w + +$regex = shift or die "no regex"; +undef $/; +$_ = <>; + +while($_ =~ /$regex/gc) { + printf "match at \$%04X\n", $-[0] + 0x8000; +} -- cgit v1.2.3