skylot / jadx

Dex to Java decompiler
Apache License 2.0
40.85k stars 4.8k forks source link

(JDWP Error Code:35) Invalid slot. for <register> #1826

Open FabioNevesRezende opened 1 year ago

FabioNevesRezende commented 1 year ago

This is happening with any APK I use to decompile, when try to debug I can't get values for the virtual registers, It always show this error message (JDWP Error Code:35) Invalid slot. for vx as in the printscreen below. I'm using the latest release (1.4.6) with Java version 17.0.6. The application is running under a Qemu emulator with android-x86 image

229287082-c28f6dc5-012f-4677-93b5-9519defd5294

FabioNevesRezende commented 1 year ago

Error persist in version 1.4.7

jpstotz commented 1 year ago

Could you please check the Jadx log if it shows more details e.g. a stack trace?

FabioNevesRezende commented 1 year ago

this is all that is showing on the terminal since it opened:

$ ./jadx-gui
INFO  - output directory: UnCrackable-Level1-run-with-root-DEBUG
INFO  - loading ...
INFO  - Loaded classes: 7, methods: 15, instructions: 373
INFO  - Can't find 'R' class in app package: owasp.mstg.uncrackable1
INFO  - App 'R' class not found, put all resources ids into : 'owasp.mstg.uncrackable1.R'
^YINFO  - Resetting disk code cache, base dir: /home/fabio/OneDrive/Estudos/TCC/UnCrackable-Level1/UnCrackable-Level1-run-with-root-DEBUG.apk.cache
WARN  - Aborting readServiceProtocol: java.net.SocketException: Socket closed
WARN  - Aborting readServiceProtocol: java.net.SocketException: Socket closed
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for p0 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v4 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v4 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v4 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v1 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v2 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v1 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v1 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v0 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v0 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v0 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v0 
ERROR - Debug error: (JDWP Error Code:35) Invalid slot. for v0 
jpstotz commented 1 year ago

I found this blog post which provides a lot of background information on this specific error (the used software is JEB, but that doesn't matter of the background info): https://www.pnfsoftware.com/blog/debugging-android-apps-on-android-pie-and-above/

According to this post the error occurs because the slots have a different name since Android 9. If I understand the post correctly before Android 9 the registers were accessed using the pX notation, since Android 9 the vX notation is used.

As Android x86 is an 8.x or lower Android version this would match that there are no vX registers, but in your log there is also an entry for Invalid slot. for p0 which confuses me as it uses the pX notation which should be supported.

As workaround my recommendation would be to use an emulator with Android 9+. To my understanding it should not be affected by this problem.

FabioNevesRezende commented 1 year ago

yes but I'm really using Android v9.0-rc2

FabioNevesRezende commented 1 year ago

I've just tested with a real phone and it did work, however the are some GUI problems:

image

0xMineGo800m commented 9 months ago

I am also encountering the exact same issue (1.4.7). I am also running the application on an avd emulator (x86_64). So this reproduces only when using an emulator? I still haven't tried the same app on a real device.

FrancoisCapon commented 6 months ago

Debugging Android apps on Android Pie and above

Update (March 2020): It looks li ke the problem highlighted below regarding the impossibility to read locals that do not have associated DebugLocalInfo on Android P and Q was fixed in Android R (verified with the Developer Preview 1 released on Feb 19). The patch solving this issue is likely this one.

Same issue with Android-x86 9 (Pie):

and

wangpeng813 commented 6 months ago

Did this bug resloved when debug a apk in android 9 emulator with jadx 1.4.7?I meet this problem too