Sha256: 5643a52d5082a17dbb7a06c88cde460e8a91c39ee3845eb2dfd88e8694dd4425

Contents?: true

Size: 780 Bytes

Versions: 40

Compression:

Stored size: 780 Bytes

Contents

#!/usr/bin/env ruby

# $Id: search.rb 10173 2010-08-27 21:26:59Z jduck $

module Rex
module ElfScan
module Search

	class DumpRVA
		attr_accessor :elf

		def initialize(elf)
			self.elf = elf
		end

		def config(param)
			@address = param['args']
		end

		def scan(param)
			config(param)

			$stdout.puts "[#{param['file']}]"

			# Adjust based on -A and -B flags
			pre = param['before'] || 0
			suf = param['after']  || 16

			@address -= pre
			@address = 0 if (@address < 0 || ! @address)
			buf = elf.read_rva(@address, suf)
			$stdout.puts elf.ptr_s(@address) + " " + buf.unpack("H*")[0]
		end
	end

	class DumpOffset < DumpRVA
		def config(param)
			begin
				@address = elf.offset_to_rva(param['args'])
			rescue Rex::ElfParsey::BoundsError
			end
		end
	end
end
end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
librex-0.0.65 lib/rex/elfscan/search.rb
librex-0.0.63 lib/rex/elfscan/search.rb
librex-0.0.54 lib/rex/elfscan/search.rb
librex-0.0.53 lib/rex/elfscan/search.rb
librex-0.0.52 lib/rex/elfscan/search.rb
librex-0.0.51 lib/rex/elfscan/search.rb
librex-0.0.50 lib/rex/elfscan/search.rb
librex-0.0.49 lib/rex/elfscan/search.rb
librex-0.0.48 lib/rex/elfscan/search.rb
librex-0.0.47 lib/rex/elfscan/search.rb
librex-0.0.46 lib/rex/elfscan/search.rb
librex-0.0.44 lib/rex/elfscan/search.rb
librex-0.0.43 lib/rex/elfscan/search.rb
librex-0.0.42 lib/rex/elfscan/search.rb
librex-0.0.41 lib/rex/elfscan/search.rb
librex-0.0.40 lib/rex/elfscan/search.rb
librex-0.0.39 lib/rex/elfscan/search.rb
librex-0.0.38 lib/rex/elfscan/search.rb
librex-0.0.37 lib/rex/elfscan/search.rb
librex-0.0.36 lib/rex/elfscan/search.rb