Class: Pliney::MachO::CommonLCReader

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

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

#cmdObject (readonly)

Returns the value of attribute cmd.



335
336
337
# File 'lib/pliney/macho.rb', line 335

def cmd
  @cmd
end

#cmdsizeObject (readonly)

Returns the value of attribute cmdsize.



335
336
337
# File 'lib/pliney/macho.rb', line 335

def cmdsize
  @cmdsize
end

Instance Method Details

#parseObject



336
337
338
339
340
341
342
343
# File 'lib/pliney/macho.rb', line 336

def parse()
    super()
    @cmd = @fh.read_uint32le
    @cmdsize = @fh.read_uint32le
    if @cmdsize < 8
        raise(ReaderError, "Load command size too small (#{@cmdsize} bytes) at offset #{@fh.pos - 4}")
    end
end

#resolve_typeObject



345
346
347
# File 'lib/pliney/macho.rb', line 345

def resolve_type()
    MachO::resolve_lc(@cmd)
end