Class: MachO::Section
- Inherits:
-
MachOStructure
- Object
- MachOStructure
- MachO::Section
- Defined in:
- lib/macho/sections.rb
Instance Attribute Summary collapse
-
#addr ⇒ Object
readonly
Returns the value of attribute addr.
-
#align ⇒ Object
readonly
Returns the value of attribute align.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#nreloc ⇒ Object
readonly
Returns the value of attribute nreloc.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#reloff ⇒ Object
readonly
Returns the value of attribute reloff.
-
#reserved1 ⇒ Object
readonly
Returns the value of attribute reserved1.
-
#reserved2 ⇒ Object
readonly
Returns the value of attribute reserved2.
-
#sectname ⇒ Object
readonly
Returns the value of attribute sectname.
-
#segname ⇒ Object
readonly
Returns the value of attribute segname.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
- #flag?(flag) ⇒ Boolean
-
#initialize(sectname, segname, addr, size, offset, align, reloff, nreloc, flags, reserved1, reserved2) ⇒ Section
constructor
A new instance of Section.
- #section_name ⇒ Object
- #segment_name ⇒ Object
Methods inherited from MachOStructure
Constructor Details
#initialize(sectname, segname, addr, size, offset, align, reloff, nreloc, flags, reserved1, reserved2) ⇒ Section
Returns a new instance of Section.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/macho/sections.rb', line 66 def initialize(sectname, segname, addr, size, offset, align, reloff, nreloc, flags, reserved1, reserved2) @sectname = sectname @segname = segname @addr = addr @size = size @offset = offset @align = align @reloff = reloff @nreloc = nreloc @flags = flags @reserved1 = reserved1 @reserved2 = reserved2 end |
Instance Attribute Details
#addr ⇒ Object (readonly)
Returns the value of attribute addr.
60 61 62 |
# File 'lib/macho/sections.rb', line 60 def addr @addr end |
#align ⇒ Object (readonly)
Returns the value of attribute align.
60 61 62 |
# File 'lib/macho/sections.rb', line 60 def align @align end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
61 62 63 |
# File 'lib/macho/sections.rb', line 61 def flags @flags end |
#nreloc ⇒ Object (readonly)
Returns the value of attribute nreloc.
61 62 63 |
# File 'lib/macho/sections.rb', line 61 def nreloc @nreloc end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
60 61 62 |
# File 'lib/macho/sections.rb', line 60 def offset @offset end |
#reloff ⇒ Object (readonly)
Returns the value of attribute reloff.
60 61 62 |
# File 'lib/macho/sections.rb', line 60 def reloff @reloff end |
#reserved1 ⇒ Object (readonly)
Returns the value of attribute reserved1.
61 62 63 |
# File 'lib/macho/sections.rb', line 61 def reserved1 @reserved1 end |
#reserved2 ⇒ Object (readonly)
Returns the value of attribute reserved2.
61 62 63 |
# File 'lib/macho/sections.rb', line 61 def reserved2 @reserved2 end |
#sectname ⇒ Object (readonly)
Returns the value of attribute sectname.
60 61 62 |
# File 'lib/macho/sections.rb', line 60 def sectname @sectname end |
#segname ⇒ Object (readonly)
Returns the value of attribute segname.
60 61 62 |
# File 'lib/macho/sections.rb', line 60 def segname @segname end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
60 61 62 |
# File 'lib/macho/sections.rb', line 60 def size @size end |
Instance Method Details
#flag?(flag) ⇒ Boolean
89 90 91 |
# File 'lib/macho/sections.rb', line 89 def flag?(flag) flags & flag == flag end |
#section_name ⇒ Object
81 82 83 |
# File 'lib/macho/sections.rb', line 81 def section_name @sectname.delete("\x00") end |
#segment_name ⇒ Object
85 86 87 |
# File 'lib/macho/sections.rb', line 85 def segment_name @segname.delete("\x00") end |