DBG+BRIDGE+GUI: added menu preparation plugin event
This commit is contained in:
parent
caae4a9d6a
commit
5cb7917630
|
|
@ -1040,6 +1040,11 @@ BRIDGE_IMPEXP duint DbgEval(const char* expression, bool* success)
|
|||
return value;
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP void DbgMenuPrepare(int hMenu)
|
||||
{
|
||||
_dbg_sendmessage(DBG_MENU_PREPARE, (void*)hMenu, nullptr);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP const char* GuiTranslateText(const char* Source)
|
||||
{
|
||||
EnterCriticalSection(&csTranslate);
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ typedef enum
|
|||
DBG_GET_PEB_ADDRESS, // param1=DWORD ProcessId, param2=unused
|
||||
DBG_GET_TEB_ADDRESS, // param1=DWORD ThreadId, param2=unused
|
||||
DBG_ANALYZE_FUNCTION, // param1=BridgeCFGraphList* graph, param2=duint entry
|
||||
DBG_MENU_PREPARE, // param1=int hMenu, param2=unused
|
||||
} DBGMSG;
|
||||
|
||||
typedef enum
|
||||
|
|
@ -876,6 +877,7 @@ BRIDGE_IMPEXP duint DbgGetPebAddress(DWORD ProcessId);
|
|||
BRIDGE_IMPEXP duint DbgGetTebAddress(DWORD ThreadId);
|
||||
BRIDGE_IMPEXP bool DbgAnalyzeFunction(duint entry, BridgeCFGraphList* graph);
|
||||
BRIDGE_IMPEXP duint DbgEval(const char* expression, bool* success = 0);
|
||||
BRIDGE_IMPEXP void DbgMenuPrepare(int hMenu);
|
||||
|
||||
//Gui defines
|
||||
#define GUI_PLUGIN_MENU 0
|
||||
|
|
|
|||
|
|
@ -1431,6 +1431,13 @@ extern "C" DLL_EXPORT duint _dbg_sendmessage(DBGMSG type, void* param1, void* pa
|
|||
}
|
||||
break;
|
||||
|
||||
case DBG_MENU_PREPARE:
|
||||
{
|
||||
PLUG_CB_MENUPREPARE info;
|
||||
info.hMenu = int(param1);
|
||||
plugincbcall(CB_MENUPREPARE, &info);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,6 +223,11 @@ typedef struct
|
|||
bool retval;
|
||||
} PLUG_CB_VALTOSTRING;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int hMenu;
|
||||
} PLUG_CB_MENUPREPARE;
|
||||
|
||||
//enums
|
||||
typedef enum
|
||||
{
|
||||
|
|
@ -256,6 +261,7 @@ typedef enum
|
|||
CB_ADDRINFO, //PLUG_CB_ADDRINFO
|
||||
CB_VALFROMSTRING, //PLUG_CB_VALFROMSTRING
|
||||
CB_VALTOSTRING, //PLUG_CB_VALTOSTRING
|
||||
CB_MENUPREPARE, //PLUG_CB_MENUPREPARE
|
||||
CB_LAST
|
||||
} CBTYPE;
|
||||
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ bool pluginload(const char* pluginName, bool loadall)
|
|||
regExport("CBADDRINFO", CB_ADDRINFO);
|
||||
regExport("CBVALFROMSTRING", CB_VALFROMSTRING);
|
||||
regExport("CBVALTOSTRING", CB_VALTOSTRING);
|
||||
regExport("CBMENUPREPARE", CB_MENUPREPARE);
|
||||
|
||||
SectionLocker<LockPluginMenuList, false> menuLock; //exclusive lock
|
||||
|
||||
|
|
|
|||
|
|
@ -678,6 +678,7 @@ void CPUDisassembly::setupRightClickContextMenu()
|
|||
mMenuBuilder->addSeparator();
|
||||
mMenuBuilder->addBuilder(new MenuBuilder(this, [this](QMenu * menu)
|
||||
{
|
||||
DbgMenuPrepare(GUI_DISASM_MENU);
|
||||
menu->addActions(mPluginMenu->actions());
|
||||
return true;
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -266,6 +266,7 @@ void CPUDump::setupContextMenu()
|
|||
mMenuBuilder->addSeparator();
|
||||
mMenuBuilder->addBuilder(new MenuBuilder(this, [this](QMenu * menu)
|
||||
{
|
||||
DbgMenuPrepare(GUI_DUMP_MENU);
|
||||
menu->addActions(mPluginMenu->actions());
|
||||
return true;
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -313,6 +313,7 @@ void CPUStack::setupContextMenu()
|
|||
mMenuBuilder->addSeparator();
|
||||
mMenuBuilder->addBuilder(new MenuBuilder(this, [this](QMenu * menu)
|
||||
{
|
||||
DbgMenuPrepare(GUI_STACK_MENU);
|
||||
menu->addActions(mPluginMenu->actions());
|
||||
return true;
|
||||
}));
|
||||
|
|
|
|||
Loading…
Reference in New Issue