Package Libs :: Module libanalize :: Class BasicBlock
[hide private]
[frames] | no frames]

Class BasicBlock

source code

Known Subclasses:
JMCBasicBlock, JMPBasicBlock, RETBasicBlock, XREFBasicBlock

Instance Methods [hide private]
  __init__(self, start, end)
Basic Block class
  setFunction(self, function)
  getFunction(self)
  setCalls(self, calls)
  getCalls(self)
  __cmp__(self, other)
Comparision by the start address of the BB
  setStart(self, address)
Change the start of a Basic Block
  addTrueEdge(self, addr)
  addFalseEdge(self, addr)
  getEdges(self)
DWORD getTrueEdge(self)
Get the 'true' Edge
DWORD getFalseEdge(self)
Get the 'false' Edge
TUPLE of DWORD getDirectEdge(self)
Get the Edges of a Basic Block
DWORD getSize(self)
Return the Size of the Basic Block
  setEnd(self, address)
Change the end of a Basic Block
TUPLE OF DWORD getLimits(self)
Get the limits of the basic block
DWORD getStart(self)
Get the begging of a Basic Block
DWORD getEnd(self)
Get the End of a Basic Block
LIST of opCode OBJECT getInstructions(self, imm)
Get the disassembled instructions from a Basic Block
BOOLEAN isXref(self)
Check if a Basic Block was created from an XREF
BOOLEAN isConditionalJmp(self)
Check if a Basic Block was created from a Conditional Jump instruction
BOOLEAN isJmp(self)
Check if a Basic Block was created from a Jump instruction
BOOLEAN isRet(self)
Check if a Basic Block was created from a RET instruction

Method Details [hide private]

__init__(self, start, end)
(Constructor)

source code 
Basic Block class
Parameters:
  • start (DWORD) - Address of the begging of the Basic Block
  • end (DWORD) - Address of the end of the Basic Block

setFunction(self, function)

source code 
None

getFunction(self)

source code 
None

setCalls(self, calls)

source code 
None

getCalls(self)

source code 
None

__cmp__(self, other)
(Comparison operator)

source code 
Comparision by the start address of the BB

setStart(self, address)

source code 
Change the start of a Basic Block
Parameters:
  • address (DWORD) - New address of the Basic Block

addTrueEdge(self, addr)

source code 
None

addFalseEdge(self, addr)

source code 
None

getEdges(self)

source code 
None

getTrueEdge(self)

source code 
Get the 'true' Edge
Returns: DWORD
'True' Edge of the Basic Block

getFalseEdge(self)

source code 
Get the 'false' Edge
Returns: DWORD
'False' Edge of the Basic Block (The 'false' edge, is not always present. Depends of the Basic Block)

getDirectEdge(self)

source code 
Get the Edges of a Basic Block
Returns: TUPLE of DWORD
The Edge of the Basic Block (Might change depending of the basic block type)

getSize(self)

source code 
Return the Size of the Basic Block
Returns: DWORD
Size of the Basic Block

setEnd(self, address)

source code 
Change the end of a Basic Block
Parameters:
  • address (DWORD) - New address of the Basic Block end

getLimits(self)

source code 
Get the limits of the basic block
Returns: TUPLE OF DWORD
(Beginning of BB, End of BB)

getStart(self)

source code 
Get the begging of a Basic Block
Returns: DWORD
Beginning of the Basic Block

getEnd(self)

source code 
Get the End of a Basic Block
Returns: DWORD
End of the Basic Block

getInstructions(self, imm)

source code 
Get the disassembled instructions from a Basic Block
Parameters:
  • imm (Debugger OBJECT) - Debugger
Returns: LIST of opCode OBJECT
List of disassembled instructions

isXref(self)

source code 
Check if a Basic Block was created from an XREF
Returns: BOOLEAN
Whether the Basic Block was created from an XREF

isConditionalJmp(self)

source code 
Check if a Basic Block was created from a Conditional Jump instruction
Returns: BOOLEAN
Whether the Basic Block was created from a Conditional Jump instruction

isJmp(self)

source code 
Check if a Basic Block was created from a Jump instruction
Returns: BOOLEAN
Whether the Basic Block was created from a Jump instruction

isRet(self)

source code 
Check if a Basic Block was created from a RET instruction
Returns: BOOLEAN
Whether the Basic Block was created from a RET instruction