Skip to content

Dev/improves#9

Merged
buzzer-re merged 3 commits into
mainfrom
dev/improves
Jun 20, 2026
Merged

Dev/improves#9
buzzer-re merged 3 commits into
mainfrom
dev/improves

Conversation

@buzzer-re

Copy link
Copy Markdown
Owner

No description provided.

buzzer-re and others added 3 commits June 20, 2026 17:28
Two follow-ups so DWARF source grouping actually shows up for IDA exports:

- The IDA database is cached by binary hash, so a database built before the
  loader learned to import line numbers was silently reused, yielding no
  source files. Version the cache path (_IDA_DB_VERSION) so changes to how
  the database is built force a rebuild, and drop superseded caches.
- IDA reports absolute build paths (e.g. /home/.../src/foo.cpp). Strip the
  common root shared by all source files so the exported tree mirrors the
  project layout instead of being anchored at "/". Relative paths (as angr
  reports) are unaffected.

Verified on a real IDA 9.3 load that the loader now imports source files
for the target binary.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A killed analysis (e.g. OOM) leaves the database unpacked on disk (.id0/
.id1/.nam/.til beside the .i64), which cannot be reopened. The backend then
saw the cache "exists", tried to open it read-only, and failed hard with
"failed to open IDA database at ...".

When the cached database fails to open and the original binary is available,
purge the broken cache (packed db + unpacked components) and rebuild it from
the binary instead of erroring. Extract the open paths into _open_fresh /
_open_existing and add a _purge_database helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Recovering from an unopenable cached database by deleting it is dangerous:
an "unpacked" database (.id0/.id1/.nam/.til beside the .i64) usually means
the database is currently open in another IDA session, so purging it would
destroy that session's work.

Do not purge implicitly. When the cached database cannot be opened and is
unpacked, fail with a clear message:

  the IDA database at <path> is unpacked (it is open in another IDA session,
  or a previous run was interrupted). Close your IDA session, or re-run with
  --purge-cache to discard and rebuild it.

Add a --purge-cache CLI flag (threaded through create_analyzer to
IdaSession) that opts into discarding and rebuilding, emitting a warning
first. Add _is_unpacked detection and tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@buzzer-re buzzer-re merged commit 3eba588 into main Jun 20, 2026
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.

1 participant