jadx icon indicating copy to clipboard operation
jadx copied to clipboard

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

Open FabioNevesRezende opened this issue 2 years ago • 9 comments

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 avatar Apr 18 '23 23:04 FabioNevesRezende

Error persist in version 1.4.7

FabioNevesRezende avatar Apr 30 '23 18:04 FabioNevesRezende

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

jpstotz avatar Apr 30 '23 18:04 jpstotz

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 

FabioNevesRezende avatar Apr 30 '23 18:04 FabioNevesRezende

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.

jpstotz avatar May 01 '23 12:05 jpstotz

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

FabioNevesRezende avatar May 01 '23 22:05 FabioNevesRezende

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

  • It doesn't let me resize the window of the values, so I can't see the actual values there since they are below the Debugger log window and the call stack window:

image

  • The "Copy Value" option on the right click context menu doesn't work when I click on it, however it works if I just type CTRL + C

FabioNevesRezende avatar May 13 '23 23:05 FabioNevesRezende

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.

0xMineGo800m avatar Dec 03 '23 09:12 0xMineGo800m

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):

  • switch to android-x86_64-8.1-r6.iso (Android 8.1 Oreo) :+1:
  • use jadx 1.4.7 and Android Debug Bridge version 1.0.41

and

  • no more :no_entry: JDWP Error Code:35 :bug:
  • UnCrackable-Level1.apk dynamically solved :medal_sports:
    • by changing v0 values at first checks :pencil2:
    • using breakpoint to get the secret :mag_right:

FrancoisCapon avatar Feb 24 '24 20:02 FrancoisCapon

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

wangpeng813 avatar Mar 01 '24 03:03 wangpeng813