Android dex2jar反编译失败

http://blog.163.com/wrq_zj/blog/static/58043041201391203625118/

准备解开千牛源代码面纱的时候,一向管用的dex2jar居然失灵了.

 
   

com.googlecode.dex2jar.DexException: while accept method:[La/a/a;.bc()Ljava/lang /String;] at com.googlecode.dex2jar.reader.DexFileReader.acceptMethod(DexFileReade r.java:705) at com.googlecode.dex2jar.reader.DexFileReader.acceptClass(DexFileReader .java:451) at com.googlecode.dex2jar.reader.DexFileReader.accept(DexFileReader.java :333) at com.googlecode.dex2jar.v3.Dex2jar.doTranslate(Dex2jar.java:82) at com.googlecode.dex2jar.v3.Dex2jar.to(Dex2jar.java:191) at com.googlecode.dex2jar.v3.Dex2jar.to(Dex2jar.java:182) at com.googlecode.dex2jar.v3.Main.doData(Main.java:43) at com.googlecode.dex2jar.v3.Main.doData(Main.java:35) at com.googlecode.dex2jar.v3.Main.doFile(Main.java:63) at com.googlecode.dex2jar.v3.Main.main(Main.java:85) Caused by: com.googlecode.dex2jar.DexException: while accept code in method:[La/ a/a;.bc()Ljava/lang/String;] at com.googlecode.dex2jar.reader.DexFileReader.acceptMethod(DexFileReade r.java:695) ... 9 more Caused by: java.lang.IllegalArgumentException: Id out of bound at com.googlecode.dex2jar.reader.DexFileReader.getType(DexFileReader.jav a:567) at com.googlecode.dex2jar.reader.DexOpcodeAdapter.x2c(DexOpcodeAdapter.j ava:356) at com.googlecode.dex2jar.reader.DexCodeReader.acceptInsn(DexCodeReader. java:606) at com.googlecode.dex2jar.reader.DexCodeReader.accept(DexCodeReader.java :292) at com.googlecode.dex2jar.reader.DexFileReader.acceptMethod(DexFileReade r.java:692) ... 9 more . while process file: [classes.dex] .. ROOT cause: java.util.zip.ZipException: ZIP file must have at least one entry at java.util.zip.ZipOutputStream.finish(Unknown Source) at com.googlecode.dex2jar.v3.Dex2jar.to(Dex2jar.java:192) at com.googlecode.dex2jar.v3.Dex2jar.to(Dex2jar.java:182) at com.googlecode.dex2jar.v3.Main.doData(Main.java:43) at com.googlecode.dex2jar.v3.Main.doData(Main.java:35) at com.googlecode.dex2jar.v3.Main.doFile(Main.java:63) at com.googlecode.dex2jar.v3.Main.main(Main.java:85) Done.


千牛在dex的编译上做了点手脚,导致dex2jar无法工作.
具体做了什么手脚呢 ? 可以通过针对反编译工具对dex 中字节码的读取解析漏洞,来造成反编译工具山崩溃。
通过在不会调用到的Dex文件,或中添加无效字节码,或无效数据引用。导致反编译失败而崩溃。


(详见  http://bbs.pediy.com/showthread.php?t=177114  很详细的讲述了Android Dex的攻防)

上文中提到使用IDA工具可以成功反编译,但我没有该环境,则采用 backsmali来反编译, backsmali跳过了失败的dex文件。成功反编译出smali文件.



附上工具下载地址:
smali:  https://smali.googlecode.com/files/smali-2.0.ja r
Baksmali:  https://smali.googlecode.com/files/baksmali-2.0.ja r


你可能感兴趣的:(android)