-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dexlib2 exception when parsing method instructions #394
Comments
Does the rest of the file disassemble correctly though? Or does this error cause disassembly to abort early, so the rest doesn't get disassembled? |
Oh, you're using dexlib2 directly, nevermind. This seems mostly WAI. The class is invalid and can't be used on android. It's common for obfuscators to include nonsense classes like this, which aren't (and can't be) actually used for anything. You should ignore classes that are not able to be processed like this. (e.g. this is what baksmali does) The "real" solution here is to implement full verification of the dex file, so that more meaningful errors can be returned. It's on my list, but not very high on it :). It will be a huge amount of work to fully verify a dex file. It would be possible to check for this specific condition and provide a better error of course, but without full verification, there are a nearly limitless variety of these kinds of errors, and it would just be a game of whack-a-mole. |
Thanks a lot for the quick response. We suspect the problem is with obfuscators too. We are working on a binary rewriter based on dexlib2 now. Now we just spill out all method instructions if one of them happens to be invalid. |
Encounter dexlib2 exception when reading through method instructions.
This is caused by an illegal
if
instruction which tries to jump to a place far beyond the end of the function.The exception can be reproduced on dexlib2 2.1.0 and the latest 2.1.2.
If needed I can provide the APK sample.
The text was updated successfully, but these errors were encountered: