Class: Rex::MachParsey::MachBase::LoadCommand

Inherits:
GenericHeader show all
Defined in:
lib/rex/machparsey/machbase.rb

Instance Attribute Summary

Attributes inherited from GenericStruct

#struct

Instance Method Summary collapse

Methods inherited from GenericStruct

#[], #keys, #method_missing, #v

Constructor Details

#initialize(rawdata, endian) ⇒ LoadCommand

Returns a new instance of LoadCommand.



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/rex/machparsey/machbase.rb', line 181

def initialize(rawdata, endian)

  if endian == ENDIAN_MSB
    load_command = LOAD_COMMAND_MSB.make_struct
  else
    load_command = LOAD_COMMAND_LSB.make_struct
  end

  if !load_command.from_s(rawdata)
    raise MachParseError, "Couldn't parse load command"
  end

  self.struct = load_command

end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rex::MachParsey::GenericStruct