zhangwenan / smali

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

Encountered small uint that is out of range #210

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What seems to be the problem?
Getting a top level exception. In what scenario would this exception be thrown?

What is the exact smali/baksmali command that you ran?
java -jar baksmali-2.0.3.jar <apk>

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

What is the airspeed velocity of an unladen swallow?

Please provide any additional information below: error messages, symptoms,
etc.

org.jf.util.ExceptionWithContext: Encountered small uint that is out of range 
at offset 0x2681ea
        at org.jf.dexlib2.dexbacked.BaseDexBuffer.readSmallUint(BaseDexBuffer.java:52)
        at org.jf.dexlib2.dexbacked.instruction.DexBackedInstruction31c.getReference(DexBackedInstruction31c.java:54)
        at org.jf.baksmali.Adaptors.Format.InstructionMethodItem.writeTo(InstructionMethodItem.java:104)
        at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:200)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:277)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112)
        at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:220)
        at org.jf.baksmali.baksmali.access$000(baksmali.java:55)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:144)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:142)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Original issue reported on code.google.com by dongjuna...@gmail.com on 28 Apr 2014 at 9:03

GoogleCodeExporter commented 9 years ago
My initial suspicion is that this is a corrupted dex file. Does the apk/dex 
file actually work? Is it able to be loaded on a device?

Original comment by jesusfreke@jesusfreke.com on 28 Apr 2014 at 11:32

GoogleCodeExporter commented 9 years ago
Yes, this apk file actually works. It is able to be loaded on a device.

Original comment by dongjuna...@gmail.com on 28 Apr 2014 at 11:39

GoogleCodeExporter commented 9 years ago
I was able to find an apk that causes this error message. This uses a style of 
obfuscation where they throw in unused "crap" classes that are malformed in 
various ways, but are never actually used/referenced. baksmali handles this by 
logging an error and skipping the class. Since these classes are never actually 
referenced, so they can safely be ignored/skipped.

In particular, if the class was ever actually referenced, dalvik would reject 
it during verification, so it could never actually be used.

Original comment by jesusfreke@jesusfreke.com on 29 Apr 2014 at 8:01

GoogleCodeExporter commented 9 years ago
So you suspect that I am getting this error because there is a class that is 
malformed in some way?

Original comment by dongjuna...@gmail.com on 29 Apr 2014 at 9:18

GoogleCodeExporter commented 9 years ago
Yes. And in fact, I would be willing to bet that the "leaf" part of the class 
name with the error is "a" :)

Original comment by jesusfreke@jesusfreke.com on 29 Apr 2014 at 9:23

GoogleCodeExporter commented 9 years ago
Thank you for your help.

Original comment by dongjuna...@gmail.com on 29 Apr 2014 at 9:27