Class: Indis::MachO::StringsSectionAnalyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/indis-macho/analyzers/strings_section_analyzer.rb

Instance Method Summary (collapse)

Constructor Details

- (StringsSectionAnalyzer) initialize(target)

A new instance of StringsSectionAnalyzer



24
25
26
27
# File 'lib/indis-macho/analyzers/strings_section_analyzer.rb', line 24

def initialize(target)
  @target = target
  target.subscribe_for_event(:target_section_processed, self)
end

Instance Method Details

- (Object) target_section_processed(sect)



29
30
31
32
33
34
35
36
37
# File 'lib/indis-macho/analyzers/strings_section_analyzer.rb', line 29

def target_section_processed(sect)
  return unless sect.type == :S_CSTRING_LITERALS
  adr = sect.vmaddr
  while adr < sect.vmaddr + sect.vmsize
    e = CStringEntity.new(adr, @target.vmmap)
    @target.vmmap.map!(e)
    adr += e.size
  end
end