Package envi
[hide private]
[frames] | no frames]

Package envi

source code

The Envi framework allows architecture abstraction through the use of the ArchitectureModule, Opcode, Operand, and Emulator objects.

Submodules [hide private]

Classes [hide private]
  ArchitectureModule
An architecture module implementes methods to deal with the creation of envi objects for the specified architecture.
  EnviException
  InvalidInstruction
Raised by opcode parsers when the specified bytes do not represent a valid opcode
  SegmentationViolation
Raised by an Emulator extension when you bad-touch memory.
  ArchNotImplemented
Raised by various Envi components when the architecture does not implement that envi component.
  EmuException
A parent for all emulation exceptions so catching them can be easy.
  UnsupportedInstruction
Raised by emulators when the given instruction is not implemented by the emulator.
  DivideByZero
Raised by an Emulator when a divide/mod has a 0 divisor...
  BreakpointHit
Raised by an emulator when you execute a breakpoint instruction
  PDEUndefinedFlag
This exception is raised when a conditional operation is dependant on a flag state that is unknown.
  PDEException
This exception is used in partially defined emulation to signal where execution flow becomes un-known due to undefined values.
  UnknownCallingConvention
Raised when the getCallArgs() or execCallReturn() methods are given an unknown calling convention type.
  MapOverlapException
Raised when adding a memory map to a MemoryObject which overlaps with another already existing map.
  Operand
Thses are the expected methods needed by any implemented operand object attached to an envi Opcode.
  DerefOper
  ImmedOper
  RegisterOper
  Opcode
A universal representation for an opcode
  Emulator
The Emulator class is mostly "Abstract" in the java Interface sense.
  CallingConvention
Base class for all calling conventions.
Functions [hide private]
 
stealArchMethods(obj, archname)
Used by objects which are expected to inherit from an architecture module but don't know which one until runtime!
source code
 
getArchByName(archname)
Get the architecture constant by the humon name.
source code
 
getArchById(archid)
Get the architecture name by the constant.
source code
 
getCurrentArch()
Return an envi normalized name for the current arch.
source code
 
getArchModule(name=None)
return an Envi architecture module instance for the following architecture name.
source code
 
getArchModules(default=ARCH_DEFAULT)
Retrieve a default array of arch modules ( where index 0 is also the "named" or "default" arch module.
source code
Variables [hide private]
  ARCH_DEFAULT = 0 << 16
  ARCH_I386 = 1 << 16
  ARCH_AMD64 = 2 << 16
  ARCH_ARMV7 = 3 << 16
  ARCH_THUMB16 = 4 << 16
  ARCH_MASK = 0xffff0000
  arch_names = {ARCH_DEFAULT: 'default', ARCH_I386: 'i386', ARCH...
  arch_by_name = {'default': ARCH_DEFAULT, 'i386': ARCH_I386, 'a...
  IF_NOFALL = 0x01
  IF_PRIV = 0x02
  IF_CALL = 0x04
  IF_BRANCH = 0x08
  IF_RET = 0x10
  BR_PROC = 1 << 0
  BR_COND = 1 << 1
  BR_DEREF = 1 << 2
  BR_TABLE = 1 << 3
  BR_FALL = 1 << 4
  BR_ARCH = 1 << 5
  arch_xlate_32 = {'i386': 'i386', 'i486': 'i386', 'i586': 'i386...
  arch_xlate_64 = {'x86_64': 'amd64', 'AMD64': 'amd64', 'amd64':...
Function Details [hide private]

getArchModule(name=None)

source code 

return an Envi architecture module instance for the following architecture name.

Current architectures include:

i386 - Intel i386 amd64 - The new 64bit AMD spec.


Variables Details [hide private]

arch_names

Value:
{ARCH_DEFAULT: 'default', ARCH_I386: 'i386', ARCH_AMD64: 'amd64', ARCH\
_ARMV7: 'arm', ARCH_THUMB16: 'thumb16',}

arch_by_name

Value:
{'default': ARCH_DEFAULT, 'i386': ARCH_I386, 'amd64': ARCH_AMD64, 'arm\
': ARCH_ARMV7, 'armv6l': ARCH_ARMV7, 'armv7l': ARCH_ARMV7, 'thumb16': \
ARCH_THUMB16,}

arch_xlate_32

Value:
{'i386': 'i386', 'i486': 'i386', 'i586': 'i386', 'i686': 'i386', 'x86'\
: 'i386', 'i86pc': 'i386', '': 'i386', 'AMD64': 'i386', 'armv6l': 'arm\
v6l', 'armv7l': 'armv7l',}

arch_xlate_64

Value:
{'x86_64': 'amd64', 'AMD64': 'amd64', 'amd64': 'amd64', 'i386': 'amd64\
', '': 'amd64',}