aboutsummaryrefslogtreecommitdiff
path: root/grepbytes.pl
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-09-21 02:38:57 -0400
committerB. Watson <yalhcru@gmail.com>2016-09-21 02:38:57 -0400
commit4231e55a1bca84c55a53748944bcd7bada4689ec (patch)
tree17008b177d04545bc967b7b064e6cdc5c1ae8123 /grepbytes.pl
parent9b629fdffebaf36d4ce6080a9390ec101ecdef5b (diff)
downloadjumpmanjr-4231e55a1bca84c55a53748944bcd7bada4689ec.tar.gz
add a couple more perl utils
Diffstat (limited to 'grepbytes.pl')
-rw-r--r--grepbytes.pl9
1 files changed, 9 insertions, 0 deletions
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;
+}