Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit bdc46aa

Browse files
committed
IDAPython: added a mechanism to use the freshly-built modules to perform the pydoc injections check, in case of an out-of-tree build
1 parent 27fa71c commit bdc46aa

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
parser.add_argument("-I", "--ida-install", required=True, help="IDA's installation directory", type=str)
4646
args = parser.parse_args()
4747

48-
_probe = os.path.join("..", "..", "include", "pro.h")
48+
sdk_relpath = os.path.join("..", "..")
49+
_probe = os.path.join(sdk_relpath, "include", "pro.h")
4950
assert os.path.exists(_probe), "Could not find IDA SDK include path (looked for: \"%s\")" % _probe
5051

5152

@@ -77,6 +78,7 @@ def main():
7778
if args.verbose:
7879
argv.append("-d")
7980
env["IDA_INSTALL"] = args.ida_install.replace('\\', '/')
81+
env["SDK_BIN_PATH"] = os.path.abspath(os.path.join(sdk_relpath, "bin")).replace('\\', '/')
8082
for ea64 in [True, False]:
8183
if ea64:
8284
env["__EA64__"] = "1"

idapython.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,10 @@ bool idapython_plugin_t::init()
986986
msg("HexraysPython: Python compiled with DEBUG enabled.\n");
987987
#endif
988988

989+
qstring dynload_base;
990+
if ( !qgetenv("IDAPYTHON_DYNLOAD_BASE", &dynload_base) )
991+
dynload_base = idadir(nullptr);
992+
989993
// Set IDAPYTHON_VERSION in Python
990994
qstring init_code;
991995
init_code.sprnt(
@@ -997,7 +1001,7 @@ bool idapython_plugin_t::init()
9971001
"IDAPYTHON_IDAUSR_SYSPATH = %s\n",
9981002
VER_MAJOR, VER_MINOR, VER_PATCH, VER_STATUS, VER_SERIAL,
9991003
config.remove_cwd_sys_path ? "True" : "False",
1000-
idadir(nullptr),
1004+
dynload_base.c_str(),
10011005
sizeof(ea_t)*8,
10021006
config.autoimport_compat_idaapi ? "True" : "False",
10031007
config.idausr_syspath ? "True" : "False"

makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,11 @@ else
187187
IDAT_PATH?=$(IDA_INSTALL)/idat
188188
endif
189189

190-
IDAT_CMD=TVHEADLESS=1 $(IDAT_PATH)$(SUFF64)
190+
ifeq ($(OUT_OF_TREE_BUILD),)
191+
IDAT_CMD=TVHEADLESS=1 $(IDAT_PATH)$(SUFF64)
192+
else
193+
IDAT_CMD=TVHEADLESS=1 IDAPYTHON_DYNLOAD_BASE=$(SDK_BIN_PATH) $(IDAT_PATH)$(SUFF64)
194+
endif
191195

192196
# envvar HAS_HEXRAYS must have been set by build.py if needed
193197
ifeq ($(OUT_OF_TREE_BUILD),)
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)