Sha256: 13fdbc096b18632c5b9aee2a91bd068e0644bfc256d2f8f4bbf5e65344c16bb7

Contents?: true

Size: 800 Bytes

Versions: 25

Compression:

Stored size: 800 Bytes

Contents

# -*- coding: binary -*-

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

25 entries across 25 versions & 4 rubygems

Version Path
rex-bin_tools-0.1.9 lib/rex/elfscan/search.rb
rex-bin_tools-0.1.8 lib/rex/elfscan/search.rb
rex-bin_tools-0.1.7 lib/rex/elfscan/search.rb
rex-2.0.13 lib/rex/elfscan/search.rb
rex-bin_tools-0.1.6 lib/rex/elfscan/search.rb
rex-bin_tools-0.1.5 lib/rex/elfscan/search.rb
rex-2.0.12 lib/rex/elfscan/search.rb
rex-bin_tools-0.1.4 lib/rex/elfscan/search.rb
rex-2.0.11 lib/rex/elfscan/search.rb
rex-bin_tools-0.1.3 lib/rex/elfscan/search.rb
rex-bin_tools-0.1.2 lib/rex/elfscan/search.rb
rex-bin_tools-0.1.1 lib/rex/elfscan/search.rb
rex-bin_tools-0.1.0 lib/rex/elfscan/search.rb
rex-2.0.10 lib/rex/elfscan/search.rb
rex-2.0.9 lib/rex/elfscan/search.rb
rex-2.0.8 lib/rex/elfscan/search.rb
rex-2.0.7 lib/rex/elfscan/search.rb
rex-2.0.5 lib/rex/elfscan/search.rb
rex-2.0.4 lib/rex/elfscan/search.rb
dstruct-0.0.1 lib/rex/elfscan/search.rb