Class: OdinFlex::MachO::Command

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SectionTypes

#dysymtab?, #section?, #segment?, #symtab?

Constructor Details

#initialize(cmd, size) ⇒ Command

Returns a new instance of Command.



78
79
80
81
# File 'lib/odinflex/mach-o.rb', line 78

def initialize cmd, size
  @cmd = cmd
  @size = size
end

Instance Attribute Details

#cmdObject (readonly)

Returns the value of attribute cmd.



70
71
72
# File 'lib/odinflex/mach-o.rb', line 70

def cmd
  @cmd
end

#sizeObject (readonly)

Returns the value of attribute size.



70
71
72
# File 'lib/odinflex/mach-o.rb', line 70

def size
  @size
end

Class Method Details

.from_offset(offset, io) ⇒ Object



72
73
74
75
76
# File 'lib/odinflex/mach-o.rb', line 72

def self.from_offset offset, io
  io.seek offset, IO::SEEK_SET
  cmd, size = io.read(2 * 4).unpack('LL')
  from_io cmd, size, offset, io
end

Instance Method Details

#command?Boolean

Returns:

  • (Boolean)


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

def command?; true; end