binary_analysis.h

Go to the documentation of this file.
00001 #include "integerOps.h"
00002 #include "x86InstructionSemantics.h"
00003 #include "Partitioner.h"
00004 
00005 /*********************************
00006 * Find root nodes in the graph. A root node is a node with no in edges.
00007 *********************************/
00008 std::vector<SgGraphNode*> findGraphRoots(SgIncidenceDirectedGraph* graph);
00009 
00010 /*******************************************************************
00011  * Generate all static traces of length smaller than a limit.
00012  *******************************************************************/
00013 void
00014 findTraceForSubtree(const SgIncidenceDirectedGraph* graph, SgGraphNode* cur_node, std::vector<SgAsmx86Instruction*>& curTrace, size_t max_length,
00015     std::set< std::vector<SgAsmx86Instruction*> >& returnSet);
00016 
00017 /*******************************************************************
00018  * Generate all static traces of length smaller than a limit.
00019  * We ignore nop's 
00020  *******************************************************************/
00021 std::set< std::vector<SgAsmx86Instruction*> > 
00022 generateStaticTraces(SgIncidenceDirectedGraph* graph, size_t max_length);
00023 
00024 /***************************************************
00025  * The function addBlocksFromFunctionToGraph creates the SgGraphNode's 
00026  * for all blocks in the subtree
00027  **************************************************/
00028 void addBlocksFromFunctionToGraph(SgIncidenceDirectedGraph* graph, std::map<rose_addr_t, SgGraphNode*>& instToNodeMap, SgAsmFunction* funcDecl );
00029 
00030 /***************************************************************************************************
00031  * The goal of the function is to create a control flow graph where nodes are basic blocks.
00032  */
00033 SgIncidenceDirectedGraph* constructCFG_BB(SgAsmStatement* blocks, const Partitioner::BasicBlockStarts& bb_starts,const Disassembler::InstructionMap& instMap );
00034 
00035 /***************************************************************************************************
00036  * The goal of the function is to create a control flow graph.
00037  */
00038 SgIncidenceDirectedGraph* constructCFG( SgAsmInterpretation *interp );
00039 SgIncidenceDirectedGraph* constructCFG( const  Partitioner::FunctionStarts& func_starts, const Partitioner::BasicBlockStarts& bb_starts,const Disassembler::InstructionMap& instMap );
00040 
00041 /****************************
00042  * The goal of this function is to create a binary control flow graph. It does this by construcing a CFG and then finding the
00043  * subset of the CFG that is a call graph.
00044  */
00045 SgIncidenceDirectedGraph* constructCallGraph( SgAsmInterpretation *interp );
00046 SgIncidenceDirectedGraph* constructCallGraph( const  Partitioner::FunctionStarts& func_starts,const Partitioner::BasicBlockStarts& bb_starts, const Disassembler::InstructionMap& instMap  );
00047 

Generated on Tue Jan 31 05:31:20 2012 for ROSE by  doxygen 1.4.7