UnivesalDisassembler(2003)
|
00001 // udaclasses.h 00002 // 00003 // uda - universal disassembler 00004 // Date: 2003-05-04 00005 // 00006 // Copyright (c) 2002-2003 Ales Smrcka 00007 // 00008 // This program is licensed under GNU Library GPL. See the file COPYING. 00009 // 00010 // This module contains some definition of common classes and functions 00011 // e.g. Exception, hex2uint, ... 00012 // 00013 00014 #ifndef udaclassesH 00015 #define udaclassesH 00016 #include <string> 00017 #include <iostream> 00018 #include <iomanip> 00019 using namespace std; 00020 00021 string uint2str(unsigned value); 00022 string uint2hex(unsigned value, const string prefix="0x"); 00023 unsigned hex2uint(const string hex); 00024 unsigned number2uint(const string num); 00025 bool directory_exists(const string dir); 00026 bool file_exists(const string filename); 00027 00029 typedef void (*TVoidEvent)(); 00030 00031 class BinFile; 00032 class Section; 00033 class Plugin; 00034 00035 class Exception { 00036 protected: 00037 string value; 00038 public: 00039 Exception(string s) { value=s; cerr<<dec<<setfill(' '); } 00040 virtual ~Exception() {} 00041 virtual void Print() { cerr<<"Disassembler error: "<<value<<endl; } 00042 operator string() { return value; } 00043 }; 00044 00045 extern string basedir; 00046 00047 #endif