Class: MachO::Section64
- Inherits:
-
MachOStructure
- Object
- MachOStructure
- MachO::Section64
- Defined in:
- lib/macho/sections.rb
Overview
Represents a section of a segment for 64-bit architectures.
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.
-
#reserved3 ⇒ Object
readonly
Returns the value of attribute reserved3.
-
#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
True if ‘flag` is present in the sections’s flag field.
-
#initialize(sectname, segname, addr, size, offset, align, reloff, nreloc, flags, reserved1, reserved2, reserved3) ⇒ Section64
constructor
A new instance of Section64.
-
#section_name ⇒ String
The section’s name, with any trailing NULL characters removed.
-
#segment_name ⇒ String
The parent segment’s name, with any trailing NULL characters removed.
Methods inherited from MachOStructure
Constructor Details
#initialize(sectname, segname, addr, size, offset, align, reloff, nreloc, flags, reserved1, reserved2, reserved3) ⇒ Section64
Returns a new instance of Section64.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/macho/sections.rb', line 111 def initialize(sectname, segname, addr, size, offset, align, reloff, nreloc, flags, reserved1, reserved2, reserved3) @sectname = sectname @segname = segname @addr = addr @size = size @offset = offset @align = align @reloff = reloff @nreloc = nreloc @flags = flags @reserved1 = reserved1 @reserved2 = reserved2 @reserved3 = reserved3 end |
Instance Attribute Details
#addr ⇒ Object (readonly)
Returns the value of attribute addr.
104 105 106 |
# File 'lib/macho/sections.rb', line 104 def addr @addr end |
#align ⇒ Object (readonly)
Returns the value of attribute align.
104 105 106 |
# File 'lib/macho/sections.rb', line 104 def align @align end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
105 106 107 |
# File 'lib/macho/sections.rb', line 105 def flags @flags end |
#nreloc ⇒ Object (readonly)
Returns the value of attribute nreloc.
105 106 107 |
# File 'lib/macho/sections.rb', line 105 def nreloc @nreloc end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
104 105 106 |
# File 'lib/macho/sections.rb', line 104 def offset @offset end |
#reloff ⇒ Object (readonly)
Returns the value of attribute reloff.
104 105 106 |
# File 'lib/macho/sections.rb', line 104 def reloff @reloff end |
#reserved1 ⇒ Object (readonly)
Returns the value of attribute reserved1.
105 106 107 |
# File 'lib/macho/sections.rb', line 105 def reserved1 @reserved1 end |
#reserved2 ⇒ Object (readonly)
Returns the value of attribute reserved2.
105 106 107 |
# File 'lib/macho/sections.rb', line 105 def reserved2 @reserved2 end |
#reserved3 ⇒ Object (readonly)
Returns the value of attribute reserved3.
105 106 107 |
# File 'lib/macho/sections.rb', line 105 def reserved3 @reserved3 end |
#sectname ⇒ Object (readonly)
Returns the value of attribute sectname.
104 105 106 |
# File 'lib/macho/sections.rb', line 104 def sectname @sectname end |
#segname ⇒ Object (readonly)
Returns the value of attribute segname.
104 105 106 |
# File 'lib/macho/sections.rb', line 104 def segname @segname end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
104 105 106 |
# File 'lib/macho/sections.rb', line 104 def size @size end |
Instance Method Details
#flag?(flag) ⇒ Boolean
Returns true if ‘flag` is present in the sections’s flag field.
141 142 143 |
# File 'lib/macho/sections.rb', line 141 def flag?(flag) flags & flag == flag end |
#section_name ⇒ String
Returns the section’s name, with any trailing NULL characters removed.
128 129 130 |
# File 'lib/macho/sections.rb', line 128 def section_name @sectname.delete("\x00") end |
#segment_name ⇒ String
Returns the parent segment’s name, with any trailing NULL characters removed.
133 134 135 |
# File 'lib/macho/sections.rb', line 133 def segment_name @segname.delete("\x00") end |