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".freeze
- 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.
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.
532 533 534 535 |
# File 'lib/macho/load_commands.rb', line 532 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.
521 522 523 |
# File 'lib/macho/load_commands.rb', line 521 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.
541 542 543 544 545 546 547 548 |
# File 'lib/macho/load_commands.rb', line 541 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 |