diff --git a/build.py b/build.py index 976c053..ef1cc1c 100644 --- a/build.py +++ b/build.py @@ -45,7 +45,8 @@ parser.add_argument("-v", "--verbose", help="Verbose mode", default=False, actio parser.add_argument("-I", "--ida-install", required=True, help="IDA's installation directory", type=str) args = parser.parse_args() -_probe = os.path.join("..", "..", "include", "pro.h") +sdk_relpath = os.path.join("..", "..") +_probe = os.path.join(sdk_relpath, "include", "pro.h") assert os.path.exists(_probe), "Could not find IDA SDK include path (looked for: \"%s\")" % _probe @@ -77,6 +78,7 @@ def main(): if args.verbose: argv.append("-d") env["IDA_INSTALL"] = args.ida_install.replace('\\', '/') + env["SDK_BIN_PATH"] = os.path.abspath(os.path.join(sdk_relpath, "bin")).replace('\\', '/') for ea64 in [True, False]: if ea64: env["__EA64__"] = "1" diff --git a/idapython.cpp b/idapython.cpp index 5ef96b2..9df6524 100644 --- a/idapython.cpp +++ b/idapython.cpp @@ -986,6 +986,10 @@ bool idapython_plugin_t::init() msg("HexraysPython: Python compiled with DEBUG enabled.\n"); #endif + qstring dynload_base; + if ( !qgetenv("IDAPYTHON_DYNLOAD_BASE", &dynload_base) ) + dynload_base = idadir(nullptr); + // Set IDAPYTHON_VERSION in Python qstring init_code; init_code.sprnt( @@ -997,7 +1001,7 @@ bool idapython_plugin_t::init() "IDAPYTHON_IDAUSR_SYSPATH = %s\n", VER_MAJOR, VER_MINOR, VER_PATCH, VER_STATUS, VER_SERIAL, config.remove_cwd_sys_path ? "True" : "False", - idadir(nullptr), + dynload_base.c_str(), sizeof(ea_t)*8, config.autoimport_compat_idaapi ? "True" : "False", config.idausr_syspath ? "True" : "False" diff --git a/makefile b/makefile index 40cbb98..6582073 100644 --- a/makefile +++ b/makefile @@ -187,7 +187,11 @@ else IDAT_PATH?=$(IDA_INSTALL)/idat endif -IDAT_CMD=TVHEADLESS=1 $(IDAT_PATH)$(SUFF64) +ifeq ($(OUT_OF_TREE_BUILD),) + IDAT_CMD=TVHEADLESS=1 $(IDAT_PATH)$(SUFF64) +else + IDAT_CMD=TVHEADLESS=1 IDAPYTHON_DYNLOAD_BASE=$(SDK_BIN_PATH) $(IDAT_PATH)$(SUFF64) +endif # envvar HAS_HEXRAYS must have been set by build.py if needed ifeq ($(OUT_OF_TREE_BUILD),) diff --git a/out_of_tree/parsed_notifications.zip b/out_of_tree/parsed_notifications.zip index 8dba7e0..e7c9f00 100644 Binary files a/out_of_tree/parsed_notifications.zip and b/out_of_tree/parsed_notifications.zip differ