Class: MachO::Headers::FatArch
- Inherits:
-
MachOStructure
- Object
- MachOStructure
- MachO::Headers::FatArch
- Defined in:
- lib/macho/headers.rb
Overview
"32-bit" indicates the fact that this structure stores 32-bit offsets, not that the Mach-Os that it points to necessarily are 32-bit.
32-bit fat binary header architecture structure. A 32-bit fat Mach-O has one or more of these, indicating one or more internal Mach-O blobs.
Direct Known Subclasses
Instance Method Summary collapse
-
#align ⇒ Integer
The alignment, as a power of 2.
-
#cpusubtype ⇒ Integer
The CPU subtype of the Mach-O.
-
#cputype ⇒ Integer
The CPU type of the Mach-O.
-
#offset ⇒ Integer
The file offset to the beginning of the Mach-O data.
-
#serialize ⇒ String
The serialized fields of the fat arch.
-
#size ⇒ Integer
The size, in bytes, of the Mach-O data.
-
#to_h ⇒ Hash
A hash representation of this FatArch.
Methods inherited from MachOStructure
bytesize, format, #initialize, new_from_bin
Constructor Details
This class inherits a constructor from MachO::MachOStructure
Instance Method Details
#align ⇒ Integer
Returns the alignment, as a power of 2.
559 |
# File 'lib/macho/headers.rb', line 559 field :align, :uint32, :endian => :big |
#cpusubtype ⇒ Integer
Returns the CPU subtype of the Mach-O.
550 |
# File 'lib/macho/headers.rb', line 550 field :cpusubtype, :uint32, :endian => :big, :mask => CPU_SUBTYPE_MASK |
#cputype ⇒ Integer
Returns the CPU type of the Mach-O.
547 |
# File 'lib/macho/headers.rb', line 547 field :cputype, :uint32, :endian => :big |
#offset ⇒ Integer
Returns the file offset to the beginning of the Mach-O data.
553 |
# File 'lib/macho/headers.rb', line 553 field :offset, :uint32, :endian => :big |
#serialize ⇒ String
Returns the serialized fields of the fat arch.
562 563 564 |
# File 'lib/macho/headers.rb', line 562 def serialize [cputype, cpusubtype, offset, size, align].pack(self.class.format) end |
#size ⇒ Integer
Returns the size, in bytes, of the Mach-O data.
556 |
# File 'lib/macho/headers.rb', line 556 field :size, :uint32, :endian => :big |
#to_h ⇒ Hash
Returns a hash representation of this MachO::Headers::FatArch.
567 568 569 570 571 572 573 574 575 576 577 |
# File 'lib/macho/headers.rb', line 567 def to_h { "cputype" => cputype, "cputype_sym" => CPU_TYPES[cputype], "cpusubtype" => cpusubtype, "cpusubtype_sym" => CPU_SUBTYPES[cputype][cpusubtype], "offset" => offset, "size" => size, "align" => align, }.merge super end |