mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-05 14:57:30 +01:00
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
This commit is contained in:
parent
2d68d56b63
commit
f4620ffafd
21
correlate.rb
21
correlate.rb
@ -1,11 +1,18 @@
|
||||
#!/usr/local/bin/ruby
|
||||
|
||||
if ARGV.empty?
|
||||
puts "usage: <delta value> <files ...>"
|
||||
puts "usage: <delta value | t> <files ...>"
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user