berkus / smali

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

Encountered valid uleb128 that is out of range #178

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
baksmali: 2.0b5
java: 1.7

>java -jar baksmali-2.0b5.jar classes.dex

Exception in thread "main" java.lang.RuntimeException: 
java.util.concurrent.ExecutionException: org.jf.util.ExceptionWithContext: 
Encountered valid uleb128 that is out of range at offset 0xd075e
        at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:110)
        at org.jf.baksmali.main.main(main.java:274)
Caused by: java.util.concurrent.ExecutionException: 
org.jf.util.ExceptionWithContext: Encountered valid uleb128 that is out of 
range at offset 0xd075e
        at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:104)
        ... 1 more
Caused by: org.jf.util.ExceptionWithContext: Encountered valid uleb128 that is 
out of range at offset 0xd075e
        at org.jf.dexlib2.dexbacked.BaseDexReader.readSmallUleb128(BaseDexReader.java:118)
        at org.jf.dexlib2.dexbacked.DexBackedMethod.<init>(DexBackedMethod.java:93)
        at org.jf.dexlib2.dexbacked.DexBackedClassDef$4$1.readNextItem(DexBackedClassDef.java:305)
        at org.jf.dexlib2.dexbacked.DexBackedClassDef$4$1.readNextItem(DexBackedClassDef.java:291)
        at org.jf.dexlib2.dexbacked.util.VariableSizeLookaheadIterator.next(VariableSizeLookaheadIterator.java:71)
        at org.jf.baksmali.Adaptors.ClassDefinition.findFieldsSetInStaticConstructor(ClassDefinition.java:68)
        at org.jf.baksmali.Adaptors.ClassDefinition.<init>(ClassDefinition.java:57)
        at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:141)
        at org.jf.baksmali.baksmali.access$000(baksmali.java:47)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:95)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:93)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Thanks a lot.

Original issue reported on code.google.com by falcon1...@gmail.com on 7 Jul 2013 at 5:48

GoogleCodeExporter commented 9 years ago
My initial guess is that this is just an invalid dex file. Can you confirm 
whether this dex file actually works on an android device? My suspicion is that 
the dalvik verifier should reject it.

If it does actually work on device, can you share the apk? I'll need to take a 
deeper look at it to figure out why it isn't working.

Original comment by bgruv@google.com on 9 Jul 2013 at 7:33

GoogleCodeExporter commented 9 years ago
Here a demo dex.

Original comment by falcon1...@gmail.com on 16 Jul 2013 at 4:02

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed. The fix will be available in the next 2.0 beta release - v2.0b6

Original comment by jesusfreke@jesusfreke.com on 14 Sep 2013 at 8:37