|
Project Information
Featured
Downloads
Links
|
Aboutsmali/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. Curious what the smali format looks like? Here's a quick HelloWorld example to whet your appetite.
News1-11-12 smali/baksmali v1.3.2 is out. This version has a few misc. bugfixes 11-20-11 smali/baksmali v1.3.0 is out! This version now supports Honeycomb and Ice Cream Sandwich. More details here. 8-22-11 smali/baksmali v1.2.8 is out. This fixes a problematic bug that crept into 1.2.7 8-13-11 smali/baksmali v1.2.7 is out. This is a bugfix release, with a small additional feature (helper comments for synthetic access methods) 12-23-10 smali/baksmali v1.2.6 is out, with support for gingerbread odex files 10-31-10 smali/baksmali v1.2.5 is out. This is a minor release with a few small bugfixes 8-1-10 smali/baksmali v1.2.4 is out, with a number of bugfixes blog post 6-13-10 smali/baksmali v1.2.3, now with frozen yogurt! blog post 4-03-10 smali/baksmali v1.2.2 is out! This is again mostly a bugfix release, but it also has significant performance improvements as well. More details here 3-06-10 smali/baksmali v1.2.1 is out! This is mostly a bugfix release, with a few performance improvements and enhancements. 2-22-10 smali/baksmali v1.2 is out! As usual, more info on my blog 12-25-09 smali/baksmali v1.1 is out. More info on my blog 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. MoreTo 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. |