class Pliney::MachO::FatHeaderReader

Attributes

fat_arches[R]
magic[R]
nfat_arch[R]

Public Instance Methods

each_macho() { |macho_reader.parse(fh)| ... } click to toggle source
# File lib/pliney/macho.rb, line 178
def each_macho()
    @fat_arches.each do |arch|
        @fh.pos = @startpos + arch.offset
        yield arch.macho_reader.parse(@fh)
    end
end
machos() click to toggle source
# File lib/pliney/macho.rb, line 172
def machos()
    a = []
    each_macho {|mh| a << mh}
    return a
end
parse() click to toggle source
Calls superclass method Pliney::MachO::Reader::parse
# File lib/pliney/macho.rb, line 161
def parse()
    super()
    @magic = @fh.read_uint32
    @nfat_arch = @fh.read_uint32
    @fat_arches = Array.new(@nfat_arch) { FatArchReader.parse(@fh) }

    unless MachO::is_fat_magic(@magic)
        raise(ReaderError, "Unexpected magic value for FAT header: 0x%0.8x" % @magic)
    end
end