mirror of
https://github.com/mandiant/capa.git
synced 2026-01-13 21:36:35 -08:00
ida: fix return value from open_database
This commit is contained in:
@@ -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...")
|
||||
|
||||
@@ -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...")
|
||||
|
||||
Reference in New Issue
Block a user