Class: MachO::LoadCommands::LinkeditDataCommand
- Inherits:
-
LoadCommand
- Object
- MachOStructure
- LoadCommand
- MachO::LoadCommands::LinkeditDataCommand
- Defined in:
- lib/macho/load_commands.rb
Overview
A load command representing the offsets and sizes of a blob of data in the __LINKEDIT segment. Corresponds to LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO, LC_FUNCTION_STARTS, LC_DATA_IN_CODE, LC_DYLIB_CODE_SIGN_DRS, LC_LINKER_OPTIMIZATION_HINT, LC_DYLD_EXPORTS_TRIE, LC_DYLD_CHAINED_FIXUPS, LC_ATOM_INFO, LC_FUNCTION_VARIANTS, LC_FUNCTION_VARIANT_FIXUPS, or LC_LAZY_LOAD_DYLIB_INFO.
Instance Method Summary collapse
-
#dataoff ⇒ Integer
Offset to the data in the __LINKEDIT segment.
-
#datasize ⇒ Integer
Size of the data in the __LINKEDIT segment.
-
#serialize(context) ⇒ String
private
The serialized fields of the load command.
-
#superblob ⇒ CodeSigning::SuperBlob
The embedded signature referenced by this command.
-
#to_h ⇒ Hash
A hash representation of this LinkeditDataCommand.
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
#dataoff ⇒ Integer
Returns offset to the data in the __LINKEDIT segment.
1089 |
# File 'lib/macho/load_commands.rb', line 1089 field :dataoff, :uint32 |
#datasize ⇒ Integer
Returns size of the data in the __LINKEDIT segment.
1092 |
# File 'lib/macho/load_commands.rb', line 1092 field :datasize, :uint32 |
#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.
1097 1098 1099 1100 1101 1102 |
# File 'lib/macho/load_commands.rb', line 1097 def serialize(context) raise LoadCommandNotSerializableError, type unless serializable? format = Utils.specialize_format(self.class.format, context.endianness) [cmd, self.class.bytesize, dataoff, datasize].pack(format) end |
#superblob ⇒ CodeSigning::SuperBlob
The embedded signature referenced by this command.
1107 1108 1109 1110 1111 |
# File 'lib/macho/load_commands.rb', line 1107 def superblob raise CodeSigningError, "#{type} does not contain a code signature" unless type == :LC_CODE_SIGNATURE CodeSigning::SuperBlob.new(view.raw_data.byteslice(dataoff, datasize)) end |
#to_h ⇒ Hash
Returns a hash representation of this MachO::LoadCommands::LinkeditDataCommand.
1114 1115 1116 1117 1118 1119 |
# File 'lib/macho/load_commands.rb', line 1114 def to_h { "dataoff" => dataoff, "datasize" => datasize, }.merge super end |