<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Yifan Lu</title>
	
	<link>http://yifan.lu</link>
	<description>Random stuff I'm making and thinking</description>
	<lastBuildDate>Sun, 08 Apr 2012 16:22:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/YifanLu" /><feedburner:info uri="yifanlu" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>YifanLu</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>[April Fools] Electronic Arts Inc. announces the closing of Yifan Lu</title>
		<link>http://feedproxy.google.com/~r/YifanLu/~3/Bo76gnWIl74/</link>
		<comments>http://yifan.lu/2012/04/01/electronic-arts-inc-announces-the-closing-of-yifan-lu/#comments</comments>
		<pubDate>Sun, 01 Apr 2012 16:13:52 +0000</pubDate>
		<dc:creator>Yifan Lu</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<guid isPermaLink="false">http://yifan.lu/?p=551</guid>
		<description><![CDATA[KATY, Texas, Apr 01, 2012 (BUSINESS WIRE) &#8212; Electronic Arts Inc. (NASDAQ: ERTS) today announced it will be permanently closing it&#8217;s doors at Yifan Lu. &#8220;The hardest part of my job is laying off employees. That and making games. Shit&#8217;s hard, we should start doing that soon.&#8221; commented EA CEO John Riccitiello in an earnings [...]]]></description>
			<content:encoded><![CDATA[<p>KATY, Texas, Apr 01, 2012 (BUSINESS WIRE) &#8212; Electronic Arts Inc. (NASDAQ: ERTS) today announced it will be permanently closing it&#8217;s doors at Yifan Lu. &#8220;The hardest part of my job is laying off employees. That and making games. Shit&#8217;s hard, we should start doing that soon.&#8221; commented EA CEO John Riccitiello in an earnings call following the announcement of the cuts. &#8220;It was tough having to get rid of such an awesome guy, but because of the drops of profits caused weak game sales (which was in correlation to the increase in the IQ of an average video game buyer), we had to make difficult decisions.&#8221; Yifan Lu has been responsible for hit titles such as TBA, Coming Spring 2013, and Project Canceled.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/6d6zpxRmMM-y4BQwPRV_JKEEJ_U/0/da"><img src="http://feedads.g.doubleclick.net/~a/6d6zpxRmMM-y4BQwPRV_JKEEJ_U/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/6d6zpxRmMM-y4BQwPRV_JKEEJ_U/1/da"><img src="http://feedads.g.doubleclick.net/~a/6d6zpxRmMM-y4BQwPRV_JKEEJ_U/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/YifanLu?a=Bo76gnWIl74:MO9D6VlvilQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=Bo76gnWIl74:MO9D6VlvilQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=Bo76gnWIl74:MO9D6VlvilQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=Bo76gnWIl74:MO9D6VlvilQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=Bo76gnWIl74:MO9D6VlvilQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=Bo76gnWIl74:MO9D6VlvilQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=Bo76gnWIl74:MO9D6VlvilQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=Bo76gnWIl74:MO9D6VlvilQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=Bo76gnWIl74:MO9D6VlvilQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=Bo76gnWIl74:MO9D6VlvilQ:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/YifanLu/~4/Bo76gnWIl74" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://yifan.lu/2012/04/01/electronic-arts-inc-announces-the-closing-of-yifan-lu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://yifan.lu/2012/04/01/electronic-arts-inc-announces-the-closing-of-yifan-lu/</feedburner:origLink></item>
		<item>
		<title>[April Fools] Yifan Lu has been acquired by Electronic Arts Inc.</title>
		<link>http://feedproxy.google.com/~r/YifanLu/~3/qn1TucNz5UI/</link>
		<comments>http://yifan.lu/2012/04/01/yifan-lu-has-been-acquired-by-electronic-arts-inc/#comments</comments>
		<pubDate>Sun, 01 Apr 2012 16:00:42 +0000</pubDate>
		<dc:creator>Yifan Lu</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<guid isPermaLink="false">http://yifan.lu/?p=549</guid>
		<description><![CDATA[KATY, Texas, Apr 01, 2012 (BUSINESS WIRE) &#8212; Electronic Arts Inc. (NASDAQ: ERTS) today announced it has acquired Yifan Lu, a leading innovator and badass for $4.95 USD and two chicken sandwiches. The acquisition accelerates EA&#8217;s position in popular appeal and strengthens its focus on the destruction of gaming. Yifan Lu will operate within EA [...]]]></description>
			<content:encoded><![CDATA[<p>KATY, Texas, Apr 01, 2012 (BUSINESS WIRE) &#8212; Electronic Arts Inc. (NASDAQ: ERTS) today announced it has acquired Yifan Lu, a leading innovator and badass for $4.95 USD and two chicken sandwiches. The acquisition accelerates EA&#8217;s position in popular appeal and strengthens its focus on the destruction of gaming. Yifan Lu will operate within EA Sports, a division of EA focused on changing logo text.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/PzfpPEzPtWCoyPV8_OQ7FGFd47g/0/da"><img src="http://feedads.g.doubleclick.net/~a/PzfpPEzPtWCoyPV8_OQ7FGFd47g/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/PzfpPEzPtWCoyPV8_OQ7FGFd47g/1/da"><img src="http://feedads.g.doubleclick.net/~a/PzfpPEzPtWCoyPV8_OQ7FGFd47g/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/YifanLu?a=qn1TucNz5UI:DjjbSeUpQwc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=qn1TucNz5UI:DjjbSeUpQwc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=qn1TucNz5UI:DjjbSeUpQwc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=qn1TucNz5UI:DjjbSeUpQwc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=qn1TucNz5UI:DjjbSeUpQwc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=qn1TucNz5UI:DjjbSeUpQwc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=qn1TucNz5UI:DjjbSeUpQwc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=qn1TucNz5UI:DjjbSeUpQwc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=qn1TucNz5UI:DjjbSeUpQwc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=qn1TucNz5UI:DjjbSeUpQwc:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/YifanLu/~4/qn1TucNz5UI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://yifan.lu/2012/04/01/yifan-lu-has-been-acquired-by-electronic-arts-inc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://yifan.lu/2012/04/01/yifan-lu-has-been-acquired-by-electronic-arts-inc/</feedburner:origLink></item>
		<item>
		<title>Unlocking T-Mobile 4G Hotspot (ZTE MF61): A case study</title>
		<link>http://feedproxy.google.com/~r/YifanLu/~3/b3LKPysE3Aw/</link>
		<comments>http://yifan.lu/2012/03/07/unlocking-t-mobile-4g-hotspot-zte-mf61-a-case-study/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 02:22:48 +0000</pubDate>
		<dc:creator>Yifan Lu</dc:creator>
				<category><![CDATA[Assembly]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Qualcomm]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[4g]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[at]]></category>
		<category><![CDATA[disassembly]]></category>
		<category><![CDATA[flashing]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hexagon]]></category>
		<category><![CDATA[hotspot]]></category>
		<category><![CDATA[mdm8200a]]></category>
		<category><![CDATA[mf61]]></category>
		<category><![CDATA[modem]]></category>
		<category><![CDATA[nck]]></category>
		<category><![CDATA[objdump]]></category>
		<category><![CDATA[qsdp6]]></category>
		<category><![CDATA[tmobile]]></category>
		<category><![CDATA[toolchain]]></category>
		<category><![CDATA[unlocking]]></category>
		<category><![CDATA[zte]]></category>
		<guid isPermaLink="false">http://yifan.lu/?p=546</guid>
		<description><![CDATA[So, I have one of these MiFi clone from T-Mobile and want to unlock it to use on AT&#38;T (I know that AT&#38;T 4G/3G isn&#8217;t supported, but I thought maybe I could fix that later). The first thing I tried to do was contact T-Mobile, as they are usually very liberal concerning unlock codes. However, this [...]]]></description>
			<content:encoded><![CDATA[<p>So, I have one of <a href="http://www.t-mobile.com/shop/Phones/cell-phone-detail.aspx?cell-phone=T-Mobile-4G-Mobile-HotSpot">these MiFi clone</a> from T-Mobile and want to unlock it to use on AT&amp;T (I know that AT&amp;T 4G/3G isn&#8217;t supported, but I thought maybe I could fix that later). The first thing I tried to do was contact T-Mobile, as they are usually very liberal concerning unlock codes. However, <a href="http://support.t-mobile.com/thread/18034">this time</a>, T-Mobile (or, as they claim, the manufacture) isn&#8217;t so generous. So I&#8217;ve decided to take it upon myself to do it. I will write down the entire procedure here as a case study on how to &#8220;reverse engineer&#8221; a new device. However, in no way do I consider myself an expert, so feel free to bash me in the comments on what I did wrong. Also, I have decided against releasing any binaries or patches because phone unlocking is a grey area (although it is legal here), but if you read along you should be able to repeat what I did, even though I will also try to generalize.</p>
<p><strong>Getting information</strong></p>
<blockquote><p>The hardest part of any hack is the figuring-out-how-to-start phase. That&#8217;s always tricky. But&#8230; let the games begin.</p>
<p>-Wheatley, <em>Portal 2</em></p></blockquote>
<p>So before we can do anything, we need to know what to do. The best place to begin is to look <a href="http://tmodc.hcac.com/T-Mobile4GMobileHotSpot/FirmwareMac/Mac.htm">at the updater</a>. A quick look at the extracted files, we find that the files being flashed have names such as &#8220;amss.mbn&#8221;, &#8220;dsp1.mbn&#8221;, and such. A quick scan with a hex editor, we see that the files are unencrypted and unsigned. That&#8217;s good news because it means we have the ability to change the code. A quick Google search shows us that these files are firmware files for Qualcomm basebands. Now, we need to find more information on this Qualcomm chip. You may try some more Google-fu, but I took another path and <a href="http://twitter.com/#!/yifanlu/statuses/160574621719080960">took apart the device</a> (not recommended if it&#8217;s any more complicated). In this case, I found that we are dealing with a Qualcomm MDM8200A device. Google that and you&#8217;ll find more information such as there are two DSP processors for the modem and on &#8220;apps&#8221; ARM processor (presumably for T-Mobile&#8217;s custom firmare, and is what you see as the web interface). We want to unlock the device, so I assume the work is done in the DSP processor. That&#8217;s the first problem. QDSP6 (I found this name through more Google skills) is not a supported processor in IDA Pro, my go-to tool, so we need another way to disassemble it.</p>
<p><strong>Disassembly</strong></p>
<p>Some more Googling (I&#8217;m sure you can see a pattern on how this works now) leads me to <a href="https://developer.qualcomm.com/hexagon-processor">this</a>. QDSP6 is actually called &#8220;Hexagon&#8221; by Qualcomm and they kindly provided an EBI and programmer&#8217;s guide. I guessed from the documents that there is a toolchain, but no more information is provided about it. More searching lead me to believe that the in-house toolchain is proprietary, but luckily, there is an <a href="https://www.codeaurora.org/patches/quic/hexagon/4.0/">open source implementation</a> that is being worked on. Having the toolchain means that we can use &#8220;objdump&#8221;, the 2nd most popular disassembly tool [Citation Needed]. So, it&#8217;s just a matter of sending dsp1.mbn and dsp2.mbn into objdump -x? Nope. It seems that our friends at ZTE either purposely or automatically (as part of the linker) stripped the &#8220;section headers&#8221; of the ELF file. I did a quick read of the <a href="http://www.skyfree.org/linux/references/ELF_Format.pdf">ELF specifications</a> and found that the &#8220;section headers&#8221; are not required for the program to run, but provides information for linking and such. What we did have was the &#8220;program headers&#8221;, which is sort of a stripped down version of the section headers. (Program headers only tell: 1) where each &#8220;section&#8221; is located in file and where to load it in memory, 2) is it program or data?, 3) readable? writable?, while section headers give more information like the name of each section and more on what the program/data section&#8217;s purpose is). What I then did is wrote my own section headers using the program headers as a guide and made up the names and other information (because they are not used in the actual disassembling anyways) with a hex editor. Then I pasted my headers into the file, changed some offsets, and objdump -x surrendered the assembly code. 180MB worth of it.</p>
<p><strong>Assembly</strong></p>
<p>So we have 180MB worth of code written in a language that could very well be greek. Luckily, as I&#8217;ve mentioned earlier, Qualcomm released a document detailing the QDSP assembly language and how it&#8217;s used. Most likely, you would be dealing with a more &#8220;popular&#8221; processor like ARM or x86 and would have access to more resources. However, for QDSP6/Hexagon, we have two PDF documents and that is basically the Bible that we need to memorize. I then spend a couple of hours learning this new assembly language (assembly isn&#8217;t that hard once you embrace it) and figured out the basics needed to reverse engineer (that is: jumps, store/loads, and arithmetic). Now, another problem arises. We have literally 3 million lines of assembly code with no function names, no symbols, and no &#8220;sections&#8221;. How do we find where the goal (the function that checks the NCK key and unlocks the device accordantly) without spending the next two years decoding this mess? Here, we need to do some assumptions. First, we know   (through Google) that the AT modem command for inputting the NCK key is AT+ZNCK=&#8221;keyhere&#8221; for ZTE devices. So, let&#8217;s look for &#8220;ZNCK&#8221; in the hex editor of dsp1.mbn and dsp2.mbn. (If you are not as lucky and don&#8217;t know what the AT command is, I would put money that the command will contain the word NCK, so just search that). In dsp2.mbn, we find a couple of results. One of the results is in a group of other AT commands. Each command is next to a 4-byte hex value and a bunch of zero padding. I would guess that it is a jump table and the hex values are the memory locations of the functions to jump to. Doing a quick memory to file offset conversion (from our ELF program header), we locate the offset in our disassembly dump to find that it starts an &#8220;allocframe&#8221; instruction. That means we are at the beginning of a function so our assumptions must be right. Now, we can get to the crux of the problem, which is figuring out how the keycheck works.</p>
<p><strong>Mapping out the functions</strong></p>
<p>We now know where the function of interest starts, but we don&#8217;t know where it ends. It&#8217;s easy to find out though, look for a jump to lr (in this case for this processor, it&#8217;s a instruction to jump r31). We start at the beginning of the function and we copy all the instruction until we see a non-conditional jump. We paste the data into another text file (for easier reference). Then we go to the next location in the disassembly (where it would have jumped to) and copy the instruction until we see another non-conditional jump, and then paste them into the second text file. Keep doing this until you see a jump to r31. We now have most of the function. Notice I kept saying &#8220;non-conditional&#8221; jumps. That&#8217;s because first, we just need the code that ALWAYS runs, just to filter out stuff we don&#8217;t need. Now, we should get the other branches just so we have more information. To do this, just follow each jump or function call in the same way as we did for the main function. I would also recommend writing some labels like &#8220;branch1&#8243; and &#8220;func1&#8243; for each jump just so you can easily locate two jumps to the same location and such. I would also recommend only doing this up to three &#8220;levels&#8221; max (three function calls or three jumps) because it could get real messy real quick, and we will need more information so we can filter out un-needed code, as I will detail in the next section.</p>
<p><strong>Finding data references</strong></p>
<p>Right now, we are almost completely blind. All we know is what code is run. We don&#8217;t know the names of functions or what they do, and it would take forever to &#8220;map&#8221; every function and every function every function calls (and so on). So we need to obtain some information. The best would be to see what data the code is using. For this processor (and likely many others), a &#8220;global pointer&#8221; is used to refer to some constant data. So, look for references to &#8220;gp&#8221; in the disassembly. Searching from the very beginning of the program, we find that the global pointer is set to 0&#215;3500000, and according to the ELF headers, that is a section of the dsp2.mbn file at some file offset. In the section we care about, look for references to &#8220;gp&#8221; and use the offsets you find to locate the data they refer to. I would recommend adding some comments about them in the code so we don&#8217;t forget about them. Now, the global pointer isn&#8217;t everything, we can have regular hard-coded pointers to constant areas of memory. Look for setting of registers to large numbers. These are likely parameters to function calls that are too big to be just numerical data and are more likely pointers. Use the ELF header to translate the memory locations to file offsets. In this case (for this processor), some values may be split into rS.h and rS.l, these are memory locations that are too &#8220;large&#8221; to be set in the register at once. Just convert rS.h into a 16 bit integer, rS.l into a 16 bit integer (both might require zero padding in front), then combine them into one 32 bit integer where rS.h&#8217;s value is in front of rS.l&#8217;s value. For example, we have: r1.h = #384; r1.l = #4624. That will make r1 == 0&#215;1801210. You should also make some comments in the code about the data that is being used. Now, predict standard library calls. This may be the hardest step because it involves guessing and incorrect guessing may make other guess more wrong. You don&#8217;t have much information to go by, but you know 1) the values of some of the data being passed into function calls, and 2) library calls will usually be near the start of the program, or at least very far away from the current function. This will be harder if the function you are trying to map is already near the beginning of the program. The function I&#8217;m mapping is found at 0xf84c54, and most function calls are close to it. When I see a function call to 0xb02760, I know that it might be a library call. 3) Some of the more &#8220;common&#8221; functions and the types of parameters they accept. You don&#8217;t need to figure out all of the library calls, just enough to get an idea of what the code is doing so you don&#8217;t try to map out these functions (trying to map out strcpy, for example will get messy real quick). For example, one function call, I see is taking in a data pointer from a &#8220;gp&#8221; offset, a string that contains &#8220;%s: %d&#8221;, and some more data. I will assume it is calling fprintf(). I see another function is being called many times throughout the code, and it always accepts two pointers where the second one may be a constant and a number. I will assume it is calling memcpy().</p>
<p><strong>Translating</strong></p>
<p>This may be the most boring part. You should have enough information now to try to write a higher language code that does what the assembly code says. I would recommend doing this because it is much easier to see logic this way. I used C and started by doing a &#8220;literal&#8221; transcription using stuff like &#8220;r0-r31&#8243; as variable names and using goto. Then go back and try to simplify each section. In my process, I found that how the unlock key is checked is though sort of a hash function. It takes the user input, passes it through a huge algorithm of and/or/add/sub of more than 1000 lines and takes the result and compares it to a hard coded value in the NV ram (storage area for the device). Here, I made a choice to not go through and re-code this algorithm for two reasons. First, it would be of little use, as the key check doesn&#8217;t use a known value like the IMEI and relies on a hard coded value in the NV ram that you need to extract (which a regular user might have trouble doing). Second, after decoding it, we would have to do the algorithm backwards to find the key from the &#8220;known value&#8221; in the NV ram (and it could be that it would be impossible to work backwards). So I took the easy way out and made a 4-byte patch in where I let the program compare the known value to itself instead of to the generated hash from the input and flashed it to the device. Then I inputted a random key, and the device was unlocked.</p>
<p>Now, remember at the beginning I said the code was unsigned? Because of that I could easily have reflashed the firmware with my &#8220;custom&#8221; code. However, if your device has some way of preventing modified code from running, you may have no choice but to decode the algorithm.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/8l0lDGijkvXELemTivADB3b0wCs/0/da"><img src="http://feedads.g.doubleclick.net/~a/8l0lDGijkvXELemTivADB3b0wCs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8l0lDGijkvXELemTivADB3b0wCs/1/da"><img src="http://feedads.g.doubleclick.net/~a/8l0lDGijkvXELemTivADB3b0wCs/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/YifanLu?a=b3LKPysE3Aw:Xo1F0f8vutg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=b3LKPysE3Aw:Xo1F0f8vutg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=b3LKPysE3Aw:Xo1F0f8vutg:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=b3LKPysE3Aw:Xo1F0f8vutg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=b3LKPysE3Aw:Xo1F0f8vutg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=b3LKPysE3Aw:Xo1F0f8vutg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=b3LKPysE3Aw:Xo1F0f8vutg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=b3LKPysE3Aw:Xo1F0f8vutg:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=b3LKPysE3Aw:Xo1F0f8vutg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=b3LKPysE3Aw:Xo1F0f8vutg:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/YifanLu/~4/b3LKPysE3Aw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://yifan.lu/2012/03/07/unlocking-t-mobile-4g-hotspot-zte-mf61-a-case-study/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://yifan.lu/2012/03/07/unlocking-t-mobile-4g-hotspot-zte-mf61-a-case-study/</feedburner:origLink></item>
		<item>
		<title>Playstation Vita’s USB MTP Connection Analyzed</title>
		<link>http://feedproxy.google.com/~r/YifanLu/~3/5gGCoDOI22Y/</link>
		<comments>http://yifan.lu/2012/02/18/playstation-vitas-usb-mtp-connection-analyzed/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 02:54:07 +0000</pubDate>
		<dc:creator>Yifan Lu</dc:creator>
				<category><![CDATA[PS Vita]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[cma]]></category>
		<category><![CDATA[libusb]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mtp]]></category>
		<category><![CDATA[packet]]></category>
		<category><![CDATA[playstation]]></category>
		<category><![CDATA[psp]]></category>
		<category><![CDATA[psvita]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[vita]]></category>
		<guid isPermaLink="false">http://yifan.lu/?p=535</guid>
		<description><![CDATA[This is the first of (hopefully) many posts on the PS Vita. Before I attempt anything drastic with the device, such as getting unsigned code to run, I hope I can try something easy (well, easier) to get used to the device. Ultimately, I want to make a content manager for the PS Vita for [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first of (hopefully) many posts on the PS Vita. Before I attempt anything drastic with the device, such as getting unsigned code to run, I hope I can try something easy (well, easier) to get used to the device. Ultimately, I want to make a content manager for the PS Vita for Linux. Unlike the PSP, the Vita does not export the memory card as a USB storage device, but instead relies on their custom application to copy content to and from the device. This post will give just a peek into how the communication between the Vita and the PC works.</p>
<p>There are two ways of approaching this. One is to sniff the USB packets to figure out what data gets sent to and from the device, and second is to disassemble the content manager application to find out how it communicates with the device. I tried both methods.</p>
<p><strong>Reverse engineering the Content Manager</strong></p>
<p>The biggest problem here is that the PC version of Sony&#8217;s content manager has its symbols removed. This makes everything a hundred times harder as you would have a harder time guessing what each function does. Luckily, the OSX version of the content manager does have the symbols intact. The problem here is that IDA does not work perfectly with Objective-C (it works, but you get a C++ish interpretation of Objective-C). I have a good idea of how the application is laid out, but there isn&#8217;t much point giving all the details (not useful). I will give some important points:</p>
<ul>
<li>The Vita uses the <a href="http://en.wikipedia.org/wiki/Media_Transfer_Protocol">Media Transfer Protocol</a>, however I am not sure if it adheres completely to standards or if it uses a custom implementation</li>
<li>USB endpoint 0&#215;2 is for input, while 0&#215;81 is for data output, and 0&#215;83 is for MTP event output</li>
<li>There is support for passing PSN account information to and from the Vita (password would be in plain text!), but it is unimplemented</li>
<li>CMA uses a SQLite database to index media information and licenses</li>
</ul>
<div>Also, I&#8217;ve compiled a list of MTP operation codes for the Vita that are referenced in CMA (and therefore implemented in the Vita). Note that some of the codes are not in the <a href="http://www.usb.org/developers/devclass_docs/MTP_1.0.zip">standards</a> while others are. For events, the second number is for reference with regards to the jump-table inside CMA only.</div>
<p><code><br />
Events:<br />
0xC104 0: RequestSendNumOfObject<br />
0xC105 1: RequestSendObjectMetadata<br />
0xC107 3: RequestSendObject<br />
0xC108 4: RequestCancelTask<br />
0xC10B 7: RequestSendHttpObjectFromURL<br />
0xC10F 11: RequestSendObjectStatus<br />
0xC110 12: RequestSendObjectThumb<br />
0xC111 13: RequestDeleteObject<br />
0xC112 14: RequestGetSettingInfo<br />
0xC113 15: RequestSendHttpObjectPropFromURL<br />
0xC115 17: RequestSendPartOfObject<br />
0xC117 19: RequestOperateObject<br />
0xC118 20: RequestGetPartOfObject<br />
0xC119 21: RequestSendStorageSize<br />
0xC120 28: RequestCheckExistance<br />
0xC122 30: RequestGetTreatObject<br />
0xC123 31: RequestSendCopyConfirmationInfo<br />
0xC124 32: RequestSendObjectMetadataItems<br />
0xC125 33: RequestSendNPAccountInfo<br />
0xC801 1789: Unimplemented (seen when getting object from Vita)</p>
<p>Commands:<br />
0x1001: GetDeviceInfo<br />
0x1002: OpenSession<br />
0x1007: GetObjectHandles<br />
0x1008: GetObjectInfo<br />
0x1009: GetObject<br />
0x100C: SendObjectInfo<br />
0x100D: SendObject<br />
0x101B: GetPartialObject<br />
0x9511: GetVitaInfo<br />
0x9513: SendNumOfObject<br />
0x9514: GetBrowseInfo<br />
0x9515: SendObjectMetadata<br />
0x9516: SendObjectThumb<br />
0x9518: ReportResult<br />
0x951C: SendInitiatorInfo<br />
0x951F: GetUrl<br />
0x9520: SendHttpObjectFromURL<br />
0x9523: SendNPAccountInfo<br />
0x9524: GetSettingInfo<br />
0x9528: SendObjectStatus<br />
0x9529: SendHttpObjectPropFromUR<br />
0x952A: SendHostStatus<br />
0x952B: SendPartOfObject (?)<br />
0x952C: SendPartOfObject (?)<br />
0x952E: OperateObject<br />
0x952F: GetPartOfObject<br />
0x9533: SendStorageSize<br />
0x9534: GetTreatObject<br />
0x9535: SendCopyConfirmationInfo (?)<br />
0x9536: SendObjectMetadataItems<br />
0x9537: SendCopyConfirmationInfo (?)<br />
0x9538: KeepAlive<br />
0x9802: ?<br />
0x9803: GetObjectPropValue<br />
0x9805: GetObjectPropList</p>
<p>Response:<br />
0x2001: OK<br />
0x2002: GeneralError<br />
0x2006: ParameterNotSupported<br />
0x2007: IncompleteTransfer<br />
0x200C: StoreFull<br />
0x200D: ObjectWriteProtected<br />
0x2013: StoreNotAvailable<br />
0x201D: InvalidParameter<br />
0xA002: ?<br />
0xA003: ?<br />
0xA004: ?<br />
0xA00A: ?<br />
0xA00D: ?<br />
0xA008: ?<br />
0xA010: ?<br />
0xA012: ?<br />
0xA017: ?<br />
0xA018: ?<br />
0xA01B: ?<br />
0xA01C: ?<br />
0xA01F: ?<br />
0xA020: ?<br />
0xA027: ?</p>
<p>Data Types:<br />
0xDC01: StorageID<br />
0xDC02: ObjectFormat<br />
0xDC03: ProtectionStatus<br />
0xDC04: ObjectSize<br />
0xDC05: AssociationType<br />
0xDC07: ObjectFileName<br />
0xDC08: DateCreated<br />
0xDC09: DateModified<br />
0xDC0A: Keywords<br />
0xDC0B: ParentObject<br />
0xDC0C: AllowedFolderContents<br />
0xDC0D: Hidden<br />
0xDC0E: SystemObject<br />
0xDC41: PersistentUniqueObjectIdentifier<br />
0xDC42: SyncID<br />
0xDC43: PropertyBag<br />
0xDC44: Name<br />
0xDC45: CreatedBy<br />
0xDC46: Artist</p>
<p>Object Formats:<br />
0x3000: Undefined<br />
0x3001: Association<br />
0x3008: WAV<br />
0x3009: MP3<br />
0x3801: EXIF/JPEG<br />
0x3804: BMP<br />
0x3806: UndefinedReserved<br />
0x380A: PICT<br />
0x380B: PNG<br />
0xB007: PSPGame<br />
0xB00A: PSPSave<br />
0xB014: VitaGame<br />
0xB400: ?<br />
0xB411: MNV<br />
0xB984: MNV2<br />
0xB982: MP4/MGV/M4V/MNV3<br />
</code><br />
<strong>USB packets</strong></p>
<p>I&#8217;ve also captured the USB packets for initializing the device (from device plug-in to Vita displaying the content menu) and gave my best interpretation of it. First line is PC to Vita packet or Vita to PC packet</p>
<p>, followed by packets captured by VMWare running Windows 7, followed by the same action on OSX (dumped from memory using GDB on CMA, not from capturing USB packets), followed by my interpretation of what the packet does (question mark means not sure). EDIT: Some of my comments in the log I know are wrong now.<br />
<iframe style="border: none; width: 100%;" src="http://pastebin.com/embed_iframe.php?i=JKWG1dHQ" width="320" height="240"></iframe></p>
<p><strong>Next time</strong></p>
<p>I&#8217;m hoping to decode these packets and implement them using libusb. I hope Sony is using the MTP standard so I can also make use of libmtp. I also need to be more familiar with how the USB protocol works so I can understand the packet layout better.</p>
<p><strong>EDIT:</strong> I&#8217;ve begun work on a <a href="https://github.com/yifanlu/VitaMTP">new project</a> to create an open source content manager for the Vita. As of this post, it can init the device and tell it to show the main menu.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/1U9HQTFu6VrPafhWe7zATXzSNqk/0/da"><img src="http://feedads.g.doubleclick.net/~a/1U9HQTFu6VrPafhWe7zATXzSNqk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/1U9HQTFu6VrPafhWe7zATXzSNqk/1/da"><img src="http://feedads.g.doubleclick.net/~a/1U9HQTFu6VrPafhWe7zATXzSNqk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/YifanLu?a=5gGCoDOI22Y:cITcsLGVDu0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=5gGCoDOI22Y:cITcsLGVDu0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=5gGCoDOI22Y:cITcsLGVDu0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=5gGCoDOI22Y:cITcsLGVDu0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=5gGCoDOI22Y:cITcsLGVDu0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=5gGCoDOI22Y:cITcsLGVDu0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=5gGCoDOI22Y:cITcsLGVDu0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=5gGCoDOI22Y:cITcsLGVDu0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=5gGCoDOI22Y:cITcsLGVDu0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=5gGCoDOI22Y:cITcsLGVDu0:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/YifanLu/~4/5gGCoDOI22Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://yifan.lu/2012/02/18/playstation-vitas-usb-mtp-connection-analyzed/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://yifan.lu/2012/02/18/playstation-vitas-usb-mtp-connection-analyzed/</feedburner:origLink></item>
		<item>
		<title>Welcome to the new yifan.lu!</title>
		<link>http://feedproxy.google.com/~r/YifanLu/~3/f4OwTSwmGv4/</link>
		<comments>http://yifan.lu/2012/01/12/welcome-to-the-new-yifan-lu/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 00:08:13 +0000</pubDate>
		<dc:creator>Yifan Lu</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Information]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[yifan.lu]]></category>
		<guid isPermaLink="false">http://yifan.lu/?p=446</guid>
		<description><![CDATA[It&#8217;s a new year, and I&#8217;m a bit tired of the old design. There were some main problems with it besides the looks though. The biggest one is I never wrote a backend for my &#8220;projects&#8221; list, so every time I add a new project, I&#8217;m doing it manually by uploading the files via FTP [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a new year, and I&#8217;m a bit tired of the old design. There were some main problems with it besides the looks though. The biggest one is I never wrote a backend for my &#8220;projects&#8221; list, so every time I add a new project, I&#8217;m doing it manually by uploading the files via FTP and adding the entry in phpmyadmin. In addition, I&#8217;m sure there were tons of PHP bugs and security holes that I had in the old script. The old theme was also badly coded with many HTML errors and many WordPress incompatibilities.</p>
<p>On this new version of the site, the first thing I did was integrate my <a href="http://yifan.lu/projects/">projects list</a> to WordPress. I wrote a custom plugin that allows me to manage and add my projects with ease and manage things like downloads, version/changlog, screenshots, etc. I may release this plugin as open source one day. I also got a new style thanks to <a href="http://www.cssheaven.org">CSSHeaven</a>. They provided the free HTML template and I coded it into a WordPress style (and also made it more HTML5 compliant). If you have any complaints or suggestions regarding the new site, feel free to comment.</p>
<p>In addition, I added <a title="Kindle GUI Launcher" href="http://yifan.lu/p/kindlelauncher/">two</a> <a href="http://yifan.lu/p/kindletool/">new</a> Kindle projects that I&#8217;ve been working on.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/i2m5k4Ge32vfG_rze4RolEpBLPE/0/da"><img src="http://feedads.g.doubleclick.net/~a/i2m5k4Ge32vfG_rze4RolEpBLPE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/i2m5k4Ge32vfG_rze4RolEpBLPE/1/da"><img src="http://feedads.g.doubleclick.net/~a/i2m5k4Ge32vfG_rze4RolEpBLPE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/YifanLu?a=f4OwTSwmGv4:60_J3FBCIRs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=f4OwTSwmGv4:60_J3FBCIRs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=f4OwTSwmGv4:60_J3FBCIRs:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=f4OwTSwmGv4:60_J3FBCIRs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=f4OwTSwmGv4:60_J3FBCIRs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=f4OwTSwmGv4:60_J3FBCIRs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=f4OwTSwmGv4:60_J3FBCIRs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=f4OwTSwmGv4:60_J3FBCIRs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=f4OwTSwmGv4:60_J3FBCIRs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=f4OwTSwmGv4:60_J3FBCIRs:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/YifanLu/~4/f4OwTSwmGv4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://yifan.lu/2012/01/12/welcome-to-the-new-yifan-lu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://yifan.lu/2012/01/12/welcome-to-the-new-yifan-lu/</feedburner:origLink></item>
		<item>
		<title>Kindle Touch (5.0) Jailbreak/Root and SSH</title>
		<link>http://feedproxy.google.com/~r/YifanLu/~3/Up6mdDrS9D0/</link>
		<comments>http://yifan.lu/2011/12/10/kindle-touch-5-0-jailbreakroot-and-ssh/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 06:32:26 +0000</pubDate>
		<dc:creator>Yifan Lu</dc:creator>
				<category><![CDATA[Kindle]]></category>
		<category><![CDATA[Releases]]></category>
		<guid isPermaLink="false">http://yifan.lu/?p=332</guid>
		<description><![CDATA[Update Kindle 5.0.3 has fixed the hole to allow for jailbreak. Upgrading an already jailbroken Kindle Touch is fine as the update does not remove the custom key to allow custom packages. If you on 5.0.3 and have not already installed the key, there is a new jailbreak. So long story short, we can run custom [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong> Kindle 5.0.3 has fixed the hole to allow for jailbreak. Upgrading an already jailbroken Kindle Touch is fine as the update does not remove the custom key to allow custom packages. If you on 5.0.3 and have not already installed the key, there is <a href="http://www.mobileread.com/forums/showpost.php?p=1927673&amp;postcount=84" target="_blank">a new jailbreak</a>.</p>
<p>So long story short, we can run custom code on the Kindle Touch now but because the operating system has changed so much from Kindle 3, most Kindle modifications will not run without changes. I hope developers will jump to this device now that it&#8217;s unlocked. See the bottom of the post for download links. The directions for using are in the readme. Keep reading for technical details on how this came about.</p>
<p><strong>Obtaining the root image</strong><br />
Before we can look for vulnerabilities in the system that would allow us to break in, we need to break into the system and obtain the files that might contain vulnerabilities. Yes, this is a chicken-and-egg problem, but fortunately Amazon is nice enough to help us with this. On every Kindle device is a TTL serial port. I <a href="http://yifan.lu/wp-content/uploads/2011/12/serial_port.jpg">found this port</a> on the bottom of the device when the <a href="http://www.mobileread.com/forums/showpost.php?p=1863158&amp;postcount=191">cover is opened</a>. Fortunately, I did not even have to mess with it, as <strong>hondamarlboro</strong> and <strong>ramirami </strong>both managed to get the dump before me. Once we have the root image, it was only a matter of painstakingly looking through all the files to see possible injection vectors.</p>
<p><strong>Looking for the needle</strong></p>
<p>At first, I was digging deep into the system, disassembling and maping out various native libraries, looking for stack overflows (I found a couple but none could be accessed efficiently). I found the <a href="http://www.mobileread.com/forums/showpost.php?p=1866389&amp;postcount=196">bootloader was unlocked</a> but it would be a pain and danger for users (and even developers) to flash custom kernels and such. I also found that the Java code (the Kindle&#8217;s entire GUI is written in Java) is NOT obfuscated (which means it would be easier to reverse and later modify) and Amazon has left in many places to place plugins. For example, once someone has the time to figure things out, it would be very possible to write a EPUB extension to read EPUBs from the native reader. There are some other hidden secrets in the device too. The Kindle Touch has an accelerometer and proximity sensor (and a mic, but we know that) but they aren&#8217;t used in the software (yet). The more I looked into the system, I was aware that because it was such a huge rewrite, I had misjudged when I assumed that it would be harder to break as Amazon had years to fix the holes now. In fact, I would say that the Kindle 4 is more secure until I found out that <a href="http://www.mobileread.com/forums/showpost.php?p=1868403&amp;postcount=202">Amazon left in SSH in diagnostics mode</a>. Anyways, as I searched up the complexity chain from the bootloader to the kernel to the libraries to the Java interface, I found something very curious. Much of the operating system is no longer written in Java, but are now in HTML5 and Javascript. In fact, many of the interfaces on the Touch are actually web pages in disguise. For example: the password entry screen, the search bar, the browser (is just an HTML page with a frame), the Wifi selection screen, and even the music player. Obviously, these can&#8217;t all run natively in HTML and JS, or the device will be even slower (and it is pretty damn slow). What Amazon did is write a couple of Javascript hooks that are implemented by native libraries and events are read by these libraries and they perform actions accordantly. In short, Javascript will run native code. This is a goldmine, there could be many possible ways of using this to our advantage. There could be buffer overflows, heap overflows, string formatting bugs, etc. However, I didn&#8217;t have to look though much before I found a curious function: nativeBridge.dbgCmd();. It seems too good to be true. This function takes any shell command, and runs it (as root). Yup. The web browser will run as root, any command given to it. Don&#8217;t go looking for remote code execution yet (although it is highly possible), as the native bridge seems to be disabled when in web browser mode (it may be able to be bypassed, but I haven&#8217;t looked into it).</p>
<p><strong>Calling the debug function</strong></p>
<p>So the normal browser (as the one you can enter URLs into) can&#8217;t make use of this native bridge. However, as I&#8217;ve mentioned, a large part of the GUI in the Kindle Touch is HTML and JavaScript. All we need to do is inject some HTML into one of these and we would be all set. We need something that takes input and displays it to the user. The first thing I thought of was the media player. The Kindle displays the song title, artist, and album name in the music player, so what if we put some HTML into the ID3 tag? Yup, it works. How about some javascript? Running. Let&#8217;s try to call the debug function. It works. Well, that was a freebie.<script type="text/javascript">// < ![CDATA[
// < ![CDATA[
// < ![CDATA[
// < ![CDATA[
// < ![CDATA[
// < ![CDATA[
// < ![CDATA[  tag? Still working. Ok, let's call nativeBridge.dbgCmd('reboot'). Yup, the Kindle is rebooting. An XSS code execution vulnerability? Well, that was a freebie.
// ]]&gt;</script></p>
<p><strong>Having some fun</strong></p>
<p>That was a bit too easy and I was disappointed that I didn&#8217;t get to talk about how I whipped out IDA Pro and did some master debugging. So, let&#8217;s make things harder. We can use a MP3 with custom ID3 tags to execute any command, but how can we make this into a cool one-click solution? First of all, we should limit ourselves to one file to copy. Why make the user keep track of MP3s and shell scripts and where to put them? I took the shell script payload (which installs a developer key into the device so custom packages can be installed) and placed it into the comments section of the ID3 tag in the MP3. Then I used &#8220;dd&#8221; to extract the script, chmod it, and execute it. Now, another problem in terms of user friendliness is how to let the user know that the process was successful? I quickly whipped up an awesome looking &#8220;splash screen&#8221; and planned on displaying it while the magic is taking place. At first I tried to encode it into a variable in the shell script payload and extract it, but it was too slow and memory intensive. Instead, I took the image, raw, and appended it into the end of the MP3 (after all, the file was a bit too small). You can see the result in the video attached.</p>
<p><strong>What&#8217;s next?</strong></p>
<p>Just because the device is jailbroken does not mean it can now magically do anything you want. What needs to happen first is that developers need to take the device and write some code for it. This first jailbreak is really for these developers. For regular users, the only use is to preemptively unlock your device now in case the method is patched in an update or something. <strong>No mods for older Kindles will work as-is on the Touch.</strong> I&#8217;ve included a VERY basic usbnetwork package that will allow you to have SSH access to the device. I think that&#8217;s as good of a starting point as anything. From there, developers should be able to rip the root filesystem, test modifications, and write useful tweaks. (And in case of a brick, read my <a href="http://www.mobileread.com/forums/showpost.php?p=1866389&amp;postcount=196">previous post</a> on the bootloader access). Some things I would have to see or do is GUI plugins in the device&#8217;s operating system. The Java code is easy to decompile and read as the variable names have not been stripped out (like previous models). Hopefully people can write some reader plugins (like X-Ray) or even format plugins for other ebook formats. Being a touch screen device, one could also write games or useful apps (although the speed and eink are limiting). I need to finish writing the update creation tool so developers can package their modifications.</p>
<p><strong>Download</strong></p>
<p><a href="http://yifan.lu/p/kindle-touch-jailbreak">Download the jailbreak here</a></p>
<p><a href="https://github.com/downloads/yifanlu/KindleTool/simple_screensaver_1.0.zip">Simple custom screensaver mod</a></p>
<p><a href="https://github.com/downloads/yifanlu/KindleTool/simple_usbnet_1.1.zip">Simple usbnet update (supports wifi ssh and resetting root password)</a></p>
<p><a href="https://github.com/yifanlu/KindleLauncher/downloads">GUI menu launcher and screen rotation hack</a></p>
<p><strong>Demonstration </strong><br />
<iframe src="http://www.youtube.com/embed/HMyv6nSAOU0" frameborder="0" width="420" height="315"></iframe></p>

<p><a href="http://feedads.g.doubleclick.net/~a/weniM5j3oLjWfhA7Sz_wSqWozU4/0/da"><img src="http://feedads.g.doubleclick.net/~a/weniM5j3oLjWfhA7Sz_wSqWozU4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/weniM5j3oLjWfhA7Sz_wSqWozU4/1/da"><img src="http://feedads.g.doubleclick.net/~a/weniM5j3oLjWfhA7Sz_wSqWozU4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/YifanLu?a=Up6mdDrS9D0:DDpylt9e9q4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=Up6mdDrS9D0:DDpylt9e9q4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=Up6mdDrS9D0:DDpylt9e9q4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=Up6mdDrS9D0:DDpylt9e9q4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=Up6mdDrS9D0:DDpylt9e9q4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=Up6mdDrS9D0:DDpylt9e9q4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=Up6mdDrS9D0:DDpylt9e9q4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=Up6mdDrS9D0:DDpylt9e9q4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=Up6mdDrS9D0:DDpylt9e9q4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=Up6mdDrS9D0:DDpylt9e9q4:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/YifanLu/~4/Up6mdDrS9D0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://yifan.lu/2011/12/10/kindle-touch-5-0-jailbreakroot-and-ssh/feed/</wfw:commentRss>
		<slash:comments>175</slash:comments>
		<feedburner:origLink>http://yifan.lu/2011/12/10/kindle-touch-5-0-jailbreakroot-and-ssh/</feedburner:origLink></item>
		<item>
		<title>Reversing the Xperia Play emulator (part deux)</title>
		<link>http://feedproxy.google.com/~r/YifanLu/~3/eVIm-_FdIzI/</link>
		<comments>http://yifan.lu/2011/11/27/reversing-the-xperia-play-emulator-part-deux/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 23:45:01 +0000</pubDate>
		<dc:creator>Yifan Lu</dc:creator>
				<category><![CDATA[Assembly]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Xperia Play]]></category>
		<guid isPermaLink="false">http://yifan.lu/?p=329</guid>
		<description><![CDATA[The last time we spoke, I managed to run any PSX game on the Xperia Play by redirecting some function calls. Well, since then Sony (you could say) fixed it (still don&#8217;t know how, I should look into it one day, I&#8217;m guessing they revoked the certificates for Crash Bandicoot) and people running Android 2.3.4 [...]]]></description>
			<content:encoded><![CDATA[<p>The <a title="Reverse engineering a dynamic library on the Xperia Play" href="http://yifan.lu/2011/08/07/reverse-engineering-a-dynamic-library-on-the-xperia-play/">last time we spoke</a>, I managed to run any PSX game on the Xperia Play by redirecting some function calls. Well, since then Sony (you could say) fixed it (still don&#8217;t know how, I should look into it one day, I&#8217;m guessing they revoked the certificates for Crash Bandicoot) and people running Android 2.3.4 on the Xperia Play can&#8217;t use PSXPeria anymore. I&#8217;ve re-patched it a while ago, but never got the chance to modify the patching tool to use the new method (I really hate Java and don&#8217;t want to use it, so I held back.) until today. As&nbsp;customary&nbsp;to my releases, I will begin by telling more than what you want to know about how it works.</p>
<p><strong>Previously on &#8220;cracking the emulator&#8221;&#8230;</strong></p>
<p>If you haven&#8217;t read the <a title="Analyzing the PSX emulator on the Xperia Play" href="http://yifan.lu/2011/08/01/analyzing-the-psx-emulator-on-the-xperia-play/">last&nbsp;posts</a> I&#8217;ve made about how I reverse engineered the emulator data format and binary, you may want to, but I&#8217;ll&nbsp;summarize&nbsp;it in a few words. Basically, the emulator was&nbsp;separated&nbsp;into two binaries bin-one decrypts bin-two and bin-two asks bin-one to decrypt and load the game&#8217;s table-of-contents which is used to load the game. The TOC is important because anyone can replace the game data files, but it won&#8217;t load because the TOC contains addresses of the places to decompress in the game data. Well, after the hard part of&nbsp;reversing&nbsp;the formats and finding all this out, the actual patch was fairly easy. All we did was make a new library with the same function name as the one that is used by bin-two to query bin-one for the TOC, and use it to load the TOC for our custom game and make sure that library loads before Sony&#8217;s and the rest is almost magic. We don&#8217;t need to overwrite any function pointers or even touch the emulator because the linker looks for the first&nbsp;definition&nbsp;of a function and calls it.</p>
<p><strong>How Sony made our lives harder</strong></p>
<p>So version 1 is always easiest to break. This applies for almost everything. The PSP, the iPhone, the DS, etc. Version 2 is where it gets real. So what are the changes? First of all, no more bi-binary system. There is a single binary that does both the decrypting and emulating. Oh, and they removed the symbols so we can no longer search for &#8220;GetImageToc&#8221; and find where the function is. Also, they&#8217;ve started verifying that ISOs.</p>
<p><strong>Finding the needle</strong></p>
<p>Before we can begin to think about patching, we first need to find what to patch. As I&#8217;ve mentioned, Sony removed the symbols, so we no longer know what the function names are. We CAN try to map out the entire binary (10MB) and look for something that does what appears to be decrypting a TOC, but we don&#8217;t have months or a team of assembly experts. What we DO have is the older version of the binary that has the symbols. Assuming that they didn&#8217;t rewrite the emulator from scratch, the structure should be similar. We open up the old binary, find the function that calls the ones we want to patch, and look for identifying&nbsp;characteristics. What are they? Well, we look for mentions of unique strings and unique calls to standard functions (unique as in&nbsp;something&nbsp;like atoi, not malloc, which is called every other line). Luckily we have both. It seems like a few lines before the function we are interested in, the program does something with the string&nbsp;&#8221;/data/image.ps&#8221; and&nbsp;sometimes&nbsp;afterwards, uncompress is called. Now we have the address of the functions we want to patch.</p>
<p><strong>Patching the function</strong></p>
<p>Well, here&#8217;s our second problem. What do we patch the function with? We are only limited to the length of what the function originally is, but I&#8217;m sure that&#8217;s not a problem for experts. I&#8217;m not an expert though, so how about we steal what Sony did in version 1? We use dlsym to call the function from a loaded binary in memory. After a quick trip to an assembly reference, I wrote the following code:&nbsp;https://github.com/yifanlu/PSXPeria-Wrapper/blob/master/jni/java-activity-patch.S, I would go into more details, but I believe my comments on the code explains it better than I could. The only other thing we need is to manually define the address for &#8220;dlsym&#8221; and the offset for the name of the function. ARM assembly uses relative address, so I haven&#8217;t come up with a quick way to do this yet. For now, I&#8217;m using a calculator and a piece of paper to find the address of dlsym relative to the patch in the program. Comment if you have a better way.</p>
<p><strong>Phase 2</strong></p>
<p>When the game didn&#8217;t boot and was frozen on screen, I knew it had to be another&nbsp;obstacle. Our code had to have worked because otherwise, it would have crashed. Debugging with GDB, it seems like the program is blocking forever, seemingly on purpose. To double check, I loaded Crash Bandicoot again, but with my patched emulator and it worked. So, I guess there was a check somewhere that only loads Crash Bandicoot. Yes, I could go back into IDA and look for where the check is and NOP it out, but I was tired by then and my short attention span wants me to work on something else, so I took the easy way out and patched the PSX image with the titleid for Crash Bandicoot. As far as I know, this shouldn&#8217;t affect anything in terms of&nbsp;compatibility, but farther tests are needed.</p>
<p><strong>Next week on &#8220;cracking the emulator&#8221;&#8230;</strong></p>
<p>Version 3 of the emulator is already out and is distributed in the PS-Suite games in the Japanese PSN store (on the Play). I already took a look at it, and the emulator did not seem to be updated, so I didn&#8217;t try hard to patch it. However, it seems that they implemented many new security&nbsp;mechanisms&nbsp;in the PS-Suite PSX games. For starters, there is a public-private key exchange to make sure all the files in the APK are untouched, and I&#8217;m pretty sure the PS-Image is now encrypted or the format has changed. Now, Sony did not do all this to prevent us from loading our own games (or maybe they did). I suspect it&#8217;s to prevent pirates from stealing the PSN games. Which means that if I crack the version 3 emulator, I may be helping piracy. This means, I will most likely not touch the PS-Suite emulators, and if I do, two things have to happen. 1) I need to be sure that the emulator has much better&nbsp;compatibility, and 2) I need a way to make sure that my tool isn&#8217;t going to be used for piracy. So I guess this may be the last release for a while.</p>
<p><strong>Links</strong></p>
<p><a href="http://yifan.lu/p/psxperia">Project Page</a><br />
<a href="https://github.com/yifanlu/PSXperia">Source</a><br />
<a href="https://github.com/yifanlu/PSXperia/downloads">Downloads</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/pQ_RKnt46ZFhDl_LBEc28lUrC-Y/0/da"><img src="http://feedads.g.doubleclick.net/~a/pQ_RKnt46ZFhDl_LBEc28lUrC-Y/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/pQ_RKnt46ZFhDl_LBEc28lUrC-Y/1/da"><img src="http://feedads.g.doubleclick.net/~a/pQ_RKnt46ZFhDl_LBEc28lUrC-Y/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/YifanLu?a=eVIm-_FdIzI:hrYkUF5nKFU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=eVIm-_FdIzI:hrYkUF5nKFU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=eVIm-_FdIzI:hrYkUF5nKFU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=eVIm-_FdIzI:hrYkUF5nKFU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=eVIm-_FdIzI:hrYkUF5nKFU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=eVIm-_FdIzI:hrYkUF5nKFU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=eVIm-_FdIzI:hrYkUF5nKFU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=eVIm-_FdIzI:hrYkUF5nKFU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=eVIm-_FdIzI:hrYkUF5nKFU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=eVIm-_FdIzI:hrYkUF5nKFU:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/YifanLu/~4/eVIm-_FdIzI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://yifan.lu/2011/11/27/reversing-the-xperia-play-emulator-part-deux/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://yifan.lu/2011/11/27/reversing-the-xperia-play-emulator-part-deux/</feedburner:origLink></item>
		<item>
		<title>Analyzing Kindle 4.0</title>
		<link>http://feedproxy.google.com/~r/YifanLu/~3/_jNSNFxOcpc/</link>
		<comments>http://yifan.lu/2011/09/28/analyzing-kindle-4-0/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 01:21:55 +0000</pubDate>
		<dc:creator>Yifan Lu</dc:creator>
				<category><![CDATA[Kindle]]></category>
		<category><![CDATA[Technical]]></category>
		<guid isPermaLink="false">http://yifan.lu/?p=320</guid>
		<description><![CDATA[Well, Amazon might as well have stolen my wallet, because I am going to lose a couple hundreds of dollars. However, what fun is a Kindle if we can&#8217;t run our own code? (Answer: still pretty fun, but that&#8217;s besides the point.) Anyways, I haven&#8217;t gotten my hands on the new Kindles yet, but I [...]]]></description>
			<content:encoded><![CDATA[<p>Well, Amazon might as well have stolen my wallet, because I am going to lose a couple hundreds of dollars. However, what fun is a Kindle if we can&#8217;t run our own code? (Answer: still pretty fun, but that&#8217;s besides the point.) Anyways, I haven&#8217;t gotten my hands on the new Kindles yet, but I got the next best thing: a software update from Amazon (http://www.amazon.com/gp/help/customer/display.html/?nodeId=200774090)</p>
<p>If you want to follow me and others try to crack this thing, visit this thread on <a href="http://www.mobileread.com/forums/showthread.php?p=1762199">MobileRead</a>.</p>
<p>I&#8217;ll post some of the more important stuff we find on this post, so check back regularly.</p>
<ul>
<li>The update format has changed! No more signatures for each file in the update, the update itself is signed and will refuse to extract unless the signature check passes. That means no more easy way out. To get &#8220;kindle_update_tool.py&#8221; to recognize and extract the new update, remove the signature (first 0&#215;140 bytes) and change &#8220;FC04&#8243; to &#8220;FC02&#8243; (Bytes 0&#215;0 to 0&#215;4 after trimming the signature header). Now delete 4 bytes starting from 0&#215;8 and 6 bytes starting from 0&#215;10. (Offsets depend on the SP01 part removed). Now &#8220;kindle_update_tool.py&#8221; will recognize it.</li>
<li>Kindle 4.0 is codenamed &#8220;Yoshi&#8221; following &#8220;Luigi&#8221; (3.0) and &#8220;Mario&#8221; (2.0) (I can&#8217;t remember 1.0). It is built for the <strong><a href="http://www.freescale.com/webapp/sps/site/taxonomy.jsp?code=IMX50_FAMILY">iMX50</a></strong> (800MHz ARM Cortex A8) platform. The Kindle 3 is iMX35 (532MHz ARM) and the Kindle 2/DX is iMX3 (400MHz ARM).</li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/MH049qYLI8ekJ-61trgtAtVHs6I/0/da"><img src="http://feedads.g.doubleclick.net/~a/MH049qYLI8ekJ-61trgtAtVHs6I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/MH049qYLI8ekJ-61trgtAtVHs6I/1/da"><img src="http://feedads.g.doubleclick.net/~a/MH049qYLI8ekJ-61trgtAtVHs6I/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/YifanLu?a=_jNSNFxOcpc:aHN7P1pF5ks:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=_jNSNFxOcpc:aHN7P1pF5ks:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=_jNSNFxOcpc:aHN7P1pF5ks:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=_jNSNFxOcpc:aHN7P1pF5ks:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=_jNSNFxOcpc:aHN7P1pF5ks:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=_jNSNFxOcpc:aHN7P1pF5ks:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=_jNSNFxOcpc:aHN7P1pF5ks:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=_jNSNFxOcpc:aHN7P1pF5ks:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=_jNSNFxOcpc:aHN7P1pF5ks:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=_jNSNFxOcpc:aHN7P1pF5ks:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/YifanLu/~4/_jNSNFxOcpc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://yifan.lu/2011/09/28/analyzing-kindle-4-0/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://yifan.lu/2011/09/28/analyzing-kindle-4-0/</feedburner:origLink></item>
		<item>
		<title>Installing Windows 8 Developer Preview (8102) on a USB Drive (Windows To Go/Portable Workspace)</title>
		<link>http://feedproxy.google.com/~r/YifanLu/~3/QQ_sJz2GyQI/</link>
		<comments>http://yifan.lu/2011/09/17/installing-windows-8-developer-preview-8102-on-a-usb-drive-windows-to-goportable-workspace/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 21:20:57 +0000</pubDate>
		<dc:creator>Yifan Lu</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[build 2011]]></category>
		<category><![CDATA[dvd]]></category>
		<category><![CDATA[hard drive]]></category>
		<category><![CDATA[portable workspace]]></category>
		<category><![CDATA[pwcreator]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows 8]]></category>
		<category><![CDATA[windows to go]]></category>
		<guid isPermaLink="false">http://yifan.lu/?p=312</guid>
		<description><![CDATA[This really isn&#8217;t some technical or hard to do thing, but it&#8217;s a cool little trick I found that I haven&#8217;t seen mentioned before. If you don&#8217;t know what &#8220;Windows To Go&#8221; (previously &#8220;Portable Workspace&#8221;), watch this video from the Build 2011 conference. Basically, it allows you to install a full copy of Windows 8 [...]]]></description>
			<content:encoded><![CDATA[<p>This really isn&#8217;t some technical or hard to do thing, but it&#8217;s a cool little trick I found that I haven&#8217;t seen mentioned before. If you don&#8217;t know what &#8220;Windows To Go&#8221; (previously &#8220;Portable Workspace&#8221;), watch <a href="http://channel9.msdn.com/Events/BUILD/BUILD2011/HW-245T">this video from the Build 2011 conference</a>. Basically, it allows you to install a full copy of Windows 8 onto a USB drive/external hard drive and use it on any computer that supports USB booting. Your settings, files, programs, etc go where-ever you go. The feature is in Windows 8 (and the developer preview), but the program to make the drive is not. Luckily, an old leaked build has the program, but you can&#8217;t just copy and paste it, it won&#8217;t run. Instead, follow the directions below to get Windows 8 installed to a USB drive. (I used a virtual machine to do the following, therefore I did not need to burn any DVDs. I will give the directions assuming you&#8217;re using a real computer though).</p>
<p><strong>Requirements:</strong></p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/windows/apps/br229516">Windows 8 Developer Preview</a> burned to a DVD (unless you&#8217;re using virtual machine)</li>
<li>Windows 8 M1 build 7850 burned to a DVD (unless you&#8217;re using virtual machine)</li>
<li>16GB flash drive or external hard drive (or larger)</li>
</ul>
<div><strong>Directions:</strong></div>
<div>
<ol>
<li>Install Windows 8 M1 build 7850. (I tried just copying pwcreator.exe and running it on a later build, but it didn&#8217;t work.)</li>
<li>Open the start menu and type in &#8220;pwcreator.exe&#8221; and press enter. Alternatively, find and open C:\Windows\System32\pwcreator.exe</li>
<li>Choose your USB drive and continue.</li>
<li>Insert the Windows 8 M1 build 7850 DVD again and continue.</li>
<li>Before starting the build process, take out the Windows 8 M1 build 7850 DVD and insert your Windows 8 Developer Preview build 8102 DVD.</li>
<li>Continue and allow the process to finish.</li>
</ol>
<div>I tested it with the x86 version of the Developer Preview, so I don&#8217;t know how well or if it will work with the x64 build. When you are asked to activate Windows, you can skip it or enter one of the keys found in the Developer Preview DVD under D:\Sources\product.ini (assuming D: is your DVD). I haven&#8217;t figured out which key to use yet.</div>
</div>
<div>Also, the requirements in pwcreator.exe states that you need a 16GB USB drive. However Windows only really need 12GB to install. I have a 16GB flash drive that shows up as 15GB and it wouldn&#8217;t work. I used GParted in Ubuntu to copy the partitions from a larger USB drive over after creating the image and it works fine. Just a tip.</div>

<p><a href="http://feedads.g.doubleclick.net/~a/8Kx7D-p_43PkWUw4rqRb_WPrsEI/0/da"><img src="http://feedads.g.doubleclick.net/~a/8Kx7D-p_43PkWUw4rqRb_WPrsEI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8Kx7D-p_43PkWUw4rqRb_WPrsEI/1/da"><img src="http://feedads.g.doubleclick.net/~a/8Kx7D-p_43PkWUw4rqRb_WPrsEI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/YifanLu?a=QQ_sJz2GyQI:Blmuv3uPqYQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=QQ_sJz2GyQI:Blmuv3uPqYQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=QQ_sJz2GyQI:Blmuv3uPqYQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=QQ_sJz2GyQI:Blmuv3uPqYQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=QQ_sJz2GyQI:Blmuv3uPqYQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=QQ_sJz2GyQI:Blmuv3uPqYQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=QQ_sJz2GyQI:Blmuv3uPqYQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=QQ_sJz2GyQI:Blmuv3uPqYQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=QQ_sJz2GyQI:Blmuv3uPqYQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=QQ_sJz2GyQI:Blmuv3uPqYQ:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/YifanLu/~4/QQ_sJz2GyQI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://yifan.lu/2011/09/17/installing-windows-8-developer-preview-8102-on-a-usb-drive-windows-to-goportable-workspace/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://yifan.lu/2011/09/17/installing-windows-8-developer-preview-8102-on-a-usb-drive-windows-to-goportable-workspace/</feedburner:origLink></item>
		<item>
		<title>Kindle 3.2.1 Jailbreak (Update)</title>
		<link>http://feedproxy.google.com/~r/YifanLu/~3/omkhJTy86DQ/</link>
		<comments>http://yifan.lu/2011/09/01/kindle-3-2-1-jailbreak-update/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 20:23:36 +0000</pubDate>
		<dc:creator>Yifan Lu</dc:creator>
				<category><![CDATA[Kindle]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[3.2.1]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[jailbreak]]></category>
		<category><![CDATA[kindle]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[update]]></category>
		<guid isPermaLink="false">http://yifan.lu/?p=303</guid>
		<description><![CDATA[When I first released the Kindle 3.2.1 jailbreak, I called it &#8220;temporary.&#8221; Although confusing to use and set up, it has gotten thousands of hits and reports of success. However, it was &#8220;temporary&#8221; because the method used depended on some precise timing and I had a better method that I was saving for Kindle 3.3. [...]]]></description>
			<content:encoded><![CDATA[<p>When I first released the Kindle 3.2.1 jailbreak, I called it &#8220;temporary.&#8221; Although confusing to use and set up, it has gotten thousands of hits and reports of success. However, it was &#8220;temporary&#8221; because the method used depended on some precise timing and I had a better method that I was saving for Kindle 3.3. Now, I realize that 3.3 will never come, but will instead be 4.0 that will come with Kindle 4, and with a new hardware, everything doesn&#8217;t matter. <a href="http://www.mobileread.com/forums/showpost.php?p=1725629&#038;postcount=151">Serge A. Levin</a> has independently discovered a similar bug for what I was going to use on the 3.3 jailbreak, and I&#8217;ve asked him to release it because he deserves the credit for the work. If we&#8217;re lucky, Amazon will fix the bug in a way that my similar plan for 3.3/4.0 will still work.</p>
<p>(If you are already jailbroken, regardless of what version you&#8217;re running, you don&#8217;t need to download this. The actual jailbreak hasn&#8217;t been updated, just the injection method.)</p>
<p>Also, if you think that the jailbreak didn&#8217;t work, try installing a custom package anyways. I have fixed many people&#8217;s &#8220;I can&#8217;t get it working&#8221; by telling them that it&#8217;s already jailbroken.</p>
<p><a href="http://yifan.lu/p/kindle-jailbreak">Link to jailbreak for all devices on all versions</a>.</p>
<p>EDIT: It seems like there is some confusion so I&#8217;ll clear this up. <strong>Jailbreaking does NOT remove ads.</strong></p>

<p><a href="http://feedads.g.doubleclick.net/~a/Sm5VmW-Pw6SzyVln03M6Z6_EiJg/0/da"><img src="http://feedads.g.doubleclick.net/~a/Sm5VmW-Pw6SzyVln03M6Z6_EiJg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Sm5VmW-Pw6SzyVln03M6Z6_EiJg/1/da"><img src="http://feedads.g.doubleclick.net/~a/Sm5VmW-Pw6SzyVln03M6Z6_EiJg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/YifanLu?a=omkhJTy86DQ:wHmZoX-aRzw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=omkhJTy86DQ:wHmZoX-aRzw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=omkhJTy86DQ:wHmZoX-aRzw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=omkhJTy86DQ:wHmZoX-aRzw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/YifanLu?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=omkhJTy86DQ:wHmZoX-aRzw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=omkhJTy86DQ:wHmZoX-aRzw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=omkhJTy86DQ:wHmZoX-aRzw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=omkhJTy86DQ:wHmZoX-aRzw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/YifanLu?a=omkhJTy86DQ:wHmZoX-aRzw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/YifanLu?i=omkhJTy86DQ:wHmZoX-aRzw:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/YifanLu/~4/omkhJTy86DQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://yifan.lu/2011/09/01/kindle-3-2-1-jailbreak-update/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		<feedburner:origLink>http://yifan.lu/2011/09/01/kindle-3-2-1-jailbreak-update/</feedburner:origLink></item>
	</channel>
</rss>

