Class: Rex::ElfScan::Scanner::Generic
- Inherits:
-
Object
- Object
- Rex::ElfScan::Scanner::Generic
- Defined in:
- lib/rex/elfscan/scanner.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#elf ⇒ Object
Returns the value of attribute elf.
-
#regex ⇒ Object
Returns the value of attribute regex.
Instance Method Summary collapse
- #config(param) ⇒ Object
-
#initialize(elf) ⇒ Generic
constructor
A new instance of Generic.
- #scan(param) ⇒ Object
- #scan_segment(program_header, param = {}) ⇒ Object
Constructor Details
#initialize(elf) ⇒ Generic
Returns a new instance of Generic.
11 12 13 |
# File 'lib/rex/elfscan/scanner.rb', line 11 def initialize(elf) self.elf = elf end |
Instance Attribute Details
#elf ⇒ Object
Returns the value of attribute elf.
9 10 11 |
# File 'lib/rex/elfscan/scanner.rb', line 9 def elf @elf end |
#regex ⇒ Object
Returns the value of attribute regex.
9 10 11 |
# File 'lib/rex/elfscan/scanner.rb', line 9 def regex @regex end |
Instance Method Details
#config(param) ⇒ Object
15 16 |
# File 'lib/rex/elfscan/scanner.rb', line 15 def config(param) end |
#scan(param) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rex/elfscan/scanner.rb', line 18 def scan(param) config(param) $stdout.puts "[#{param['file']}]" elf.program_header.each do |program_header| # Scan only loadable segment entries in the program header table if program_header.p_type == Rex::ElfParsey::ElfBase::PT_LOAD hits = scan_segment(program_header, param) hits.each do |hit| rva = hit[0] = hit[1].is_a?(Array) ? hit[1].join(" ") : hit[1] $stdout.puts elf.ptr_s(rva) + " " + end end end end |
#scan_segment(program_header, param = {}) ⇒ Object
37 38 39 |
# File 'lib/rex/elfscan/scanner.rb', line 37 def scan_segment(program_header, param={}) [] end |