0xdea / frida-scripts

A collection of my Frida.re instrumentation scripts to facilitate reverse engineering of mobile apps.
https://www.frida.re
MIT License
1.22k stars 221 forks source link

Cannot trace any function - java.lang.ClassNotFoundException #8

Open Aldenar opened 2 years ago

Aldenar commented 2 years ago

I'm trying to trace functions of a specific class of an old old game with broken in-apps.

Having decompiled the game through apktool, I found a class I'm interested. But no matter how I run the trace function, the game launches, then frida throws an error: Error: java.lang.ClassNotFoundException: Didn't find class "com.game.tka" on path: DexPathList[[zip file "/data/app/~~tnL0853xrVQX1h4toIMrDA==/com.game.tka-aq3_iPPP9AhvI_iyOxSG6g==/base.apk"],nativeLibraryDirectories=[/data/app/~~tnL0853xrVQX1h4toIMrDA==/com.game.tka-aq3_iPPP9AhvI_iyOxSG6g==/lib/arm64, /system/lib64, /system_ext/lib64]] The main app class is com.game.tka, and I'd like to trace methods of com.game.tka.Dungeons, trace("com.game.tka.Dungeons") doesn't work however.

Am I doing something wrong, or is this script no longer maintained and possibly broken?

0xdea commented 2 years ago

Hi, the error message you pasted seems to indicate that the class name passed to Frida is wrong. It doesn't look like a bug in the trace script; you should experiment a bit until you are able to trace what you want.

That said, I'm not actively maintaining these scripts, so they might need some tweaking in order to work properly in all cases. I suggest you to take a look at this project: https://github.com/federicodotta/Brida. Federico took my scripts (among others) for dynamic hooking and binary inspection and integrated them with the Brida project.

Good luck!