-
Notifications
You must be signed in to change notification settings - Fork 2
/
plugin.cpp
49 lines (42 loc) · 961 Bytes
/
plugin.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "plugin.h"
#include "resource.h"
#include "x64dbgpy.h"
enum
{
RUN_QTCONSOLE,
};
// editor
static void RunQtConsole() // function to call main python app file
{
ExecutePythonScriptW(L"plugins\\QtConsoleLauncher\\launcher.py"); // execution of main file location (relative to x64dbg.exe)
}
extern "C" __declspec(dllexport) void CBMENUENTRY(CBTYPE cbType, PLUG_CB_MENUENTRY* info)
{
switch(info->hEntry)
{
case RUN_QTCONSOLE:
RunQtConsole();
break;
}
}
bool pyInit(PLUG_INITSTRUCT* initStruct)
{
return true;
}
bool pyStop()
{
return true;
}
void pySetup()
{
// Set Menu Icon
ICONDATA pyIcon;
HRSRC hRes = FindResourceW(hInst, MAKEINTRESOURCEW(IDB_PNG1), L"PNG");
HGLOBAL hMem = LoadResource(hInst, hRes);
pyIcon.data = LockResource(hMem);
pyIcon.size = SizeofResource(hInst, hRes);
_plugin_menuseticon(hMenu, &pyIcon);
FreeResource(hMem);
// Register menu entry
_plugin_menuaddentry(hMenu, RUN_QTCONSOLE, "Run QtConsole");
}