Methods

Class/Module Index [+]

Quicksearch

Rex::MachParsey::FatBase::FatHeader

Attributes

endian[RW]
exists[RW]
nfat_arch[RW]

Public Class Methods

new(rawdata) click to toggle source
# File lib/rex/machparsey/machbase.rb, line 349
def initialize(rawdata)
        fat_header = FAT_HEADER_LSB.make_struct
        if !fat_header.from_s(rawdata)
                #raise something
        end

        magic = fat_header.v['magic']
        if magic == FAT_MAGIC
                endian = ENDIAN_LSB
        elsif magic == FAT_CIGAM
                endian = ENDIAN_MSB
                fat_header = FAT_HEADER_MSB.make_struct
                if !fat_header.from_s(rawdata)
                        raise FatHeaderError, "Could not parse FAT header"
                end
        else
                self.exists = 0
                return
        end

        self.nfat_arch = fat_header.v['nfat_arch']
        self.struct = fat_header
        self.endian = endian
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.