From f4620ffafd9377e178839b23c1ccb9c628a9c285 Mon Sep 17 00:00:00 2001 From: Spoon M Date: Mon, 9 May 2005 22:01:28 +0000 Subject: [PATCH] added text mode to support not treating the lines as numbers git-svn-id: file:///home/svn/incoming/trunk@2487 4d416f70-5f16-0410-b530-b9f4589650da --- correlate.rb | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/correlate.rb b/correlate.rb index 245c38d1bc..c182a2b9a3 100644 --- a/correlate.rb +++ b/correlate.rb @@ -1,11 +1,18 @@ #!/usr/local/bin/ruby if ARGV.empty? - puts "usage: " + puts "usage: " exit(1) end -delta = ARGV.shift.to_i +textmode = false + +if ARGV[0] == 't' + ARGV.shift + textmode = true +else + delta = ARGV.shift.to_i +end first = TRUE last = [ ] @@ -17,9 +24,13 @@ last = [ ] ARGV.each do |file| cur = [ ] IO.foreach(file) do |line| - addr = line.hex - (-delta .. delta).each do |d| - cur << addr + d + if textmode + cur << line + else + addr = line.hex + (-delta .. delta).each do |d| + cur << addr + d + end end end