Class: OdinFlex::MachO::LC_LOAD_DYLINKER

Inherits:
Command
  • Object
show all
Defined in:
lib/odinflex/mach-o.rb

Constant Summary collapse

VALUE =
0xe

Instance Attribute Summary collapse

Attributes inherited from Command

#cmd, #size

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

#command?, from_offset

Methods included from SectionTypes

#command?, #dysymtab?, #section?, #segment?, #symtab?

Constructor Details

#initialize(cmd, size, offset, name) ⇒ LC_LOAD_DYLINKER

Returns a new instance of LC_LOAD_DYLINKER.



157
158
159
160
161
# File 'lib/odinflex/mach-o.rb', line 157

def initialize cmd, size, offset, name
  super(cmd, size)
  @offset = offset
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



155
156
157
# File 'lib/odinflex/mach-o.rb', line 155

def name
  @name
end

Class Method Details

.from_io(cmd, size, offset, io) ⇒ Object



149
150
151
152
153
# File 'lib/odinflex/mach-o.rb', line 149

def self.from_io cmd, size, offset, io
  # `size` is the total segment size including command and length bytes
  # so we need to remove them from the size.
  new(cmd, size, *io.read(size - 8).unpack('LA*'))
end