Class: MachO::Section64

Inherits:
MachOStructure show all
Defined in:
lib/macho/sections.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MachOStructure

bytesize, new_from_bin

Constructor Details

#initialize(sectname, segname, addr, size, offset, align, reloff, nreloc, flags, reserved1, reserved2, reserved3) ⇒ Section64

Returns a new instance of Section64.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/macho/sections.rb', line 101

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

#addrObject (readonly)

Returns the value of attribute addr.



95
96
97
# File 'lib/macho/sections.rb', line 95

def addr
  @addr
end

#alignObject (readonly)

Returns the value of attribute align.



95
96
97
# File 'lib/macho/sections.rb', line 95

def align
  @align
end

#flagsObject (readonly)

Returns the value of attribute flags.



96
97
98
# File 'lib/macho/sections.rb', line 96

def flags
  @flags
end

#nrelocObject (readonly)

Returns the value of attribute nreloc.



96
97
98
# File 'lib/macho/sections.rb', line 96

def nreloc
  @nreloc
end

#offsetObject (readonly)

Returns the value of attribute offset.



95
96
97
# File 'lib/macho/sections.rb', line 95

def offset
  @offset
end

#reloffObject (readonly)

Returns the value of attribute reloff.



95
96
97
# File 'lib/macho/sections.rb', line 95

def reloff
  @reloff
end

#reserved1Object (readonly)

Returns the value of attribute reserved1.



96
97
98
# File 'lib/macho/sections.rb', line 96

def reserved1
  @reserved1
end

#reserved2Object (readonly)

Returns the value of attribute reserved2.



96
97
98
# File 'lib/macho/sections.rb', line 96

def reserved2
  @reserved2
end

#reserved3Object (readonly)

Returns the value of attribute reserved3.



96
97
98
# File 'lib/macho/sections.rb', line 96

def reserved3
  @reserved3
end

#sectnameObject (readonly)

Returns the value of attribute sectname.



95
96
97
# File 'lib/macho/sections.rb', line 95

def sectname
  @sectname
end

#segnameObject (readonly)

Returns the value of attribute segname.



95
96
97
# File 'lib/macho/sections.rb', line 95

def segname
  @segname
end

#sizeObject (readonly)

Returns the value of attribute size.



95
96
97
# File 'lib/macho/sections.rb', line 95

def size
  @size
end

Instance Method Details

#flag?(flag) ⇒ Boolean

Returns:

  • (Boolean)


125
126
127
# File 'lib/macho/sections.rb', line 125

def flag?(flag)
	flags & flag == flag
end

#section_nameObject



117
118
119
# File 'lib/macho/sections.rb', line 117

def section_name
	@sectname.delete("\x00")
end

#segment_nameObject



121
122
123
# File 'lib/macho/sections.rb', line 121

def segment_name
	@segname.delete("\x00")
end