Class: Elf::NoBits
- Inherits:
-
Object
- Object
- Elf::NoBits
- Defined in:
- lib/mithril/elf.rb
Instance Attribute Summary collapse
-
#addr ⇒ Object
Returns the value of attribute addr.
-
#align ⇒ Object
Returns the value of attribute align.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phdr ⇒ Object
Returns the value of attribute phdr.
-
#phdr_flags ⇒ Object
Returns the value of attribute phdr_flags.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
-
#data ⇒ Object
expect_value “PROGBITS entsize”, @entsize,0.
- #entsize ⇒ Object
-
#initialize(name, shdr) ⇒ NoBits
constructor
A new instance of NoBits.
- #sect_type ⇒ Object
Constructor Details
#initialize(name, shdr) ⇒ NoBits
Returns a new instance of NoBits.
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/mithril/elf.rb', line 76 def initialize(name,shdr) @name = name @addr = shdr.vaddr @flags = shdr.flags expect_value "NOBITS link", shdr.link, 0 expect_value "NOBITS info", shdr.info, 0 @align = shdr.addralign @entsize = shdr.entsize # Expect 0 for now? @size = shdr.siz # expect_value "PROGBITS entsize", @entsize,0 end |
Instance Attribute Details
#addr ⇒ Object
Returns the value of attribute addr.
75 76 77 |
# File 'lib/mithril/elf.rb', line 75 def addr @addr end |
#align ⇒ Object
Returns the value of attribute align.
75 76 77 |
# File 'lib/mithril/elf.rb', line 75 def align @align end |
#flags ⇒ Object
Returns the value of attribute flags.
75 76 77 |
# File 'lib/mithril/elf.rb', line 75 def flags @flags end |
#name ⇒ Object
Returns the value of attribute name.
75 76 77 |
# File 'lib/mithril/elf.rb', line 75 def name @name end |
#phdr ⇒ Object
Returns the value of attribute phdr.
75 76 77 |
# File 'lib/mithril/elf.rb', line 75 def phdr @phdr end |
#phdr_flags ⇒ Object
Returns the value of attribute phdr_flags.
75 76 77 |
# File 'lib/mithril/elf.rb', line 75 def phdr_flags @phdr_flags end |
#size ⇒ Object
Returns the value of attribute size.
75 76 77 |
# File 'lib/mithril/elf.rb', line 75 def size @size end |
Instance Method Details
#data ⇒ Object
expect_value “PROGBITS entsize”, @entsize,0
87 88 89 90 91 |
# File 'lib/mithril/elf.rb', line 87 def data StringIO.new().tap{|x| BinData::Array.new(type: :uint8le,initial_length: @size).write x } end |
#entsize ⇒ Object
95 96 97 |
# File 'lib/mithril/elf.rb', line 95 def entsize 1 end |
#sect_type ⇒ Object
92 93 94 |
# File 'lib/mithril/elf.rb', line 92 def sect_type SHT::SHT_NOBITS end |