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.
12 13 14 |
# File 'lib/rex/elfscan/scanner.rb', line 12 def initialize(elf) self.elf = elf end |
Instance Attribute Details
#elf ⇒ Object
Returns the value of attribute elf.
10 11 12 |
# File 'lib/rex/elfscan/scanner.rb', line 10 def elf @elf end |
#regex ⇒ Object
Returns the value of attribute regex.
10 11 12 |
# File 'lib/rex/elfscan/scanner.rb', line 10 def regex @regex end |
Instance Method Details
#config(param) ⇒ Object
16 17 |
# File 'lib/rex/elfscan/scanner.rb', line 16 def config(param) end |
#scan(param) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rex/elfscan/scanner.rb', line 19 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
38 39 40 |
# File 'lib/rex/elfscan/scanner.rb', line 38 def scan_segment(program_header, param={}) [] end |