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

Class Function

source code

Class that contains information about a Function

Instance Methods [hide private]
  __init__(self, imm, start)
Class that contains information about a Function
  setStart(self, address)
Change the start of a Function
DWORD getStart(self)
Get the Address of the Function
STRING getName(self)
Get the name of the Function
  getFunctionEnd(self)
LIST of BasicBlock getEnd(self)
Get the end of the Function (Understanding end as the Basic Block with a ret inside)
  findRetValue(self)
Find all the possible ret values on a function (Beta) Note: This function only check the modifiers on a Ret BasicBlock, so the result might not be precise.
BasicBlock object hasAddress(self, address)
Check if the given address is part of the Function
LIST of BasicBlock objects getBasicBlocks(self, force=False)
Get basic block from the current Function
  _getBB(self, address)

Method Details [hide private]

__init__(self, imm, start)
(Constructor)

source code 
Class that contains information about a Function
Parameters:
  • imm (Debbuger OBJECT) - Debbuger
  • start (DWORD) - Address of the begging of the function

setStart(self, address)

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

getStart(self)

source code 
Get the Address of the Function
Returns: DWORD
Address of the function

getName(self)

source code 
Get the name of the Function
Returns: STRING
Name of the Function

getFunctionEnd(self)

source code 
None

getEnd(self)

source code 
Get the end of the Function (Understanding end as the Basic Block with a ret inside)
Returns: LIST of BasicBlock
A list of all the basic block that end the function

findRetValue(self)

source code 
Find all the possible ret values on a function (Beta) Note: This function only check the modifiers on a Ret BasicBlock, so the result might not be precise.
Parameters:
  • start (LIST OF OPCODE) - Return all the possible modifiers of EAX

hasAddress(self, address)

source code 
Check if the given address is part of the Function
Parameters:
  • force - Address of the instruction to check
Returns: BasicBlock object
If true, returns the corresponding Basic block else returns None

getBasicBlocks(self, force=False)

source code 
Get basic block from the current Function
Parameters:
  • force (BOOLEAN) - (Optional, Def: False) Force to Function to reparse the basic blocks
Returns: LIST of BasicBlock objects

Basic blocks of the current function

TODO: Recursion here is bad - we need to make this an iterative process with a work queue

_getBB(self, address)

source code 
None