Package envi :: Module codeflow :: Class CodeFlowContext
[hide private]
[frames] | no frames]

Class CodeFlowContext

source code

object --+
         |
        CodeFlowContext
Known Subclasses:


A CodeFlowContext is used for code-flow (not linear) based disassembly
for an envi MemoryObject (which is responsible for knowing the implementation
of parseOpcode().  The CodeFlowContext will optionally notify several callback
handlers for different events which occur during disassembly:

self._cb_opcode(va, op, branches) - called for every newly parsed opcode
    NOTE: _cb_opcode must return the desired branches for continued flow

self._cb_function(fva, metadict) - called once for every function

self._cb_branchtable(tabva, destva) - called for switch tables

Instance Methods [hide private]
 
__init__(self, mem)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_cb_branchtable(self, tabva, destva) source code
 
_cb_function(self, fva, fmeta)
Extend CodeFlowContext and implement this method to recieve a callback for every newly discovered function.
source code
 
_cb_opcode(self, va, op, branches)
Extend CodeFlowContext and implement this method to recieve a callback for every newly discovered opcode.
source code
 
_handleFunc(self, va, pth) source code
 
addCodeFlow(self, va, persist=False, exptable=True)
Do code flow disassembly from the specified address.
source code
 
addEntryPoint(self, va)
Analyze the given procedure entry point and flow downward to find all subsequent code blocks and procedure edges.
source code
 
addFunctionDef(self, fva, calls_from)
Add a priori knowledge of a function to the code flow stuff...
source code
 
getCallsFrom(self, fva) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, mem)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

_cb_function(self, fva, fmeta)

source code 

Extend CodeFlowContext and implement this method to recieve a callback for every newly discovered function. Additionally, metadata about the function may be stored in the fmeta dict.

addCodeFlow(self, va, persist=False, exptable=True)

source code 

Do code flow disassembly from the specified address. Returnes a list of the procedural branch targets discovered during code flow...

Set persist=True to store 'opdone' and never disassemble the same thing twice Set exptable=True to expand branch tables in this phase