lib/macho/macho_file.rb
# Read just the file's magic number and check its validity.
# @return [Integer] the magic
# @raise [MagicError] if the magic is not valid Mach-O magic
# @raise [FatBinaryError] if the magic is for a Fat file
# @api private
Read just the file's magic number and check its validity.
Read just the file ' s magic number and check its validity .
def populate_and_check_magic
      magic = @raw_data[0..3].unpack1("N")
      raise MagicError, magic unless Utils.magic?(magic)
      raise FatBinaryError if Utils.fat_magic?(magic)
      @endianness = Utils.little_magic?(magic) ? :little : :big
      magic
    end
def populate_and_check_magic magic = @raw_data [ 0 .. 3 ] . unpack1 ( "N" ) raise MagicError , magic unless Utils . magic? ( magic ) raise FatBinaryError if Utils . fat_magic? ( magic ) @endianness = Utils . little_magic? ( magic ) ? :little : :big magic end
Read just the file's magic number and check its validity.
Read just the file ' s magic number and check its validity .
None
Integer
[MagicError] if the magic is not valid Mach-O magic
[ MagicError ] if the magic is not valid Mach - O magic
[FatBinaryError] if the magic is for a Fat file
[ FatBinaryError ] if the magic is for a Fat file
api
None