Class: Rex::Exploitation::OpcodeDb::Type

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

Overview

An opcode type (jmp esp).

Instance Attribute Summary collapse

Attributes included from DbEntry

#id, #name

Attributes included from OpcodeResult

#hash

Instance Method Summary collapse

Methods included from Cachable

create, flush_cache, hash_key

Methods included from DbEntry

#filter_hash

Constructor Details

#initialize(hash) ⇒ Type

Returns a new instance of Type


375
376
377
378
379
380
381
382
# File 'lib/rex/exploitation/opcodedb.rb', line 375

def initialize(hash)
  super

  @opcodes   = (hash['opcodes']) ? hash['opcodes'].to_i : 0
  @meta_type = MetaType.create(hash['meta_type']) if (hash['meta_type'])
  @group     = Group.create(hash['group']) if (hash['group'])
  @arch      = hash['arch']
end

Instance Attribute Details

#archObject (readonly)

The architecture that this opcode type is associated with.


400
401
402
# File 'lib/rex/exploitation/opcodedb.rb', line 400

def arch
  @arch
end

#groupObject (readonly)

An instance of the Group to which this opcode type belongs, or nil.


396
397
398
# File 'lib/rex/exploitation/opcodedb.rb', line 396

def group
  @group
end

#meta_typeObject (readonly)

An instance of the MetaType to which this opcode type belongs, or nil.


392
393
394
# File 'lib/rex/exploitation/opcodedb.rb', line 392

def meta_type
  @meta_type
end

#opcodesObject (readonly)

The number of opcodes associated with this type, or 0 if this information is not available.


388
389
390
# File 'lib/rex/exploitation/opcodedb.rb', line 388

def opcodes
  @opcodes
end