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.



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

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.



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

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.



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

def group
  @group
end

#modulesObject (readonly)

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



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

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.



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

def type
  @type
end