ida: fix return value from open_database

This commit is contained in:
Willi Ballenthin
2026-01-13 13:41:24 +01:00
parent c1391376bf
commit 77654cb2f7
2 changed files with 4 additions and 6 deletions

View File

@@ -333,8 +333,7 @@ def get_extractor(
# which sometimes provides bad names, including overwriting names from debug info.
#
# return values from open_database:
# 0 - Success (database not packed)
# 1 - Success (database was packed)
# 0 - Success
# 2 - User cancelled or 32-64 bit conversion failed
# 4 - Database initialization failed
# -1 - Generic errors (database already open, auto-analysis failed, etc.)
@@ -342,7 +341,7 @@ def get_extractor(
ret = idapro.open_database(
str(input_path), run_auto_analysis=True, args="-Olumina:host=0.0.0.0 -Osecondary_lumina:host=0.0.0.0"
)
if ret not in (0, 1):
if ret != 0:
raise RuntimeError("failed to analyze input file")
logger.debug("idalib: waiting for analysis...")

View File

@@ -229,8 +229,7 @@ def get_idalib_extractor(path: Path):
# which sometimes provides bad names, including overwriting names from debug info.
#
# return values from open_database:
# 0 - Success (database not packed)
# 1 - Success (database was packed)
# 0 - Success
# 2 - User cancelled or 32-64 bit conversion failed
# 4 - Database initialization failed
# -1 - Generic errors (database already open, auto-analysis failed, etc.)
@@ -238,7 +237,7 @@ def get_idalib_extractor(path: Path):
ret = idapro.open_database(
str(path), run_auto_analysis=True, args=f"-Olumina:host=0.0.0.0 -Osecondary_lumina:host=0.0.0.0{load_resource}"
)
if ret not in (0, 1):
if ret != 0:
raise RuntimeError("failed to analyze input file")
logger.debug("idalib: waiting for analysis...")