Package Libs :: Module libanalyze :: 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
source code
 
setStart(self, address)
Change the start of a Function
source code
DWORD
getStart(self)
Get the Address of the Function
source code
STRING
getName(self)
Get the name of the Function
source code
 
getFunctionEnd(self) source code
LIST of BasicBlock
getEnd(self)
Get the end of the Function (Understanding end as the Basic Block with a ret inside)
source code
 
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.
source code
BasicBlock object
hasAddress(self, address)
Check if the given address is part of the Function
source code
LIST of BasicBlock objects
getBasicBlocks(self, force=False)
Get basic block from the current Function
source code
 
_getBB(self, address) source code
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

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
  • address (DWORD)
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