class StringTable

Public Class Methods

new(_st) click to toggle source
Calls superclass method Base::new
# File lib/elfcat/stringtable.rb, line 2
def initialize _st
  super()
  parse _st
end

Public Instance Methods

debug() click to toggle source
# File lib/elfcat/stringtable.rb, line 7
def debug
  @data.each_with_index do |x, i|
    index_s = sprintf("%4d", i)
    name_s = sprintf("%s", x)

    puts "#{index_s} | #{name_s}"
  end
end

Private Instance Methods

parse(_st) click to toggle source
# File lib/elfcat/stringtable.rb, line 17
def parse _st
  entry = _st.get_by_index('.strtab')
  base_elf_address = entry.sh_offset
  length = entry.sh_size

  @data = parse_slice(base_elf_address, length)
end