xychix / smali

Automatically exported from code.google.com/p/smali
0 stars 0 forks source link

Exception in case of overlapping instructions #134

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What seems to be the problem?
baksmali raises a java.lang.RuntimeException if an instruction overlaps the end 
of a try block.

What is the exact smali/baksmali command that you ran?
java -jar baksmali-1.3.3.jar -o output classes.dex

What version of smali/baksmali are you using? What rom are you working
from?

What is the airspeed velocity of an unladen swallow?
roughly 11 meters per second

Please provide any additional information below: error messages, symptoms,
etc.
Such an overlapping is not usual for normal applications but can occur in case 
of bytecode obfuscation.

Error occured while disassembling class Lorg.dexlabs.poc.dexdropper.R$drawable; 
- skipping class
java.lang.RuntimeException: Invalid code offset 10 for the try block end address
    at org.jf.baksmali.Adaptors.MethodDefinition.addTries(MethodDefinition.java:478)
    at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
    at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:338)
    at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:116)
    at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:205)
    at org.jf.baksmali.main.main(main.java:297)

original apk: http://www.dexlabs.org/files/crackme-obfuscator.apk
If you need more infos about this, i can provide a writeup about this 
obfuscation technique

Original issue reported on code.google.com by thuxn...@dexlabs.org on 26 Jul 2012 at 7:22

GoogleCodeExporter commented 9 years ago
Thanks for reporting this.

Just to confirm, dalvik is able to load/run such a dex file? (I assume so, it 
would be a pretty poor obfuscation technique otherwise!)

Original comment by bgruv@google.com on 26 Jul 2012 at 8:45

GoogleCodeExporter commented 9 years ago
Yes, you can run it on phones as well as emulators.

Original comment by thuxn...@dexlabs.org on 26 Jul 2012 at 8:47

GoogleCodeExporter commented 9 years ago
Forgot to mark this as fixed when I fixed it :)

Original comment by jesusfreke@jesusfreke.com on 14 Feb 2013 at 11:46