forked from realgam3/x64dbg-python
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automatically find Python installation + x64dbg_python (and other pac…
…kages) can be loaded from plugin directory (also unicode paths) + fail to load plugin if PythonHome was not found
- Loading branch information
Showing
3 changed files
with
846 additions
and
767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,43 @@ | ||
#include "pluginmain.h" | ||
#include "py.h" | ||
|
||
int pluginHandle; | ||
HWND hwndDlg; | ||
int hMenu; | ||
int hMenuDisasm; | ||
int hMenuDump; | ||
int hMenuStack; | ||
|
||
DLL_EXPORT bool pluginit(PLUG_INITSTRUCT* initStruct) | ||
{ | ||
initStruct->pluginVersion = plugin_version; | ||
initStruct->sdkVersion = PLUG_SDKVERSION; | ||
strcpy(initStruct->pluginName, plugin_name); | ||
pluginHandle = initStruct->pluginHandle; | ||
pyInit(initStruct); | ||
return true; | ||
} | ||
|
||
DLL_EXPORT bool plugstop() | ||
{ | ||
pyStop(); | ||
return true; | ||
} | ||
|
||
DLL_EXPORT void plugsetup(PLUG_SETUPSTRUCT* setupStruct) | ||
{ | ||
hwndDlg = setupStruct->hwndDlg; | ||
hMenu = setupStruct->hMenu; | ||
hMenuDisasm = setupStruct->hMenuDisasm; | ||
hMenuDump = setupStruct->hMenuDump; | ||
hMenuStack = setupStruct->hMenuStack; | ||
pySetup(); | ||
} | ||
|
||
extern "C" DLL_EXPORT BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) | ||
{ | ||
if(fdwReason == DLL_PROCESS_ATTACH) | ||
{ | ||
hInst = hinstDLL; | ||
} | ||
return TRUE; | ||
} | ||
#include "pluginmain.h" | ||
#include "py.h" | ||
|
||
int pluginHandle; | ||
HWND hwndDlg; | ||
int hMenu; | ||
int hMenuDisasm; | ||
int hMenuDump; | ||
int hMenuStack; | ||
|
||
DLL_EXPORT bool pluginit(PLUG_INITSTRUCT* initStruct) | ||
{ | ||
initStruct->pluginVersion = plugin_version; | ||
initStruct->sdkVersion = PLUG_SDKVERSION; | ||
strcpy(initStruct->pluginName, plugin_name); | ||
pluginHandle = initStruct->pluginHandle; | ||
return pyInit(initStruct); | ||
} | ||
|
||
DLL_EXPORT bool plugstop() | ||
{ | ||
pyStop(); | ||
return true; | ||
} | ||
|
||
DLL_EXPORT void plugsetup(PLUG_SETUPSTRUCT* setupStruct) | ||
{ | ||
hwndDlg = setupStruct->hwndDlg; | ||
hMenu = setupStruct->hMenu; | ||
hMenuDisasm = setupStruct->hMenuDisasm; | ||
hMenuDump = setupStruct->hMenuDump; | ||
hMenuStack = setupStruct->hMenuStack; | ||
pySetup(); | ||
} | ||
|
||
extern "C" DLL_EXPORT BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) | ||
{ | ||
if(fdwReason == DLL_PROCESS_ATTACH) | ||
{ | ||
hInst = hinstDLL; | ||
} | ||
return TRUE; | ||
} |
Oops, something went wrong.