Class: Rex::Exploitation::OpcodeDb::Opcode
- Inherits:
-
Object
- Object
- Rex::Exploitation::OpcodeDb::Opcode
- 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
-
#address ⇒ Object
readonly
The address of the opcode.
-
#group ⇒ Object
readonly
A Group instance that reflects the group to which the opcode type found at the instance’s address belongs.
-
#modules ⇒ Object
readonly
An array of ImageModule instances that show the modules that contain this address.
-
#type ⇒ Object
readonly
The type of the opcode indicating which instruction is found at the address.
Attributes included from DbEntry
Attributes included from OpcodeResult
Instance Method Summary collapse
-
#initialize(hash) ⇒ Opcode
constructor
A new instance of Opcode.
Methods included from DbEntry
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
#address ⇒ Object (readonly)
The address of the opcode.
440 441 442 |
# File 'lib/rex/exploitation/opcodedb.rb', line 440 def address @address end |
#group ⇒ Object (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 |
#modules ⇒ Object (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 |
#type ⇒ Object (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 |