Class: MachO::LoadCommand
- Inherits:
-
MachOStructure
- Object
- MachOStructure
- MachO::LoadCommand
- Defined in:
- lib/macho/load_commands.rb
Overview
Mach-O load command structure this is the most generic load command - only cmd ID and size are represented, and no actual data. used when a more specific class isn’t available/implemented
Direct Known Subclasses
DyldInfoCommand, DylibCommand, DylinkerCommand, DysymtabCommand, EncryptionInfoCommand, EncryptionInfoCommand64, EntryPointCommand, LinkeditDataCommand, LinkerOptionCommand, PrebindCksumCommand, PreboundDylibCommand, RoutinesCommand, RoutinesCommand64, RpathCommand, SegmentCommand, SegmentCommand64, SourceVersionCommand, SubClientCommand, SubFrameworkCommand, SubLibraryCommand, SubUmbrellaCommand, SymtabCommand, ThreadCommand, TwolevelHintsCommand, UUIDCommand, VersionMinCommand
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
-
#cmdsize ⇒ Object
readonly
Returns the value of attribute cmdsize.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(offset, cmd, cmdsize) ⇒ LoadCommand
constructor
A new instance of LoadCommand.
- #to_s ⇒ Object
Methods inherited from MachOStructure
Constructor Details
#initialize(offset, cmd, cmdsize) ⇒ LoadCommand
Returns a new instance of LoadCommand.
186 187 188 189 190 |
# File 'lib/macho/load_commands.rb', line 186 def initialize(offset, cmd, cmdsize) @offset = offset @cmd = cmd @cmdsize = cmdsize end |
Instance Attribute Details
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
177 178 179 |
# File 'lib/macho/load_commands.rb', line 177 def cmd @cmd end |
#cmdsize ⇒ Object (readonly)
Returns the value of attribute cmdsize.
177 178 179 |
# File 'lib/macho/load_commands.rb', line 177 def cmdsize @cmdsize end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
177 178 179 |
# File 'lib/macho/load_commands.rb', line 177 def offset @offset end |
Class Method Details
.new_from_bin(offset, bin) ⇒ Object
182 183 184 |
# File 'lib/macho/load_commands.rb', line 182 def self.new_from_bin(offset, bin) self.new(offset, *bin.unpack(@format)) end |
Instance Method Details
#to_s ⇒ Object
192 193 194 |
# File 'lib/macho/load_commands.rb', line 192 def to_s LOAD_COMMANDS[cmd] end |