00001 /**************************************************** 00002 * RoseBin :: Binary Analysis for ROSE 00003 * Author : tps 00004 * Date : Aug08 00005 * Decription : printInstruction 00006 ****************************************************/ 00007 00008 #ifndef __RoseBin_printInstruction_ 00009 #define __RoseBin_printInstruction_ 00010 00011 #include <stdio.h> 00012 #include <iostream> 00013 00014 #include "RoseBin_support.h" 00015 00016 #include <sstream> 00017 #include <iomanip> 00018 #include <fstream> 00019 #include <bitset> 00020 00021 class RoseBin_printInstructions : public AstSimpleProcessing { 00022 private: 00023 SgAsmNode* globalNode; 00024 char* filename; 00025 std::ofstream myfile; 00026 00027 public: 00028 00029 RoseBin_printInstructions(){}; 00030 00031 // initialize with the globalNode and the filename for output 00032 void initPrint(SgAsmNode* root, char* fileName); 00033 00034 // unparse the AST to assembly 00035 void unparsePrint(); 00036 00037 /**************************************************** 00038 * unparse binary instruction 00039 ****************************************************/ 00040 virtual void visit(SgNode* n); 00041 00042 /**************************************************** 00043 * close the file 00044 ****************************************************/ 00045 void closeFile(); 00046 00047 }; 00048 00049 #endif 00050 00051
1.4.7