Skip to content

ida: use EA-based IDAPython APIs to avoid deprecation warnings (#3222) - #3227

Open
Henglie wants to merge 3 commits into
mandiant:masterfrom
Henglie:fix/ida-9.5-deprecation-warnings
Open

Henglie wants to merge 3 commits into
mandiant:masterfrom
Henglie:fix/ida-9.5-deprecation-warnings

Conversation

@Henglie

@Henglie Henglie commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

Closes #3222.

IDA 9.4 deprecated the pointer-based IDAPython function and segment APIs, and IDA 9.5 keeps emitting the warnings. This change detects the EA-based APIs once at the top of the IDA helper modules and selects them when available, while preserving the existing pointer-based calls for IDA 9.2/9.3:

  • getnseg() -> get_segment_info_by_num()
  • getseg() -> get_segment_info()
  • get_segm_name() -> get_segment_name()
  • get_func() -> get_func_start() / get_func_entry_info()
  • get_func_cmt() -> get_func_cmt_ea()
  • update_func() -> set_func_flag() in the idalib fixture

Function flow charts use qflow_chart_ea_t on IDA 9.4+ so function tail chunks are still included, matching the previous FlowChart(func_t) behavior. The interactive plugin and scripts/import-to-ida.py were updated as well, so the warnings are not only avoided on the test path.

A new idalib test exercises the compatibility helpers on the installed IDA version; the CI matrix covers IDA 9.2, 9.3, 9.4, and latest.

Tests

  • pytest -q tests/test_engine.py tests/test_helpers.py tests/test_fmt.py tests/test_strings.py tests/test_optimizer.py tests/test_fixture_manifests.py tests/test_rule_cache.py tests/test_rules_insn_scope.py: 45 passed, 1 failed only because the tests/data submodule is not checked out locally (tests/test_helpers.py::test_load_one_jsonl_from_path_gz).
  • ruff format --check and ruff check on the changed files: pass.
  • mypy --check-untyped-defs --ignore-missing-imports on the changed files: no new errors (pre-existing third-party stub / Qt stub errors remain).
  • Mocked both the IDA <= 9.3 and IDA 9.4+ API surfaces to exercise both compatibility branches: pass.
  • Not verified locally: the idalib tests require a valid IDA license and the local IDA 9.5 license has expired, so tests/test_idalib_features.py could not be run here. CI will run it on all four IDA versions. The interactive plugin UI was not launched locally.

Checklist

  • No documentation update needed
  • This submission includes AI-generated code and I have provided details in the description.

AI disclosure

Portions of this change were drafted with AI assistance. The submitter reviewed the diff, ran the available checks, and takes responsibility for the change.

…andiant#3222)

IDA 9.4 deprecated the pointer-based function and segment APIs. Use the EA-based replacements when available, and keep the legacy calls for IDA 9.2/9.3.
@Henglie

Henglie commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Merged \origin/master\ into this branch and resolved the \CHANGELOG.md\ conflict. The PR branch has been updated with a regular push (no force-push).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ida: address IDA 9.5 IDAPython DeprecationWarnings

1 participant