Class: OdinFlex::MachO::LC_SEGMENT_64

Inherits:
Command
  • Object
show all
Defined in:
lib/odinflex/mach-o.rb

Constant Summary collapse

VALUE =
0x19
SIZE =

segname

16 + # segname
8 + # vmaddr
8 + # vmsize
8 + # fileoff
8 + # filesize
4 + # maxprot
4 + # initprot
4 + # nsects
4

Instance Attribute Summary collapse

Attributes inherited from Command

#cmd, #size

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

#command?, from_offset

Methods included from SectionTypes

#command?, #dysymtab?, #section?, #symtab?

Constructor Details

#initialize(cmd, size, segname, vmaddr, vmsize, fileoff, filesize, maxprot, initprot, nsects, flags) ⇒ LC_SEGMENT_64

Returns a new instance of LC_SEGMENT_64.



424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/odinflex/mach-o.rb', line 424

def initialize cmd, size, segname, vmaddr, vmsize, fileoff, filesize, maxprot, initprot, nsects, flags
  super(cmd, size)
  @segname  = segname
  @vmaddr   = vmaddr
  @vmsize   = vmsize
  @fileoff  = fileoff
  @filesize = filesize
  @maxprot  = maxprot
  @initprot = initprot
  @nsects   = nsects
  @flags    = flags
end

Instance Attribute Details

#fileoffObject (readonly)

Returns the value of attribute fileoff.



422
423
424
# File 'lib/odinflex/mach-o.rb', line 422

def fileoff
  @fileoff
end

#filesizeObject (readonly)

Returns the value of attribute filesize.



422
423
424
# File 'lib/odinflex/mach-o.rb', line 422

def filesize
  @filesize
end

#flagsObject (readonly)

Returns the value of attribute flags.



422
423
424
# File 'lib/odinflex/mach-o.rb', line 422

def flags
  @flags
end

#initprotObject (readonly)

Returns the value of attribute initprot.



422
423
424
# File 'lib/odinflex/mach-o.rb', line 422

def initprot
  @initprot
end

#maxprotObject (readonly)

Returns the value of attribute maxprot.



422
423
424
# File 'lib/odinflex/mach-o.rb', line 422

def maxprot
  @maxprot
end

#nsectsObject (readonly)

Returns the value of attribute nsects.



422
423
424
# File 'lib/odinflex/mach-o.rb', line 422

def nsects
  @nsects
end

#segnameObject (readonly)

Returns the value of attribute segname.



422
423
424
# File 'lib/odinflex/mach-o.rb', line 422

def segname
  @segname
end

#vmaddrObject (readonly)

Returns the value of attribute vmaddr.



422
423
424
# File 'lib/odinflex/mach-o.rb', line 422

def vmaddr
  @vmaddr
end

#vmsizeObject (readonly)

Returns the value of attribute vmsize.



422
423
424
# File 'lib/odinflex/mach-o.rb', line 422

def vmsize
  @vmsize
end

Class Method Details

.from_io(cmd, size, offset, io) ⇒ Object

flags



418
419
420
# File 'lib/odinflex/mach-o.rb', line 418

def self.from_io cmd, size, offset, io
  new(cmd, size, *io.read(SIZE).unpack('A16Q4L4'))
end

Instance Method Details

#segment?Boolean

Returns:

  • (Boolean)


437
# File 'lib/odinflex/mach-o.rb', line 437

def segment?; true; end