aboutsummaryrefslogtreecommitdiff
path: root/grepbytes.pl
diff options
context:
space:
mode:
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;
+}