64-bit build support. Thanks to Ariel Shiftan and Itai Shaham for the initial patch.

This commit is contained in:
gergely.erdelyi
2009-05-23 14:40:01 +00:00
parent 05e10a0f25
commit 5a66395061
3 changed files with 81 additions and 107 deletions

View File

@@ -45,15 +45,19 @@ extern "C"
#define IDAPYTHON_RUNSTATEMENT 1
#define IDAPYTHON_SCRIPTBOX 2
#define IDAPYTHON_DATA_STATEMENT 0
#ifdef __EA64__
#define PYTHON_DIR_NAME "python64"
#else
#define PYTHON_DIR_NAME "python"
#endif
void init_idaapi(void);
void idaapi run(int arg);
static int initialized = 0;
/* This is a simple tracing code for debugging purposes. */
/* It might evolve into a tracing facility for user scripts. */
/* #define ENABLE_PYTHON_PROFILING */
@@ -172,14 +176,7 @@ bool CheckFile(char *filename)
{
char filepath[MAXSTR+1];
#if IDP_INTERFACE_VERSION >= 75
qmakepath(filepath, MAXSTR, idadir(NULL), "python", filename, NULL);
#elif IDP_INTERFACE_VERSION >= 69
qmakepath(filepath, idadir(NULL), "python", filename, NULL);
#else
qmakepath(filepath, idadir(), "python", filename, NULL);
#endif
qmakepath(filepath, MAXSTR, idadir(PYTHON_DIR_NAME), filename, NULL);
if (!qfileexist(filepath))
{
warning("IDAPython: Missing required file %s", filename);
@@ -614,7 +611,7 @@ bool IDAPython_Init(void)
PyRun_SimpleString(tmp);
/* Pull in the Python side of init */
qmakepath(tmp, MAXSTR, idadir("python"), "init.py", NULL);
qmakepath(tmp, MAXSTR, idadir(PYTHON_DIR_NAME), "init.py", NULL);
if (!ExecFile(tmp))
{
warning("IDAPython: error executing init.py");