Class: Rex::Exploitation::OpcodeDb::Opcode

Inherits:
Object
  • Object
show all
Includes:
DbEntry
Defined in:
lib/rex/exploitation/opcodedb.rb

Overview

An opcode that has a specific address and is associated with one or more modules.

Instance Attribute Summary collapse

Attributes included from DbEntry

#id, #name

Attributes included from OpcodeResult

#hash

Instance Method Summary collapse

Methods included from DbEntry

#filter_hash

Constructor Details

#initialize(hash) ⇒ Opcode

Returns a new instance of Opcode.



424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/rex/exploitation/opcodedb.rb', line 424

def initialize(hash)
  super

  @address = hash['address'].to_i
  @type    = Type.create(hash['type'])
  @group   = @type.group
  @modules = hash['modules'].map { |ent|
    ImageModule.create(ent)
  } if (hash['modules'])

  @modules = [] unless(@modules)
end

Instance Attribute Details

#addressObject (readonly)

The address of the opcode.



440
441
442
# File 'lib/rex/exploitation/opcodedb.rb', line 440

def address
  @address
end

#groupObject (readonly)

A Group instance that reflects the group to which the opcode type found at the instance’s address belongs.



450
451
452
# File 'lib/rex/exploitation/opcodedb.rb', line 450

def group
  @group
end

#modulesObject (readonly)

An array of ImageModule instances that show the modules that contain this address.



455
456
457
# File 'lib/rex/exploitation/opcodedb.rb', line 455

def modules
  @modules
end

#typeObject (readonly)

The type of the opcode indicating which instruction is found at the address. This is an instance of the Type class.



445
446
447
# File 'lib/rex/exploitation/opcodedb.rb', line 445

def type
  @type
end