Sha256: 14161f88f1d575eab0490705ead7b20d09f6d010852ca38d32e68eee590e9378

Contents?: true

Size: 950 Bytes

Versions: 7

Compression:

Stored size: 950 Bytes

Contents

#!/usr/bin/env ruby

require 'ragweed'
require 'debuggertux'
require 'pp'
require 'irb'
#include Ragweed

filename = ARGV[0]
pid = ARGV[1].to_i

raise "hittracertux.rb FILE PID" if (ARGV.size < 2 or pid <= 0)

d = Debuggertux.new(pid)
d.attach

File.open(filename, "r") do |fd|
  lines = fd.readlines
  lines.map {|x| x.chomp}
  lines.each do |tl|
    fn, addr = tl.split(",", 2)
    d.breakpoint_set(addr.to_i(16), fn, (bpl = lambda do puts "hit - #{fn} #{addr}\n"; end))
  end
end

d.install_bps
d.continue
catch(:throw) { d.loop }


# An IDC script for generating the text file this hit tracer requires
=begin
#include <idc.idc>

static main()
{
  auto entry, fname, outf, fd;
  outf = AskFile(1, "*.txt", "Please select an output file");
  fd = fopen(outf,"w");
   
	for(entry=NextFunction(0); entry  != BADADDR; entry=NextFunction(entry) )
	{
		fname = GetFunctionName(entry);
		fprintf(fd, "%s,0x%x\n", fname, entry);
 	}

  fclose(fd);
}
=end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
iZsh-ragweed-0.1.8 examples/hittracertux.rb
tduehr-ragweed-0.1.6 examples/hittracertux.rb
tduehr-ragweed-0.1.7.1 examples/hittracertux.rb
tduehr-ragweed-0.1.7.2 examples/hittracertux.rb
tduehr-ragweed-0.1.7 examples/hittracertux.rb
ragweed-0.1.7.3 examples/hittracertux.rb
ragweed-0.1.7.2 examples/hittracertux.rb