Package envi :: Class Opcode
[hide private]
[frames] | no frames]

Class Opcode

source code

Known Subclasses:

A universal representation for an opcode

Instance Methods [hide private]
 
__eq__(self, op) source code
 
__hash__(self) source code
 
__init__(self, va, opcode, mnem, prefixes, size, operands, iflags=0)
constructor for the basic Envi Opcode object.
source code
 
__len__(self) source code
 
__ne__(self, op) source code
 
__repr__(self)
Over-ride this if you want to make arch specific repr.
source code
 
getBranches(self, emu=None)
Return a list of tuples.
source code
 
getOperValue(self, idx, emu=None) source code
 
getOperands(self) source code
 
getPrefixName(self)
Get the name of the prefixes associated with the specified architecture specific prefix bitmask.
source code
 
render(self, mcanv)
Render this opcode to the memory canvas passed in.
source code
Class Variables [hide private]
  prefix_names = []
Method Details [hide private]

__init__(self, va, opcode, mnem, prefixes, size, operands, iflags=0)
(Constructor)

source code 

constructor for the basic Envi Opcode object.  Arguments as follows:

opcode   - An architecture specific numerical value for the opcode
mnem     - A humon readable mnemonic for the opcode
prefixes - a bitmask of architecture specific instruction prefixes
size     - The size of the opcode in bytes
operands - A list of Operand objects for this opcode
iflags   - A list of Envi (architecture independant) instruction flags (see IF_FOO)
va       - The virtual address the instruction lives at (used for PC relative immediates etc...)

NOTE: If you want to create an architecture spcific opcode, I'd *highly* recommend you
      just copy/paste in the following simple initial code rather than calling the parent
      constructor.  The extra

getBranches(self, emu=None)

source code 

Return a list of tuples. Each tuple contains the target VA of the branch, and a possible set of flags showing what type of branch it is.

See the BR_FOO types for all the supported envi branch flags.... Example: for bva,bflags in op.getBranches():

render(self, mcanv)

source code 

Render this opcode to the memory canvas passed in. This is used for both simple printing AND more complex representations.