Package vivisect :: Package impemu :: Module emulator :: Class WorkspaceEmulator
[hide private]
[frames] | no frames]

Class WorkspaceEmulator

source code

Instance Methods [hide private]
 
__init__(self, vw, logwrite=False, logread=False) source code
 
getPathProp(self, key)
Retrieve a named value from the current code path context.
source code
 
setPathProp(self, key, value)
Set a named value which is only relevant for the current code path.
source code
 
setEmulationMonitor(self, emumon)
Snap in an emulation monitor.
source code
 
parseOpcode(self, pc) source code
 
checkCall(self, starteip, endeip, op)
Check if this was a call, and if so, do the required import emulation and such...
source code
 
newCodePathNode(self, parent=None, bva=None)
NOTE: Right now, this is only called from the actual branch state which needs it.
source code
 
getBranchNode(self, node, bva)
If a node exists already for the specified branch, return it.
source code
 
checkBranches(self, starteip, endeip, op)
This routine gets the current branch list for this opcode, adds branch entries to the current path, and updates current path as needed (returns a list of (va, CodePath) tuples.
source code
 
stepi(self) source code
 
runFunction(self, funcva, stopva=None, maxhit=None, maxloop=None)
This is a utility function specific to WorkspaceEmulation (and impemu) that will emulate, but only inside the given function.
source code
 
getCallApi(self, va)
Retrieve an API definition from either the vivisect workspace ( if the call target is a function within the workspace ) or the impapi definition subsystem ( if the call target is a known import definition )
source code
 
nextVivTaint(self) source code
 
setVivTaint(self, typename, taint)
Set a taint in the emulator.
source code
 
getVivTaint(self, va)
Retrieve a previously registered taint ( this will automagically mask values down and allow you to retrieve "near taint" values.)
source code
 
reprVivTaint(self, taint)
For the base "known" taint types, return a humon readable string to represent the value of the taint.
source code
 
reprVivValue(self, val)
Return a humon readable string which is the best description for the given value ( given knowledge of the workspace, emu, and taint subsystems ).
source code
 
_useVirtAddr(self, va) source code
 
writeMemory(self, va, bytes)
Try to write the bytes to the memory object, otherwise, dont' complain...
source code
 
logUninitRegUse(self, regid) source code
 
getUninitRegUse(self) source code
 
readMemory(self, va, size) source code
 
isUninitStack(self, val)
If val is a numerical value in the same memory page as the un-initialized stack values return True
source code
 
isStackPointer(self, va) source code
 
getStackOffset(self, va) source code
Class Variables [hide private]
  taintregs = []
Method Details [hide private]

setEmulationMonitor(self, emumon)

source code 

Snap in an emulation monitor. (see EmulationMonitor doc from vivisect.impemu)

newCodePathNode(self, parent=None, bva=None)

source code 

NOTE: Right now, this is only called from the actual branch state which needs it. it must stay that way for now (register context is being copied for symbolic emulator...)

getBranchNode(self, node, bva)

source code 

If a node exists already for the specified branch, return it. Otherwise, create a new one and return that...

runFunction(self, funcva, stopva=None, maxhit=None, maxloop=None)

source code 

This is a utility function specific to WorkspaceEmulation (and impemu) that will emulate, but only inside the given function. You may specify a stopva to return once that location is hit.

setVivTaint(self, typename, taint)

source code 

Set a taint in the emulator. Returns the new value for the created taint.