Class: MachO::LoadCommands::DylinkerCommand
- Inherits:
-
LoadCommand
- Object
- MachOStructure
- LoadCommand
- MachO::LoadCommands::DylinkerCommand
- Defined in:
- lib/macho/load_commands.rb
Overview
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.
Instance Method Summary collapse
-
#name ⇒ LCStr
The dynamic linker's path name as an LCStr.
-
#serialize(context) ⇒ String
private
The serialized fields of the load command.
-
#to_h ⇒ Hash
A hash representation of this DylinkerCommand.
Methods inherited from LoadCommand
#cmd, #cmdsize, create, new_from_bin, #offset, #serializable?, #to_s, #type, #view
Methods inherited from MachOStructure
bytesize, format, #initialize, new_from_bin
Constructor Details
This class inherits a constructor from MachO::MachOStructure
Instance Method Details
#name ⇒ LCStr
Returns the dynamic linker's path name as an LCStr.
665 |
# File 'lib/macho/load_commands.rb', line 665 field :name, :lcstr, :to_s => true |
#serialize(context) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the serialized fields of the load command.
671 672 673 674 675 676 677 678 |
# File 'lib/macho/load_commands.rb', line 671 def serialize(context) format = Utils.specialize_format(self.class.format, context.endianness) string_payload, string_offsets = Utils.pack_strings(self.class.bytesize, context.alignment, :name => name.to_s) cmdsize = self.class.bytesize + string_payload.bytesize [cmd, cmdsize, string_offsets[:name]].pack(format) + string_payload end |
#to_h ⇒ Hash
Returns a hash representation of this MachO::LoadCommands::DylinkerCommand.
681 682 683 684 685 |
# File 'lib/macho/load_commands.rb', line 681 def to_h { "name" => name.to_h, }.merge super end |