Class: MachO::FatArch

Inherits:
MachOStructure show all
Defined in:
lib/macho/headers.rb

Overview

Fat binary header architecture structure. A Fat binary has one or more of these, representing one or more internal Mach-O blobs.

See Also:

Constant Summary collapse

FORMAT =

always big-endian

"N5"
SIZEOF =
20

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MachOStructure

bytesize, new_from_bin

Constructor Details

#initialize(cputype, cpusubtype, offset, size, align) ⇒ FatArch

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 FatArch.



406
407
408
409
410
411
412
# File 'lib/macho/headers.rb', line 406

def initialize(cputype, cpusubtype, offset, size, align)
  @cputype = cputype
  @cpusubtype = cpusubtype
  @offset = offset
  @size = size
  @align = align
end

Instance Attribute Details

#alignFixnum (readonly)

Returns the alignment, as a power of 2.

Returns:

  • (Fixnum)

    the alignment, as a power of 2



399
400
401
# File 'lib/macho/headers.rb', line 399

def align
  @align
end

#cpusubtypeFixnum (readonly)

Returns the CPU subtype of the Mach-O.

Returns:

  • (Fixnum)

    the CPU subtype of the Mach-O



390
391
392
# File 'lib/macho/headers.rb', line 390

def cpusubtype
  @cpusubtype
end

#cputypeFixnum (readonly)

Returns the CPU type of the Mach-O.

Returns:

  • (Fixnum)

    the CPU type of the Mach-O



387
388
389
# File 'lib/macho/headers.rb', line 387

def cputype
  @cputype
end

#offsetFixnum (readonly)

Returns the file offset to the beginning of the Mach-O data.

Returns:

  • (Fixnum)

    the file offset to the beginning of the Mach-O data



393
394
395
# File 'lib/macho/headers.rb', line 393

def offset
  @offset
end

#sizeFixnum (readonly)

Returns the size, in bytes, of the Mach-O data.

Returns:

  • (Fixnum)

    the size, in bytes, of the Mach-O data



396
397
398
# File 'lib/macho/headers.rb', line 396

def size
  @size
end