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.
Constant Summary collapse
- FORMAT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"L=3"
- SIZEOF =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
12
Instance Attribute Summary collapse
-
#name ⇒ LCStr
readonly
The dynamic linker's path name as an LCStr.
Attributes inherited from LoadCommand
Instance Method Summary collapse
-
#initialize(view, cmd, cmdsize, name) ⇒ DylinkerCommand
constructor
private
A new instance of DylinkerCommand.
-
#serialize(context) ⇒ String
private
The serialized fields of the load command.
-
#to_h ⇒ Hash
A hash representation of this DylinkerCommand.
Methods inherited from LoadCommand
create, new_from_bin, #offset, #serializable?, #to_s, #type
Methods inherited from MachOStructure
Constructor Details
#initialize(view, cmd, cmdsize, name) ⇒ DylinkerCommand
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 a new instance of DylinkerCommand.
618 619 620 621 |
# File 'lib/macho/load_commands.rb', line 618 def initialize(view, cmd, cmdsize, name) super(view, cmd, cmdsize) @name = LCStr.new(self, name) end |
Instance Attribute Details
#name ⇒ LCStr (readonly)
Returns the dynamic linker's path name as an LCStr.
607 608 609 |
# File 'lib/macho/load_commands.rb', line 607 def name @name end |
Instance Method Details
#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.
627 628 629 630 631 632 633 634 |
# File 'lib/macho/load_commands.rb', line 627 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 |
#to_h ⇒ Hash
Returns a hash representation of this MachO::LoadCommands::DylinkerCommand.
637 638 639 640 641 |
# File 'lib/macho/load_commands.rb', line 637 def to_h { "name" => name.to_h, }.merge super end |