Skip to content

Fix IDA script invalid labels + Add Frida Closure/Map/Set support#195

Open
fewhakko wants to merge 2 commits intoworawit:mainfrom
fewhakko:fix-ida-and-frida
Open

Fix IDA script invalid labels + Add Frida Closure/Map/Set support#195
fewhakko wants to merge 2 commits intoworawit:mainfrom
fewhakko:fix-ida-and-frida

Conversation

@fewhakko
Copy link

IDA Script Fix (DartDumper.cpp)

When analyzing obfuscated apps, the generated addNames.py had issues:

  • set_name(0x0, ...) — 5206 _miss labels pointed to address 0x0 because PayloadAddress() returns 0 for functions with no code body. These all overwrote each other at address 0.
  • set_name(0x320080, ...) — 5207 _check labels pointed to the same shared MonomorphicAddress, overwriting each other.
  • add_func(addr, addr) — 5206 functions had zero size (start == end), giving IDA no boundary information.

Fix: validate addresses before emitting labels, skip add_func when size ≤ 0.

Frida Template Fix (frida.template.js)

getObjectValue() did not handle Closure, Map, or Set types. These fell through to "Unhandle class id" error despite having CID constants and struct offsets already exported.

Added:

  • getDartClosure() — reads closure's function entry point
  • getDartMap() / getDartSet() — reads LinkedHashBase data array
  • CidClosure, CidMap, CidSet cases in getObjectValue() switch

Tested with obfuscated Flutter app (Dart 3.5.4, arm64).

Skip add_func when function size is 0 or negative to avoid
zero-sized function boundaries in IDA.

Skip _miss label when PayloadAddress is 0 (invalid) and _check
label when MonomorphicAddress is shared across many functions,
preventing thousands of labels colliding at the same address.

Tested with obfuscated app: eliminated 5206 set_name(0x0) and
5207 colliding _check labels.
Add getDartClosure to read closure's function entry point.
Add getDartMap and getDartSet to read LinkedHashBase data.
Handle CidClosure/CidMap/CidSet in getObjectValue switch,
which previously fell through to "Unhandle class id" error.
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