Method: Rex::PeScan::Analyze::Fingerprint#scan

Defined in:
lib/rex/pescan/analyze.rb

#scan(param) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/rex/pescan/analyze.rb', line 54

def scan(param)
  config(param)

  epa = pe.hdr.opt.AddressOfEntryPoint
  buf = pe.read_rva(epa, 256) || ""

  @sigs.each_pair do |name, data|
    begin
    if (buf.match(Regexp.new('^' + data[0], nil, 'n')))
      $stdout.puts param['file'] + ": " + name
    end
    rescue RegexpError
      $stderr.puts "Invalid signature: #{name} #{data[0]}"
    end
  end
end