Skip to content

fix: IDA 9.0+ compat, Frida 17.0+ compat, bad chars in names, stripped ELF#206

Open
t0kubetsu wants to merge 1 commit into
worawit:mainfrom
t0kubetsu:fix/ida-9-compat
Open

fix: IDA 9.0+ compat, Frida 17.0+ compat, bad chars in names, stripped ELF#206
t0kubetsu wants to merge 1 commit into
worawit:mainfrom
t0kubetsu:fix/ida-9-compat

Conversation

@t0kubetsu
Copy link
Copy Markdown

Summary

Fixes several compatibility issues reported by users across multiple open issues.

Changes

blutter/src/DartDumper.cpp

scripts/frida.template.js

  • Rewrite tryLoadLibapp() to try Process.getModuleByName('libapp.so').base first (Frida ≥ 17.0.0 API), falling back to Module.findBaseAddress() for older Frida — the previous fallback itself called Process.findModuleByName() which was also removed in Frida 17.0.0, causing an uncaught TypeError (frida findBaseAddress function not found #168)

extract_dart_info.py

  • Accept st_size == 0 in the _kDartVmSnapshotData assertion — some ELF files have symbol size stripped to 0 while the data itself is still readable at the symbol's address; the previous hard assertion caused an unhelpful AssertionError crash (AssertionError #154)

Related Issues

Closes / addresses: #145, #154, #168, #181, #186, #198

- DartDumper.cpp: add UTF-8 encoding declaration to generated addNames.py
  so IDA with non-ASCII names doesn't raise SyntaxError (worawit#145)
- DartDumper.cpp: add sanitizeName4Ida() to replace '|' and '-' with '_'
  in lib/class/function names, eliminating "bad character" IDA errors (worawit#186)
- DartDumper.cpp: wrap 'import ida_struct' in try/except with fallback to
  'import ida_typeinf as ida_struct' for IDA 9.0+ compatibility (worawit#181, worawit#198)
- frida.template.js: fix tryLoadLibapp() to try Process.getModuleByName()
  first (Frida >= 17.0.0) with fallback to Module.findBaseAddress() for
  older Frida; previous fallback also used a removed API (worawit#168)
- extract_dart_info.py: accept st_size == 0 in _kDartVmSnapshotData assertion
  so stripped ELF files don't abort with AssertionError (worawit#154)
@AK-103U
Copy link
Copy Markdown

AK-103U commented May 21, 2026

Hi @t0kubetsu
Thanks for putting this PR together! I pulled this branch to test it on my end, but ran into a runtime issue specifically on IDA Pro 9.3.

Issue: IDA Pro 9.3 compatibility fallback raises AttributeError

Tested environment: IDA Pro 9.3

It looks like the fallback in the code isn't quite enough for IDA 9.x:

try:
    import ida_struct
except ImportError:
    # IDA 9.0+ merged ida_struct into ida_typeinf
    import ida_typeinf as ida_struct

While this allows the module to import, the generated script still calls ida_struct.get_struc(...), ida_struct.get_member(...), and ida_struct.set_member_cmt(...). In IDA Pro 9.3, ida_typeinf does not expose get_struc, which causes an AttributeError when the script reaches the structure-annotation tail.

As a result, the rename pass runs, but the script aborts before finishing the post-processing block.

Suggested Fixes

To make this fully compatible with IDA 9.x, it seems we might need an explicit adapter rather than just aliasing the module. A few thoughts that might help:

  1. Instead of assuming module equivalence, we probably need to find exactly which IDA Python module exports the structure APIs in 9.x.
  2. We could implement a real compatibility wrapper for get_struc, get_member, and set_member_cmt to bridge the gap.
  3. Adding a quick runtime check before emitting calls could prevent the script from aborting halfway through.

Hope this testing feedback helps! Let me know if you need someone to re-test it on IDA 9.3 once it's updated.

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.

2 participants