<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JesusFreke&#039;s AndBlog &#187; smali</title>
	<atom:link href="http://jf.andblogs.net/tag/smali/feed/" rel="self" type="application/rss+xml" />
	<link>http://jf.andblogs.net</link>
	<description></description>
	<lastBuildDate>Sun, 13 Jun 2010 21:14:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>smali/baksmali v1.2 released</title>
		<link>http://jf.andblogs.net/2010/02/22/smali-baksmali-1-2-released/</link>
		<comments>http://jf.andblogs.net/2010/02/22/smali-baksmali-1-2-released/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 08:27:59 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[baksmali]]></category>
		<category><![CDATA[smali]]></category>

		<guid isPermaLink="false">http://jf.andblogs.net/?p=182</guid>
		<description><![CDATA[After lots of hard work over the last month or two, smali/baksmali 1.2 is out! The major new functionality in this release is that baksmali now supports deodexing without the help of deodexerant! It also has a new &#8220;register info&#8221; feature, to show the register types in the disassembly, and numerous minor fixes/changes/enhancements/tweaks/(and probably bugs) [...]]]></description>
			<content:encoded><![CDATA[<p>After <a href="http://code.google.com/p/smali/source/list?start=645">lots of hard work</a> over the last month or two, <a href="http://code.google.com/p/smali/downloads/list">smali/baksmali 1.2</a> is out!</p>
<p>The major new functionality in this release is that baksmali now supports deodexing without the help of deodexerant! It also has a new &#8220;register info&#8221; feature, to show the register types in the disassembly, and numerous minor fixes/changes/enhancements/tweaks/(and probably bugs)</p>
<p><span id="more-182"></span></p>
<h4>Deodexing</h4>
<p>In order to deodex files now, you need to have the boot class path files available for baksmali to use. By default, it looks for the 5 main framework jars in the current directory. You can of course specify additional directories to search in, add additional boot class path files, or change which boot class path files are used altogether.</p>
<p>The <a title="DeodexInstructions" href="http://code.google.com/p/smali/wiki/DeodexInstructions">DeodexInstructions</a> page has more info on how to deodex with this version. But for a quick primer, you just need to have the 5 main framework files in the current directory (core.jar, ext.jar, framework.jar, android.policy.jar and services.jar), and then specify the <em>-x</em> option for baksmali. For example:</p>
<pre>baksmali -x Calculator.odex -o Calculator</pre>
<h4>Register Info</h4>
<p>Another bit of new functionality that can be very helpful is the new &#8220;register info&#8221; output for baksmali, which can be turned on with the <em>-r</em> parameter. It will analyze the registers and print some register type info before and after each instruction. There are several levels of register info output available, depending on exactly what you want to see. The default is to print the register type for any register that is used by the instruction.</p>
<p>Note that this functionality also requires that baksmali load the boot class path files &#8211; so they must be available. Here is an example of what the default register info looks like:</p>
<pre>#v0=(Integer);v2=(Integer);
new-array v2, v0, [C
#v2=(Reference,[C);</pre>
<p>The register types that are printed just before the instruction are the <strong>incoming</strong> register types, while the register types that are printed after the instruction show any changes to the registers caused by the instruction.</p>
<p>If you want to see <strong>all</strong> the register info, you can use <em>-r ALL,FULLMERGE</em> which looks something like this:</p>
<pre>#v0=(Integer):merge{0x18:(Null),0x2c:(Integer)}
#v1=(Conflicted):merge{0x18:(Uninit),0x2c:(Integer)}
#v3=(Conflicted):merge{0x18:(Uninit),0x2c:(Char)}
#v2=(Reference,[C);p0=(Reference,Ljava/lang/String;);p1=(Reference,[B);p2=(Integer);p3=(Integer);p4=(Integer);
iget v2, p0, Ljava/lang/String;-&gt;count:I
#v0=(Integer);v1=(Conflicted);v2=(Integer);v3=(Conflicted);p0=(Reference,Ljava/lang/String;);p1=(Reference,[B);p2=(Integer);p3=(Integer);p4=(Integer);</pre>
<h4>Other changes</h4>
<p>There are a few other miscellaneous changes as well. Make sure you take a look at the usage info for smali and baksmali. The short parameters for some of the options have changed. In particular some of the options that are mostly for debugging purposes were changed to an uppercase letter, and are now hidden by default. You can use -?? for both smali and baksmali to see the debug options.</p>
<p>baksmali also has a new -f parameter, which adds a comment with the code address before each instruction. This is useful when looking at the FULLMERGE register info, which shows the register info and code addresses for all &#8220;incoming&#8221; execution paths.</p>
<h4>Things to come</h4>
<p>With this release, I have added a robust code analyzer/verifier that can infer the register types and validate the instructions. I plan using this to add verification functionality in smali, so that it will optionally verify the code after assembling it. This will let you know there&#8217;s a problem with the assembled code without having to push the code to a device and have dalvik complain to you about the invalid code.</p>
<p>I also want to add some way to dump/serialize the results of loading the boot class path files for baksmali, so that it can load the information it needs from the dump file, instead of reading in all 5 boot class path files every time, which should help speed it up.</p>
<p>In the longer term, I would love to be able to debug code on a device at an assembly level. This is just something that is banging around in the back of my head for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://jf.andblogs.net/2010/02/22/smali-baksmali-1-2-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Have a very smali Christmas!</title>
		<link>http://jf.andblogs.net/2009/12/25/have-a-very-smali-christmas/</link>
		<comments>http://jf.andblogs.net/2009/12/25/have-a-very-smali-christmas/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 00:28:05 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[baksmali]]></category>
		<category><![CDATA[smali]]></category>

		<guid isPermaLink="false">http://jf.andblogs.net/?p=174</guid>
		<description><![CDATA[As my Christmas present to everyone, I present smali/baksmali v1.1 This version has significant new functionality, and is much better able to handle the larger framework files that are floating around. There are a number of bug fixes as well. As usual, you can grab the new versions from the googlecode download page The changes [...]]]></description>
			<content:encoded><![CDATA[<p>As my Christmas present to everyone, I present smali/baksmali v1.1</p>
<p><span id="more-174"></span></p>
<p>This version has significant new functionality, and is much better able to handle the larger framework files that are floating around. There are a number of bug fixes as well.</p>
<p>As usual, you can grab the new versions from the <a href="http://code.google.com/p/smali/downloads/list">googlecode download page</a></p>
<p>The changes for this version include:</p>
<ul>
<li>Added support for a new .locals directive, which can be used instead of the .registers directive, to specify the number of non-parameter registers in the method</li>
<li>Added support for the <code>--use-locals/-l</code> option in baksmali, to use the .locals directive instead of the .registers directive</li>
<li>Added support for the <code>--sequential-labels/-q</code> option in baksmali, which causes baksmali to create label names using a sequential numbering scheme, instead of basin it on the bytecode address</li>
<li>Added support for automatically upgrading const-string to const-string/jumbo when needed and upgrading goto or goto/16 to goto/16 or goto/32 when needed</li>
<li>Added support for the <code>--no-fix-string-const/-c</code> option in smali, to prevent automatically upgrading const-string instructions to const-string/jumbo</li>
<li>Added support for the <code>--no-fix-goto/-g</code> option in smali, to prevent automatically upgrading goto and goto/16 instructions</li>
<li>Added support for the <code>--no-debug-info/-b</code> option in baksmali, to prevent the output of any type of debugging info (.local, .line, .parameter, etc.)</li>
<li>misc. bugfixes</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jf.andblogs.net/2009/12/25/have-a-very-smali-christmas/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>smali v0.9!</title>
		<link>http://jf.andblogs.net/2009/06/07/smali-v09/</link>
		<comments>http://jf.andblogs.net/2009/06/07/smali-v09/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 03:19:41 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[smali]]></category>

		<guid isPermaLink="false">http://jf.andblogs.net/?p=127</guid>
		<description><![CDATA[After lots and lots of work, the first release of smali (dex assembler) is out finally! I&#8217;ll try and get a wiki going on the googlecode page with some documentation, as far as usage and syntax goes. But for now, you can look at the examples and tests to see the syntax. There are tests [...]]]></description>
			<content:encoded><![CDATA[<p>After lots and lots of work, the first release of <a href="http://smali.googlecode.com">smali</a> (dex assembler) is out finally!</p>
<p><span id="more-127"></span>I&#8217;ll try and get a wiki going on the googlecode page with some documentation, as far as usage and syntax goes. But 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.</p>
<p>Next up, I&#8217;ll get started on baksmali, the disassembler companion to smali.</p>
]]></content:encoded>
			<wfw:commentRss>http://jf.andblogs.net/2009/06/07/smali-v09/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Yes, I&#8217;m still here.</title>
		<link>http://jf.andblogs.net/2009/04/14/yes-im-still-here/</link>
		<comments>http://jf.andblogs.net/2009/04/14/yes-im-still-here/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 03:40:49 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[smali]]></category>

		<guid isPermaLink="false">http://jf.andblogs.net/?p=38</guid>
		<description><![CDATA[Those crazy guys over at xda-dev have been asking where I am. I&#8217;m still around . I&#8217;ve stopped visiting xda-dev on a regular basis, mainly due to the high volume of posts there now. I just can&#8217;t keep up with it any more. Will I still be doing &#8220;JF&#8221; releases? Yes. I may (and I [...]]]></description>
			<content:encoded><![CDATA[<p>Those crazy guys over at <a href="http://forum.xda-developers.com/showthread.php?t=499468">xda-dev</a> have been asking where I am. I&#8217;m still around <img src='http://jf.andblogs.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I&#8217;ve stopped visiting xda-dev on a regular basis, mainly due to the high volume of posts there now. I just can&#8217;t keep up with it any more.</p>
<p><span id="more-38"></span>Will I still be doing &#8220;JF&#8221; releases? Yes. I may (and I stress may) release a JFized version based on a build from the master branch of the <a href="http://android.git.kernel.org/">AOSP source</a>. In the mean time, Disconnect has released <a href="http://andblogs.net/2009/03/want-your-cupcake-and-your-gmail/">an image</a> based on some work I had done to get google apps working in master, and haykuro is doing some nice work with the <a href="http://haykuro.theiphoneproject.org/">sapphire release</a>. I also plan to keep releasing JF versions of new official G1 firmwares (English only) as they come out.</p>
<p>So what have I been spending my time on the past month or two? I&#8217;ve been working on <a href="http://smali.googlecode.com"><strong>smali</strong>/<strong>baksmali</strong></a>, an assembler/disassembler for the dex format used by dalvik, Android&#8217;s Java VM. . The word &#8220;smali&#8221; is Icelandic for &#8220;assembler&#8221; and baksmali is &#8220;disassembler&#8221; (at least <a href="http://www.ismal.hi.is/ob/birta/index.cgi?safn=Computing&amp;sofn=Occupational+Therapy&amp;sofn=Project+Managing&amp;sofn=Chemistry&amp;sofn=GIS+Terminology&amp;sofn=Astronomy&amp;sofn=Geology&amp;sofn=Cars+I&amp;sofn=Sea+Animals&amp;sofn=Aviation&amp;sofn=Neologisms&amp;sofn=Statistics&amp;sofn=Psychology&amp;sofn=Vascular+Plant+Family+Names&amp;sofn=Computing&amp;sofn=Medicine&amp;sofn=Public+Administration&amp;sofn=Genetics&amp;sofn=Physics&amp;sofn=Carpentry&amp;sofn=Civil+Engineering.+Geological+Terms&amp;sofn=Cars+II&amp;sofn=Biology&amp;sofn=Auditing&amp;sofn=Seamanship&amp;sofn=Meeting+terms&amp;sofn=Utilizable+wood&amp;sofn=Country+names&amp;sofn=Currency&amp;sofn=Spelling&amp;sofn=Culinary+terms+from+the+Plant+Kingdom&amp;sofn=Translation&amp;sofn=Grammar&amp;sofn=Geography&amp;sofn=Economics&amp;sofn=Immunology&amp;sofn=Architecture&amp;sofn=Plants+(Icelandic)&amp;sofn=Political+Science&amp;sofn=Metallurgy&amp;sofn=Meteorology&amp;sofn=Electricity&amp;sofn=Environment&amp;sofn=Glossary+of+Fisheries+Terms&amp;fletta=00717&amp;frummal=Icelandic&amp;vinnumal=EN">as far</a> <a href="http://www.ismal.hi.is/ob/birta/index.cgi?safn=Computing&amp;frummal=English&amp;vinnumal=EN&amp;ord=assembler&amp;sofn=Architecture&amp;sofn=Astronomy&amp;sofn=Auditing&amp;sofn=Aviation&amp;sofn=Biology&amp;sofn=Carpentry&amp;sofn=Cars+I&amp;sofn=Cars+II&amp;sofn=Chemistry&amp;sofn=Civil+Engineering.+Geological+Terms&amp;sofn=Computing&amp;sofn=Country+names&amp;sofn=Culinary+terms+from+the+Plant+Kingdom&amp;sofn=Currency&amp;sofn=Economics&amp;sofn=Electricity&amp;sofn=Environment&amp;sofn=Genetics&amp;sofn=Geography&amp;sofn=Geology&amp;sofn=GIS+Terminology&amp;sofn=Glossary+of+Fisheries+Terms&amp;sofn=Grammar&amp;sofn=Immunology&amp;sofn=Medicine&amp;sofn=Meeting+terms&amp;sofn=Metallurgy&amp;sofn=Meteorology&amp;sofn=Neologisms&amp;sofn=Occupational+Therapy&amp;sofn=Physics&amp;sofn=Plants+(Icelandic)&amp;sofn=Political+Science&amp;sofn=Project+Managing&amp;sofn=Psychology&amp;sofn=Public+Administration&amp;sofn=Sea+Animals&amp;sofn=Seamanship&amp;sofn=Spelling&amp;sofn=Statistics&amp;sofn=Translation&amp;sofn=Utilizable+wood&amp;sofn=Vascular+Plant+Family+Names&amp;fletta=00698">as I</a> <a href="http://www.ismal.hi.is/ob/birta/index.cgi?safn=Computing&amp;frummal=English&amp;vinnumal=EN&amp;ord=assemble&amp;sofn=Architecture&amp;sofn=Astronomy&amp;sofn=Auditing&amp;sofn=Aviation&amp;sofn=Biology&amp;sofn=Carpentry&amp;sofn=Cars+I&amp;sofn=Cars+II&amp;sofn=Chemistry&amp;sofn=Civil+Engineering.+Geological+Terms&amp;sofn=Computing&amp;sofn=Country+names&amp;sofn=Culinary+terms+from+the+Plant+Kingdom&amp;sofn=Currency&amp;sofn=Economics&amp;sofn=Electricity&amp;sofn=Environment&amp;sofn=Genetics&amp;sofn=Geography&amp;sofn=Geology&amp;sofn=GIS+Terminology&amp;sofn=Glossary+of+Fisheries+Terms&amp;sofn=Grammar&amp;sofn=Immunology&amp;sofn=Medicine&amp;sofn=Meeting+terms&amp;sofn=Metallurgy&amp;sofn=Meteorology&amp;sofn=Neologisms&amp;sofn=Occupational+Therapy&amp;sofn=Physics&amp;sofn=Plants+(Icelandic)&amp;sofn=Political+Science&amp;sofn=Project+Managing&amp;sofn=Psychology&amp;sofn=Public+Administration&amp;sofn=Sea+Animals&amp;sofn=Seamanship&amp;sofn=Spelling&amp;sofn=Statistics&amp;sofn=Translation&amp;sofn=Utilizable+wood&amp;sofn=Vascular+Plant+Family+Names&amp;fletta=00696">can tell</a>). If there is anyone reading this who actually speaks Icelandic, feel free to correct me if I&#8217;m wrong.</p>
<p>Why Icelandic you ask? Because dalvik <a href="http://en.wikipedia.org/wiki/Dalvik_virtual_machine">is named after</a> an <a href="http://en.wikipedia.org/wiki/Dalv%C3%ADk">Icelandic fishing village</a>.</p>
<p>The assembler uses a syntax that is based on <a href="http://jasmin.sourceforge.net/guide.html">jasmin&#8217;s syntax</a>. It is close to the format that <a href="http://dedexer.sourceforge.net/">dedexer</a> outputs, but not exactly the same. There are several changes needed to capture specific information needed for reassembly, e.g. the .register directive, prototype info for method calls, etc. Here is a <a href="http://jf.pastebin.ca/1392450">simple &#8220;Hello World&#8221; class</a> that it is able to assemble.</p>
<p>There is still a lot of work to do on it, so don&#8217;t expect anything too very soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://jf.andblogs.net/2009/04/14/yes-im-still-here/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
