UnivesalDisassembler(2003)
|
00001 // plugins.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 interface of plugins (loading, syncing). 00011 // 00012 00013 #ifndef pluginsH 00014 #define pluginsH 00015 00016 #include <string> 00017 #include <vector> 00018 using namespace std; 00019 00020 #include "udaclasses.h" 00021 #include "shared.h" 00022 00023 extern const char *pluginsdir; // dir with plugins 00024 extern const char *configfile; // file with list of plugins 00025 00027 //Events for plugin 00028 00030 typedef int (*Ev_IsFileDefined)(const char*); 00032 typedef int (*Ev_LoadSections)(BinFileData &); 00034 typedef int (*Ev_LoadSymbols)(AbstractSymbols &); 00035 00036 int EvEmpty_data(void*); 00037 int EvEmpty_void(); 00038 00041 class Plugin { 00042 public: 00043 string filename; //base filename 00044 void *dynfile; //descriptor to opened plugin 00045 int type; //type of plugin PLUGIN_SECTIONS or PLUGIN_SYMTABLE 00046 const char *ident; //text identification of plugin 00047 const char *syntax; //plugins parameters 00048 Ev_IsFileDefined IsFileDefined; 00049 Ev_LoadSections LoadSections; 00050 Ev_LoadSymbols LoadSymbols; 00051 Plugin(); 00052 ~Plugin(); 00054 int Open(const char *filename); 00056 void Close(); 00058 void Info(); 00059 }; 00060 00061 typedef vector<Plugin*> VPlugins; 00062 extern VPlugins plugins; 00063 00065 int OpenPlugins(); 00067 void ClosePlugins(); 00069 void PluginsInfo(); 00070 00071 #endif