Dedexer

Dedexer is a disassembler tool for DEX files. DEX is a format introduced by the creators of the Android platform. The format and the associated opcode set is in distant relationship with the Java class file format and Java bytecodes. Dedexer is able to read the DEX format and turn into an “assembly-like format”. This format was largely influenced by the Jasmin syntax but contains Dalvik opcodes. For this reason, Jasmin is not able to compile the generated files.

java -jar ddx.jar -d <directory> <dex file>

http://dedexer.sourceforge.net/

Dedexer:Dex文件反编译工具介绍

Dedexer 项目主页:
http://dedexer.sourceforge.net/

软件下载链接:
http://nchc.dl.sourceforge.net/project/dedexer/dedexer/1.5/ddx1.5.jar

使用指南:
为了方便,我把ddx1.5.jar放入system32中,运行CMD.输入如下命令:
D:\WINDOWS\system32>java -jar ddx1.5.jar
Usage: java -jar ddx.jar -o -D -d <destination directory> <source>
<destination directory> :指定生成的文件放置的目录
<source> :dex源文件.
-D – 指定生成错误信息.
-o – 指定生成日志文件(dex.log).

运行结果,出现一个使用帮助.仔细阅读后试了下:
java -jar ddx.jar -o -D -d <destination directory> <source>
java -jar ddx1.5.jar -o -D -d c:\dex\gen c:\dex\classes.dex

示例:
D:\WINDOWS\system32>
java -jar ddx1.5.jar -o -D -d c:\dex\gen c:\dex\classes.dex
Processing com/eoeandroid/market/MarketActivity$2
Processing com/eoeandroid/market/MarketActivity$1

运行成功,在gen 目录生成了ddx 文件.用文本编辑器打开,可看到类大致结构.

版本更新:
1.7 支持寄存器跟踪

Dex文件介绍:
Dex文件—–Android平台上的可执行文件

Android虚拟机Dalvik支持的字节码文件格式Google在新发布的Android平台上使用了自己的Dalvik虚拟机来定义,这种虚拟机执行的并非Java字节码,而是另一种字节码:dex格式的字节码。在编译Java代码之后,通过Android平台上的工具可以将Java字节码转换成Dex字节码[/b.
这个Dalvik VM针对手机程式/CPU做过最佳化,可以同时执行许多VM而不会占用太多Resource,Dalvik VM的source目前还没有开放让人下载(未来整个系统都会开放),目前Google的角度是希望能让大家用这套SDK开始开发APP,底层的东西会慢 慢发布.

附件:
Dex 文件格式:
http://code.google.com/p/dex2jar/wiki/DexFileFormat

另一个相关项目:

[b]dex2jar
据说可以把dex反编译成jar文件.还没试过.
http://code.google.com/p/dex2jar/

[Via]

http://w26.javaeye.com/blog/501553

Advertisements

Tags:

2 Responses to “Dedexer”

  1. Wes Binienda Says:

    Hello, to start with I want to say that I try to follow your blog. Great post, I fully agree with you. Have a great day matey.

  2. VERNON Says:

    I’m always looking for more information about this, thanks for the awesome post, keep them coming!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: