Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.1.0/lib/macho/fat_file.rb
# Obtain the fat header from raw file data.
# @return [Headers::FatHeader] the fat header
# @raise [TruncatedFileError] if the file is too small to have a
#  valid header
# @raise [MagicError] if the magic is not valid Mach-O magic
# @raise [MachOBinaryError] if the magic is for a non-fat Mach-O file
# @raise [JavaClassFileError] if the file is a Java classfile
# @api private
Obtain the fat header from raw file data.
Obtain the fat header from raw file data .
def populate_fat_header
      raise TruncatedFileError if @raw_data.size < 8
      fh = Headers::FatHeader.new_from_bin(:big, @raw_data[0, Headers::FatHeader.bytesize])
      raise MagicError, fh.magic unless Utils.magic?(fh.magic)
      raise MachOBinaryError unless Utils.fat_magic?(fh.magic)
      raise JavaClassFileError if fh.nfat_arch > 30
      fh
    end
def populate_fat_header raise TruncatedFileError if @raw_data . size < 8 fh = Headers :: FatHeader . new_from_bin ( :big , @raw_data [ 0 , Headers :: FatHeader . bytesize ] ) raise MagicError , fh . magic unless Utils . magic? ( fh . magic ) raise MachOBinaryError unless Utils . fat_magic? ( fh . magic ) raise JavaClassFileError if fh . nfat_arch > 30 fh end
Obtain the fat header from raw file data.
Obtain the fat header from raw file data .
# the smallest fat Mach-O header is 8 bytes # Rationale: Java classfiles have the same magic as big-endian fat # Mach-Os. Classfiles encode their version at the same offset as # `nfat_arch` and the lowest version number is 43, so we error out # if a file claims to have over 30 internal architectures. It's # technically possible for a fat Mach-O to have over 30 architectures, # but this is extremely unlikely and in practice distinguishes the two # formats.
the fat header
the fat header
Headers::FatHeader
[TruncatedFileError] if the file is too small to have a valid header
[ TruncatedFileError ] if the file is too small to have a valid header
[MagicError] if the magic is not valid Mach-O magic
[ MagicError ] if the magic is not valid Mach - O magic
[MachOBinaryError] if the magic is for a non-fat Mach-O file
[ MachOBinaryError ] if the magic is for a non - fat Mach - O file
[JavaClassFileError] if the file is a Java classfile
[ JavaClassFileError ] if the file is a Java classfile
api
None