Class: ElfUtils::Section::Strtab

Inherits:
Base
  • Object
show all
Defined in:
lib/elf_utils/section/strtab.rb

Instance Attribute Summary

Attributes inherited from Base

#header

Instance Method Summary collapse

Methods inherited from Base

#addr, #alloc?, #bytes, #flags, #initialize, #inspect, #load_segment, #name, #offset, #relocate, #relocation_offset, #size, #symbol, #symbols, #to_range

Constructor Details

This class inherits a constructor from ElfUtils::Section::Base

Instance Method Details

#[](index) ⇒ Object



3
4
5
6
7
# File 'lib/elf_utils/section/strtab.rb', line 3

def [](index)
  @strings ||= bytes
  str = @strings[index..].unpack1("Z*")
  str.empty? ? nil : str
end