DBG+GUI: winEventFilter plugin callback
This commit is contained in:
parent
bedd58447c
commit
1ffff8fdf7
|
|
@ -724,6 +724,13 @@ BRIDGE_IMPEXP const DBGFUNCTIONS* DbgFunctions()
|
|||
return (const DBGFUNCTIONS*)_dbg_sendmessage(DBG_GET_FUNCTIONS, 0, 0);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP bool DbgWinEvent(MSG* message, long* result)
|
||||
{
|
||||
if(_dbg_sendmessage(DBG_WIN_EVENT, message, result))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//GUI
|
||||
BRIDGE_IMPEXP void GuiDisasmAt(duint addr, duint cip)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -162,7 +162,8 @@ typedef enum
|
|||
DBG_SET_AUTO_FUNCTION_AT, // param1=duint addr, param2=const char* text
|
||||
DBG_DELETE_AUTO_FUNCTION_RANGE, // param1=duint start, param2=duint end
|
||||
DBG_GET_STRING_AT, // param1=duint addr, param2=unused
|
||||
DBG_GET_FUNCTIONS // param1=unused, param2=unused
|
||||
DBG_GET_FUNCTIONS, // param1=unused, param2=unused
|
||||
DBG_WIN_EVENT, // param1=MSG* message, param2=long* result
|
||||
} DBGMSG;
|
||||
|
||||
typedef enum
|
||||
|
|
@ -562,6 +563,7 @@ BRIDGE_IMPEXP bool DbgSetAutoFunctionAt(duint start, duint end);
|
|||
BRIDGE_IMPEXP void DbgClearAutoFunctionRange(duint start, duint end);
|
||||
BRIDGE_IMPEXP bool DbgGetStringAt(duint addr, char* text);
|
||||
BRIDGE_IMPEXP const DBGFUNCTIONS* DbgFunctions();
|
||||
BRIDGE_IMPEXP bool DbgWinEvent(MSG* message, long* result);
|
||||
|
||||
//Gui defines
|
||||
#define GUI_PLUGIN_MENU 0
|
||||
|
|
|
|||
|
|
@ -883,6 +883,12 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par
|
|||
return (uint)dbgfunctionsget();
|
||||
}
|
||||
break;
|
||||
|
||||
case DBG_WIN_EVENT:
|
||||
{
|
||||
return (uint)pluginwinevent((MSG*)param1, (long*)param2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,6 +146,13 @@ typedef struct
|
|||
int hEntry;
|
||||
} PLUG_CB_MENUENTRY;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MSG* message;
|
||||
long* result;
|
||||
bool retval;
|
||||
} PLUG_CB_WINEVENT;
|
||||
|
||||
//enums
|
||||
typedef enum
|
||||
{
|
||||
|
|
@ -167,7 +174,8 @@ typedef enum
|
|||
CB_ATTACH, //PLUG_CB_ATTACHED (before attaching, after CB_INITDEBUG)
|
||||
CB_DETACH, //PLUG_CB_DETACH (before detaching, before CB_STOPDEBUG)
|
||||
CB_DEBUGEVENT, //PLUG_CB_DEBUGEVENT (called on any debug event)
|
||||
CB_MENUENTRY //PLUG_CB_MENUENTRY
|
||||
CB_MENUENTRY, //PLUG_CB_MENUENTRY
|
||||
CB_WINEVENT //PLUG_CB_WINEVENT
|
||||
} CBTYPE;
|
||||
|
||||
//typedefs
|
||||
|
|
|
|||
|
|
@ -110,6 +110,9 @@ void pluginload(const char* pluginDir)
|
|||
cbPlugin=(CBPLUGIN)GetProcAddress(pluginData.hPlugin, "CBMENUENTRY");
|
||||
if(cbPlugin)
|
||||
pluginregistercallback(curPluginHandle, CB_MENUENTRY, cbPlugin);
|
||||
cbPlugin=(CBPLUGIN)GetProcAddress(pluginData.hPlugin, "CBWINEVENT");
|
||||
if(cbPlugin)
|
||||
pluginregistercallback(curPluginHandle, CB_WINEVENT, cbPlugin);
|
||||
//init plugin
|
||||
//TODO: handle exceptions
|
||||
if(!pluginData.pluginit(&pluginData.initStruct))
|
||||
|
|
@ -369,4 +372,14 @@ void pluginmenucall(int hEntry)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool pluginwinevent(MSG* message, long* result)
|
||||
{
|
||||
PLUG_CB_WINEVENT winevent;
|
||||
winevent.message=message;
|
||||
winevent.result=result;
|
||||
winevent.retval=false;
|
||||
plugincbcall(CB_WINEVENT, &winevent);
|
||||
return winevent.retval;
|
||||
}
|
||||
|
|
@ -53,5 +53,6 @@ bool pluginmenuaddentry(int hMenu, int hEntry, const char* title);
|
|||
bool pluginmenuaddseparator(int hMenu);
|
||||
bool pluginmenuclear(int hMenu);
|
||||
void pluginmenucall(int hEntry);
|
||||
bool pluginwinevent(MSG* message, long* result);
|
||||
|
||||
#endif // _PLUGIN_LOADER_H
|
||||
|
|
|
|||
|
|
@ -8,6 +8,11 @@ MyApplication::MyApplication(int& argc, char** argv) : QApplication(argc, argv)
|
|||
{
|
||||
}
|
||||
|
||||
bool MyApplication::winEventFilter(MSG* message, long* result)
|
||||
{
|
||||
return DbgWinEvent(message, result);
|
||||
}
|
||||
|
||||
bool MyApplication::notify(QObject* receiver, QEvent* event)
|
||||
{
|
||||
bool done = true;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class MyApplication : public QApplication
|
|||
public:
|
||||
MyApplication(int& argc, char** argv);
|
||||
bool notify(QObject* receiver, QEvent* event);
|
||||
bool winEventFilter(MSG* message, long* result);
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue