#include <RoseBin_CompareAnalysis.h>
Inheritance diagram for RoseBin_CompareAnalysis:


Public Member Functions | |
| RoseBin_CompareAnalysis (SgProject *pr, SgAsmNode *global) | |
| void | visit (SgNode *node) |
| this method is called at every traversed node. | |
| void | run () |
| void | create_map_functions () |
| void | checkFunctions (std::string name, SgFunctionDeclaration *funcDecl, SgAsmFunction *binDecl) |
| bool | instruction_filter (SgAsmStatement *stat, std::string name, std::string *output) |
Private Types | |
| typedef std::map< std::string, std::pair< std::string, SgAsmValueExpression * > > | local_vars_type |
| typedef std::map< std::string, std::pair< SgFunctionDeclaration *, SgAsmFunction * > > | function_map_type |
Private Member Functions | |
| MyAstAttribute * | createAttribute (int val) |
| int | match_statements (int array_src_length, int array_bin_length, SgNode *src_statements[], SgAsmNode *bin_statements[], std::string *output) |
| std::string | resolveRegister (const RegisterDescriptor ®) |
| bool | isFunctionCall (SgNode *srcNode, SgAsmNode *binNode, std::string *output, int &nodes_matched) |
| bool | isReturnStmt (SgNode *srcNode, SgAsmNode *binNode, std::string *output, int &nodes_matched) |
| bool | isVariableDeclaration (SgNode *srcNode, SgAsmNode *binNode, std::string *output, int &nodes_matched, int array_bin_length, int &bin_count, SgNode *src_statements[], SgAsmNode *bin_statements[], bool &increase_source) |
| bool | isAssignOp (SgNode *srcNode, SgAsmNode *binNode, std::string *output, int &nodes_matched, int array_bin_length, int array_src_length, int &bin_count, int src_count, SgNode *src_statements[], SgAsmNode *bin_statements[], bool &increase_source) |
| bool | isSgPlusPlus (SgNode *srcNode, SgAsmNode *binNode, std::string *output, int &nodes_matched) |
| std::string | checkVariable (SgAsmValueExpression *rhs) |
| void | storeVariable (std::string val, std::string name, SgAsmValueExpression *binval) |
| std::string | getVariableName (std::string val) |
| SgAsmValueExpression * | getVariableType (std::string val) |
| bool | handleSourceExpression (SgExpression *expr, SgNode *src_statements[], SgAsmNode *bin_statements[], std::string *output, int &bin_count, int src_count, int &nodes_matched, int array_bin_length, int array_src_length, SgAssignOp *assign, bool dont_increase_bool_count) |
| SgExpression * | isExpression (SgExpression *expr, SgNode *src_statements[], SgAsmNode *bin_statements[], std::string *output, int &bin_count, int src_count, int &nodes_matched, int array_bin_length, int array_src_length, bool &keep_binary_node) |
| std::string | resolve_binaryInstruction (SgAsmInstruction *mov, std::string *left, std::string *right, std::string varName) |
| bool | existsVariable (std::string value) |
| bool | isAnExpression (SgExpression *expr) |
| void | pushOnStack (SgExpression *expr) |
| void | resolve_bin_vardecl_or_assignment (bool &isVarDecl0, bool &isVarDecl1, bool &isAssign0, bool &isAssign1, SgAsmx86Instruction *mov) |
Private Attributes | |
| SgProject * | project |
| SgAsmNode * | globalBin |
| bool | main_prolog_end |
| std::string | attributeName |
| local_vars_type | local_vars |
| function_map_type | function_map |
| std::map< std::string, SgAsmFunction * > | bin_funcs |
| std::stack< SgExpression * > | srcNodesTodo |
| bool | tookSrcNodeFromStack |
| SgAsmValueExpression * | valExp |
| SgAsmx86RegisterReferenceExpression * | refExp_Left |
| SgAsmx86RegisterReferenceExpression * | refExp_Right |
| std::string | last_src_variable_left |
typedef std::map<std::string, std::pair<std::string, SgAsmValueExpression* > > RoseBin_CompareAnalysis::local_vars_type [private] |
typedef std::map<std::string, std::pair<SgFunctionDeclaration*, SgAsmFunction*> > RoseBin_CompareAnalysis::function_map_type [private] |
| MyAstAttribute* RoseBin_CompareAnalysis::createAttribute | ( | int | val | ) | [private] |
| int RoseBin_CompareAnalysis::match_statements | ( | int | array_src_length, | |
| int | array_bin_length, | |||
| SgNode * | src_statements[], | |||
| SgAsmNode * | bin_statements[], | |||
| std::string * | output | |||
| ) | [private] |
| std::string RoseBin_CompareAnalysis::resolveRegister | ( | const RegisterDescriptor & | reg | ) | [private] |
| bool RoseBin_CompareAnalysis::isFunctionCall | ( | SgNode * | srcNode, | |
| SgAsmNode * | binNode, | |||
| std::string * | output, | |||
| int & | nodes_matched | |||
| ) | [private] |
| bool RoseBin_CompareAnalysis::isReturnStmt | ( | SgNode * | srcNode, | |
| SgAsmNode * | binNode, | |||
| std::string * | output, | |||
| int & | nodes_matched | |||
| ) | [private] |
| bool RoseBin_CompareAnalysis::isVariableDeclaration | ( | SgNode * | srcNode, | |
| SgAsmNode * | binNode, | |||
| std::string * | output, | |||
| int & | nodes_matched, | |||
| int | array_bin_length, | |||
| int & | bin_count, | |||
| SgNode * | src_statements[], | |||
| SgAsmNode * | bin_statements[], | |||
| bool & | increase_source | |||
| ) | [private] |
| bool RoseBin_CompareAnalysis::isAssignOp | ( | SgNode * | srcNode, | |
| SgAsmNode * | binNode, | |||
| std::string * | output, | |||
| int & | nodes_matched, | |||
| int | array_bin_length, | |||
| int | array_src_length, | |||
| int & | bin_count, | |||
| int | src_count, | |||
| SgNode * | src_statements[], | |||
| SgAsmNode * | bin_statements[], | |||
| bool & | increase_source | |||
| ) | [private] |
| bool RoseBin_CompareAnalysis::isSgPlusPlus | ( | SgNode * | srcNode, | |
| SgAsmNode * | binNode, | |||
| std::string * | output, | |||
| int & | nodes_matched | |||
| ) | [private] |
| std::string RoseBin_CompareAnalysis::checkVariable | ( | SgAsmValueExpression * | rhs | ) | [private] |
| void RoseBin_CompareAnalysis::storeVariable | ( | std::string | val, | |
| std::string | name, | |||
| SgAsmValueExpression * | binval | |||
| ) | [private] |
| std::string RoseBin_CompareAnalysis::getVariableName | ( | std::string | val | ) | [private] |
| SgAsmValueExpression* RoseBin_CompareAnalysis::getVariableType | ( | std::string | val | ) | [private] |
| bool RoseBin_CompareAnalysis::handleSourceExpression | ( | SgExpression * | expr, | |
| SgNode * | src_statements[], | |||
| SgAsmNode * | bin_statements[], | |||
| std::string * | output, | |||
| int & | bin_count, | |||
| int | src_count, | |||
| int & | nodes_matched, | |||
| int | array_bin_length, | |||
| int | array_src_length, | |||
| SgAssignOp * | assign, | |||
| bool | dont_increase_bool_count | |||
| ) | [private] |
| SgExpression* RoseBin_CompareAnalysis::isExpression | ( | SgExpression * | expr, | |
| SgNode * | src_statements[], | |||
| SgAsmNode * | bin_statements[], | |||
| std::string * | output, | |||
| int & | bin_count, | |||
| int | src_count, | |||
| int & | nodes_matched, | |||
| int | array_bin_length, | |||
| int | array_src_length, | |||
| bool & | keep_binary_node | |||
| ) | [private] |
| std::string RoseBin_CompareAnalysis::resolve_binaryInstruction | ( | SgAsmInstruction * | mov, | |
| std::string * | left, | |||
| std::string * | right, | |||
| std::string | varName | |||
| ) | [private] |
| bool RoseBin_CompareAnalysis::existsVariable | ( | std::string | value | ) | [private] |
| bool RoseBin_CompareAnalysis::isAnExpression | ( | SgExpression * | expr | ) | [private] |
| void RoseBin_CompareAnalysis::pushOnStack | ( | SgExpression * | expr | ) | [private] |
| void RoseBin_CompareAnalysis::resolve_bin_vardecl_or_assignment | ( | bool & | isVarDecl0, | |
| bool & | isVarDecl1, | |||
| bool & | isAssign0, | |||
| bool & | isAssign1, | |||
| SgAsmx86Instruction * | mov | |||
| ) | [private] |
| void RoseBin_CompareAnalysis::visit | ( | SgNode * | node | ) | [virtual] |
| void RoseBin_CompareAnalysis::run | ( | ) |
| void RoseBin_CompareAnalysis::create_map_functions | ( | ) |
| void RoseBin_CompareAnalysis::checkFunctions | ( | std::string | name, | |
| SgFunctionDeclaration * | funcDecl, | |||
| SgAsmFunction * | binDecl | |||
| ) |
| bool RoseBin_CompareAnalysis::instruction_filter | ( | SgAsmStatement * | stat, | |
| std::string | name, | |||
| std::string * | output | |||
| ) |
SgProject* RoseBin_CompareAnalysis::project [private] |
SgAsmNode* RoseBin_CompareAnalysis::globalBin [private] |
bool RoseBin_CompareAnalysis::main_prolog_end [private] |
std::string RoseBin_CompareAnalysis::attributeName [private] |
std::map<std::string, SgAsmFunction*> RoseBin_CompareAnalysis::bin_funcs [private] |
std::stack<SgExpression*> RoseBin_CompareAnalysis::srcNodesTodo [private] |
bool RoseBin_CompareAnalysis::tookSrcNodeFromStack [private] |
std::string RoseBin_CompareAnalysis::last_src_variable_left [private] |
1.4.7