Class: Pliney::MachO::FatArchReader

Inherits:
Reader
  • Object
show all
Defined in:
lib/pliney/macho.rb

Constant Summary collapse

CPU_ARCH_ABI64 =
0x01000000

Instance Attribute Summary collapse

Attributes inherited from Reader

#fh, #startpos

Instance Method Summary collapse

Methods inherited from Reader

#initialize, parse, #rewind

Constructor Details

This class inherits a constructor from Pliney::MachO::Reader

Instance Attribute Details

#alignObject (readonly)

Returns the value of attribute align.



189
190
191
# File 'lib/pliney/macho.rb', line 189

def align
  @align
end

#cpusubtypeObject (readonly)

Returns the value of attribute cpusubtype.



189
190
191
# File 'lib/pliney/macho.rb', line 189

def cpusubtype
  @cpusubtype
end

#cputypeObject (readonly)

Returns the value of attribute cputype.



189
190
191
# File 'lib/pliney/macho.rb', line 189

def cputype
  @cputype
end

#offsetObject (readonly)

Returns the value of attribute offset.



189
190
191
# File 'lib/pliney/macho.rb', line 189

def offset
  @offset
end

#sizeObject (readonly)

Returns the value of attribute size.



189
190
191
# File 'lib/pliney/macho.rb', line 189

def size
  @size
end

Instance Method Details

#macho_readerObject



200
201
202
203
204
205
206
# File 'lib/pliney/macho.rb', line 200

def macho_reader
    if (@cputype & CPU_ARCH_ABI64) == 0
        return MachHeaderReader
    else
        return MachHeader64Reader
    end
end

#parseObject



191
192
193
194
195
196
197
198
# File 'lib/pliney/macho.rb', line 191

def parse()
    super()
    @cputype = @fh.read_uint32
    @cpusubtype = @fh.read_uint32
    @offset = @fh.read_uint32
    @size = @fh.read_uint32
    @align = @fh.read_uint32
end