class MachO::LoadCommands::DylinkerCommand
A load command representing some aspect of the dynamic linker, depending on filetype. Corresponds to LC_ID_DYLINKER, LC_LOAD_DYLINKER, and LC_DYLD_ENVIRONMENT.
Constants
- FORMAT
@see MachOStructure::FORMAT @api private
- SIZEOF
@see MachOStructure::SIZEOF @api private
Attributes
name[R]
@return [LCStr] the dynamic linker's
path name as an LCStr
Public Class Methods
new(view, cmd, cmdsize, name)
click to toggle source
@api private
Calls superclass method
MachO::LoadCommands::LoadCommand::new
# File lib/macho/load_commands.rb, line 528 def initialize(view, cmd, cmdsize, name) super(view, cmd, cmdsize) @name = LCStr.new(self, name) end
Public Instance Methods
serialize(context)
click to toggle source
@param context [SerializationContext]
the context
@return [String] the serialized fields of the load command @api private
# File lib/macho/load_commands.rb, line 537 def serialize(context) format = Utils.specialize_format(FORMAT, context.endianness) string_payload, string_offsets = Utils.pack_strings(SIZEOF, context.alignment, :name => name.to_s) cmdsize = SIZEOF + string_payload.bytesize [cmd, cmdsize, string_offsets[:name]].pack(format) + string_payload end