Class: OdinFlex::MachO::LC_LOAD_DYLIB
- Defined in:
- lib/odinflex/mach-o.rb
Constant Summary collapse
- VALUE =
0xc
Instance Attribute Summary
Attributes inherited from Command
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cmd, size, name, str_offset, timestamp, current_version, compat_version) ⇒ LC_LOAD_DYLIB
constructor
A new instance of LC_LOAD_DYLIB.
Methods inherited from Command
Methods included from SectionTypes
#command?, #dysymtab?, #section?, #segment?, #symtab?
Constructor Details
#initialize(cmd, size, name, str_offset, timestamp, current_version, compat_version) ⇒ LC_LOAD_DYLIB
Returns a new instance of LC_LOAD_DYLIB.
136 137 138 139 140 141 142 143 |
# File 'lib/odinflex/mach-o.rb', line 136 def initialize cmd, size, name, str_offset, , current_version, compat_version super(cmd, size) @name = name @str_offset = str_offset @timestamp = @current_version = current_version @compat_version = compat_version end |
Class Method Details
.from_io(cmd, size, offset, io) ⇒ Object
127 128 129 130 131 132 133 134 |
# File 'lib/odinflex/mach-o.rb', line 127 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. args = io.read(4 * 4).unpack('LLLL') io.seek offset + args.first, IO::SEEK_SET name = io.read(size - 8 - (4 * 4)).unpack1('A*') new(cmd, size, name, *args) end |