My favorites | Sign in
Project Logo
                
Show all Featured wiki pages:
DeodexInstructions

About

smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's Java VM implementation. The syntax is loosely based on Jasmin's/dedexer's syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc.)

The names "smali" and "baksmali" are the Icelandic equivalents of "assembler" and "disassembler" respectively. Why Icelandic you ask? Because dalvik was named for an Icelandic fishing village.

Got questions/comments? Need help? Come hang out in #smali on freenode.

News

11-08-09 smali/baksmali v1.0 is out. More info on my blog

9-10-09 smali/baksmali v0.96 is out. baksmali now supports deodexing .odex files! For the first time you can turn those pesky .odex files into much-easier-to-use classes.dex files. Here are instructions on how this magic is performed.

NOTE deodexerant is just a helper binary that runs on the phone and talks to baksmali. It doesn't do much of anything interesting in and of itself. Unless you want to dump some vtables or something :)

8-29-09 smali/baksmali v0.95 is out. The major change in this version is a re-implemented version of dexlib, as well as changes in smali/baksmali to work with the new dexlib. Also, I've optimized baksmali, so it should run much much quicker now (up to 4x quicker). smali should also be a bit quicker, but nothing you'll probably notice.

As far as new functionality goes, baksmali will now output registers that are mapped to method parameters using a p<n> syntax, instead of the normal v<n> syntax. i.e. p0 is the first method parameter (or the "this" reference, for non-static methods), p1 is the second method parameter and so on. If you want to disable this functionality, you can use the -p command line arg.

7-27-09 smali/baksmali v0.94 is available. This is a bugfix release, a few typo fixes here and there, plus it should be compatible with java 5 now (for the Mac users out there)

7-3-09 baksmali v0.93 is available on the download tab. v0.92 had a template issue that prevented it from running.

7-2-09 smali/baksmali v0.92 has been released. This is a minor bugfix release. Thanks to Stericson and Josef Pfleger for the bug reports!

6-23-09 The first release of baksmali (v0.91) is out! Also, a new version of smali, also v0.91, with a number of improvements and fixes. Still no documentation.. I'll get there eventually.

6-7-09 After lots and lots of work, the first release of smali is out finally! You can grab it from the downloads tab. I'll try and get a wiki going with some documentation, as far as usage and syntax goes. For now, you can look at the examples and tests to see the syntax. There are tests for every opcode, so you should be able to find the syntax you need.

6-3-09 I've been whipping smali into shape the past few days. I should be getting close to a release soon! Currently, it should be able to handle all the features supported by the dex format. I still need to spend some time with the error handling, move all the tests from HelloWorld2.smali to the new junit-tests testing framework, and write more examples.

5-9-09 I've just added support for packed-switch and sparse-switch, and now smali supports the full set of dex opcodes. Woot! There's still a decent amount of work to be done though. I need to implement try blocks, annotations, debug/line info, add better exception handling in the parsing code, write a real front end, etc.

More

To see some examples of the syntax, take a look at examples. This contains examples of how various features are implemented in smali.

The lexer/parser for smali is built with ANTLR v3, and the dex file generation is done by dexlib, a library I have written to read in and write out dex files.

baksmali uses dexlib to read in dex files, and the StringTemplate library (a companion library to ANTLR) to generate the disassembly.









Hosted by Google Code