Class: ELFTools::Dynamic::StringTable

Inherits:
Object
  • Object
show all
Defined in:
lib/elftools/dynamic/string_table.rb

Overview

The names a file records, which the tags point at rather than a section.

Answers what Sections::StrTabSection answers, so that what is read from the tags names itself the way what is read from the sections does.

Instance Method Summary collapse

Constructor Details

#initialize(stream, offset) ⇒ StringTable

Instantiate a ELFTools::Dynamic::StringTable object.



17
18
19
20
# File 'lib/elftools/dynamic/string_table.rb', line 17

def initialize(stream, offset)
  @stream = stream
  @offset = offset
end

Instance Method Details

#name_at(offset) ⇒ String

Return the name recorded at an offset into the table.



25
26
27
# File 'lib/elftools/dynamic/string_table.rb', line 25

def name_at(offset)
  Util.cstring(@stream, @offset.call + offset)
end