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.
@see MachOStructure::FORMAT @api private
@see MachOStructure::SIZEOF @api private
@return [LCStr] the dynamic linker's
path name as an LCStr
@api private
# File lib/macho/load_commands.rb, line 528 def initialize(view, cmd, cmdsize, name) super(view, cmd, cmdsize) @name = LCStr.new(self, name) end
@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