Class: Elf::ProgBits
- Inherits:
-
Object
- Object
- Elf::ProgBits
- 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.
-
#data ⇒ Object
Returns the value of attribute data.
-
#entsize ⇒ Object
Returns the value of attribute entsize.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phdr ⇒ Object
Makes a PHDR for this section.
-
#phdr_flags ⇒ Object
Makes a PHDR for this section.
-
#sect_type ⇒ Object
Returns the value of attribute sect_type.
Instance Method Summary collapse
-
#initialize(name, shdr = nil, data = "") ⇒ ProgBits
constructor
A new instance of ProgBits.
- #size ⇒ Object
Constructor Details
#initialize(name, shdr = nil, data = "") ⇒ ProgBits
Returns a new instance of ProgBits.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/mithril/elf.rb', line 48 def initialize(name,shdr = nil,data = "") @data = StringIO.new(data) @name = name if shdr.nil? @addr = nil @flags = 0 @align = 0 @entsize = 0 @sect_type = 0 else @addr = shdr.vaddr @flags = shdr.flags expect_value "PROGBITS link", shdr.link, 0 expect_value "PROGBITS info", shdr.info, 0 @align = shdr.addralign @entsize = shdr.entsize # Expect 0 for now? @sect_type = shdr.type.to_i # expect_value "PROGBITS entsize", @entsize,0 expect_value "Progbits must be full present", @data.size, shdr.siz end end |
Instance Attribute Details
#addr ⇒ Object
Returns the value of attribute addr.
45 46 47 |
# File 'lib/mithril/elf.rb', line 45 def addr @addr end |
#align ⇒ Object
Returns the value of attribute align.
45 46 47 |
# File 'lib/mithril/elf.rb', line 45 def align @align end |
#data ⇒ Object
Returns the value of attribute data.
45 46 47 |
# File 'lib/mithril/elf.rb', line 45 def data @data end |
#entsize ⇒ Object
Returns the value of attribute entsize.
45 46 47 |
# File 'lib/mithril/elf.rb', line 45 def entsize @entsize end |
#flags ⇒ Object
Returns the value of attribute flags.
45 46 47 |
# File 'lib/mithril/elf.rb', line 45 def flags @flags end |
#name ⇒ Object
Returns the value of attribute name.
45 46 47 |
# File 'lib/mithril/elf.rb', line 45 def name @name end |
#phdr ⇒ Object
Makes a PHDR for this section
46 47 48 |
# File 'lib/mithril/elf.rb', line 46 def phdr @phdr end |
#phdr_flags ⇒ Object
Makes a PHDR for this section
46 47 48 |
# File 'lib/mithril/elf.rb', line 46 def phdr_flags @phdr_flags end |
#sect_type ⇒ Object
Returns the value of attribute sect_type.
47 48 49 |
# File 'lib/mithril/elf.rb', line 47 def sect_type @sect_type end |
Instance Method Details
#size ⇒ Object
70 71 72 |
# File 'lib/mithril/elf.rb', line 70 def size @data.size end |