<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.theiphonewiki.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Westbaer</id>
	<title>The iPhone Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.theiphonewiki.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Westbaer"/>
	<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/wiki/Special:Contributions/Westbaer"/>
	<updated>2026-06-27T21:40:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.14</generator>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=IRecovery&amp;diff=8095</id>
		<title>IRecovery</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=IRecovery&amp;diff=8095"/>
		<updated>2010-08-11T13:17:48Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:iTunes}}&lt;br /&gt;
iRecovery is a libusb-based CLI utility for Mac OS X, Linux, and Windows. It is able to talk to [[iBoot]] and [[iBSS]] via USB. It's completely open source; the source code is released under the terms of the GNU GPL v3. The full license text can be found in the LICENSE file on github.&lt;br /&gt;
&lt;br /&gt;
It currently connects to:&lt;br /&gt;
* [[DFU 0x1227|0x1227]] ([[DFU]]/[[WTF]] Mode 2.0)&lt;br /&gt;
* [[Recovery Mode (Protocols)#Recovery_Mode_2.x_.28DevID.3D0x1281.29|Recovery Mode 0x1281]] (Recovery Mode/iBSS)&lt;br /&gt;
&lt;br /&gt;
==Credits==&lt;br /&gt;
westbaer&lt;br /&gt;
&lt;br /&gt;
==Thanks==&lt;br /&gt;
[[pod2g]], [[tom3q]], [[planetbeing]], [[User:Geohot|geohot]] and [[posixninja]].&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
&lt;br /&gt;
===DFU 2.0 (0x1227)===&lt;br /&gt;
It can upload a file, such as an [[iBSS]], so that you can unplug and spawn a shell with 0x1281.&lt;br /&gt;
&lt;br /&gt;
===Recovery 2.0 (0x1281)===&lt;br /&gt;
====File Uploading====&lt;br /&gt;
You can upload a file to 0x9000000 with the following syntax:&lt;br /&gt;
 ./iRecovery -f file&lt;br /&gt;
In newer builds that use libusb-1.0 this is now&lt;br /&gt;
 ./iRecovery -u file&lt;br /&gt;
&lt;br /&gt;
====Two-Way Shell====&lt;br /&gt;
You can spawn a shell to do all sorts of neat things with the syntax:&lt;br /&gt;
 ./iRecovery -s&lt;br /&gt;
Once it has spawned, you can type 'help' and iBoot will respond with its built-in command list.&lt;br /&gt;
&lt;br /&gt;
====Single Command====&lt;br /&gt;
 ./iRecovery -c &amp;quot;command&amp;quot;&lt;br /&gt;
Sends a single command to the device *without* spawning a shell.&lt;br /&gt;
&lt;br /&gt;
====usb_control_msg(0x21, 2) Exploit Command====&lt;br /&gt;
 ./iRecovery -k &lt;br /&gt;
Sends Chronic Dev's + Geohot's latest usb exploit. Implemented into blackra1n.&lt;br /&gt;
This was updated near October 17, 2009. [http://github.com/posixninja/irecovery posixninja's fork]&lt;br /&gt;
In newer builds this is now -e&lt;br /&gt;
&lt;br /&gt;
====Auto Boot====&lt;br /&gt;
You can now enable auto-boot by running:&lt;br /&gt;
 ./iRecovery -a&lt;br /&gt;
or by sending /auto-boot in a shell.&lt;br /&gt;
&lt;br /&gt;
====USB Reset====&lt;br /&gt;
Reset USB&lt;br /&gt;
 ./iRecovery -r&lt;br /&gt;
&lt;br /&gt;
====Batch Scripting====&lt;br /&gt;
iRecovery now supports batch scripting, this allows you to send commands to iBoot from a pre written list of commands, this also suports scripting such as /auto-boot and /upload &amp;lt;file&amp;gt;&lt;br /&gt;
 ./iRecovery -b &amp;lt;file&amp;gt;&lt;br /&gt;
or in a shell:&lt;br /&gt;
 /batch &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Raw Commands====&lt;br /&gt;
You can now send raw commands via the -x21 -x40 or -xA1 flags&lt;br /&gt;
&lt;br /&gt;
==Example Output==&lt;br /&gt;
&lt;br /&gt;
iRecovery -s&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
======================================&lt;br /&gt;
::&lt;br /&gt;
:: iBSS for n82ap, Copyright 2009, Apple Inc.&lt;br /&gt;
::&lt;br /&gt;
:: BUILD_TAG: iBoot-596.24&lt;br /&gt;
::&lt;br /&gt;
:: BUILD_STYLE: RELEASE&lt;br /&gt;
::&lt;br /&gt;
:: USB_SERIAL_NUMBER: CPID:8900 CPRV:30 CPFM:03 SCEP:05 BDID:04 ECID:000003293C113D76 IBFL:00&lt;br /&gt;
::&lt;br /&gt;
=======================================&lt;br /&gt;
&lt;br /&gt;
Entering recovery mode, starting command prompt&lt;br /&gt;
] printenv&lt;br /&gt;
build-style = &amp;quot;RELEASE&amp;quot;&lt;br /&gt;
build-version = &amp;quot;iBoot-596.24&amp;quot;&lt;br /&gt;
config_board = &amp;quot;n82ap&amp;quot;&lt;br /&gt;
loadaddr = &amp;quot;0x9000000&amp;quot;&lt;br /&gt;
boot-command = &amp;quot;fsboot&amp;quot;&lt;br /&gt;
bootdelay = &amp;quot;0&amp;quot;&lt;br /&gt;
auto-boot = &amp;quot;true&amp;quot;&lt;br /&gt;
idle-off = &amp;quot;true&amp;quot;&lt;br /&gt;
boot-device = &amp;quot;nand0&amp;quot;&lt;br /&gt;
boot-partition = &amp;quot;0&amp;quot;&lt;br /&gt;
boot-path = &amp;quot;/System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8900x&amp;quot;&lt;br /&gt;
display-color-space = &amp;quot;RGB888&amp;quot;&lt;br /&gt;
display-timing = &amp;quot;optC&amp;quot;&lt;br /&gt;
framebuffer = &amp;quot;0xfd00000&amp;quot;&lt;br /&gt;
secure-boot = &amp;quot;0x1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Forks==&lt;br /&gt;
[http://github.com/iH8sn0w/irecovery iH8sn0w/irecovery]&lt;br /&gt;
&lt;br /&gt;
[http://github.com/GreySyntax/irecovery GreySyntax/irecovery]&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
A C++ port is also in the works dubbed iRecovery++ (by [[User:GreySyntax|GreySyntax]]). [http://github.com/GreySyntax/iRecoveryplusplus]&lt;br /&gt;
&lt;br /&gt;
A C# port using LibUSBDotNET can be found at (by [[User:GreySyntax|GreySyntax]]). [http://github.com/GreySyntax/Alpine]&lt;br /&gt;
&lt;br /&gt;
A VB.NET port is currently under development (by [[User:Fallensn0w|Fallensn0w]]). [http://github.com/fallensn0w/vbiRecovery]&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
[http://github.com/chronicdev/libirecovery Offical Repository (Maintained) / Download here]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=AT%2BXAPP_Vulnerability&amp;diff=6627</id>
		<title>AT+XAPP Vulnerability</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=AT%2BXAPP_Vulnerability&amp;diff=6627"/>
		<updated>2010-06-22T19:42:42Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: Credits &amp;amp; Formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Used as an injection vector for the current iPhone 3G and iPhone 3GS unlock payloads‭ - ‬ultrasn0w 0.93‭. ‬Currently available in all baseband versions until 05.13.04‭.‬&lt;br /&gt;
‭&lt;br /&gt;
== Credit ==&lt;br /&gt;
&lt;br /&gt;
* '''vulnerability''': [http://twitter.com/sherif_hashim sherif_hashim], also discovered independently by [http://twitter.com/westbaer westbaer], also discovered independently by [[geohot]]&lt;br /&gt;
* '''exploitation''': [[iPhone Dev Team]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exploit ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is a stack overflow in the AT+XAPP‭=&amp;quot;...&amp;quot; ‬command‭, ‬which allows unsigned code execution on the [[X-Gold 608]]&lt;br /&gt;
&lt;br /&gt;
 at+xapp=&amp;quot;‬0000111122223333444455556666777788889999000011112222&amp;quot;‬&lt;br /&gt;
&lt;br /&gt;
applying a string of more than 52‭ ‬characters will trigger the overflow&lt;br /&gt;
‭&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exploit was used by [[iPhone Dev Team]] in [[Ultrasn0w]] 0.93‭ which is able to unlock 4.26.08‭, ‬5.11.07‭, ‬5.12.01‭ ‬and 5.13.04‭ ‬BB firmwares&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Category‭: ‬Baseband Exploits&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Recovery_Mode&amp;diff=5971</id>
		<title>Recovery Mode</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Recovery_Mode&amp;diff=5971"/>
		<updated>2010-03-30T08:34:39Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: It does work on iPhone 2G.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Recovery Mode is a failsafe in [[iBoot]] that is used to reflash the device with a new OS, whether the currently installed one is somehow damaged or the device is undergoing an upgrade via [[iTunes]].&lt;br /&gt;
&lt;br /&gt;
== Entering Recovery Mode ==&lt;br /&gt;
# Turn the device completely off and disconnect it from cable/dock.&lt;br /&gt;
# Hold down the home button.&lt;br /&gt;
# While holding down the home button connect to a computer with a cable (easiest) or dock.&lt;br /&gt;
# Keep holding down the home button until you see a connect-to-[[iTunes]] screen (on a QuickPwn'ed phone a drawing of Steve might be shown). You are now in recovery mode.&lt;br /&gt;
&lt;br /&gt;
To escape Recovery Mode and power the phone off simply hold down power and home buttons for ten seconds.&lt;br /&gt;
&lt;br /&gt;
==Protocols==&lt;br /&gt;
*[[Recovery Mode 0x1280]] in pre-2.0&lt;br /&gt;
*[[Recovery Mode 0x1281]] in 2.0 and above&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=IRecovery&amp;diff=5350</id>
		<title>IRecovery</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=IRecovery&amp;diff=5350"/>
		<updated>2009-11-03T16:50:49Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;iRecovery is a libusb-based commandline utility for Mac OS X , Linux ,and Windows . It is able to talk to the iBoot/iBSS in Apple's iPhone/iPod touch via USB. &lt;br /&gt;
&lt;br /&gt;
It's completely open-source, the source-code is released under the terms of the GNU General Public License version 3.&lt;br /&gt;
The full license text can be found in the LICENSE file on github.&lt;br /&gt;
&lt;br /&gt;
It currently connects to 0x1281 (iPhone, iPhone 3G, iPod touch, iPod touch 2G: Recovery Mode/iBSS), 0x1227 (iPhone, &lt;br /&gt;
iPhone 3G, iPod touch: WTF Mode; iPod touch 2G: DFU Mode).&lt;br /&gt;
&lt;br /&gt;
==Credits==&lt;br /&gt;
westbaer&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
&lt;br /&gt;
===DFU 2.0 (0x1227)===&lt;br /&gt;
It can upload a file, such as an iBSS, so that you can unplug and spawn a shell with 0x1281.&lt;br /&gt;
&lt;br /&gt;
===Recovery 2.0 (0x1281)===&lt;br /&gt;
====File Uploading====&lt;br /&gt;
You can upload a file to 0x9000000 with the following syntax:&lt;br /&gt;
 ./iRecovery -f file&lt;br /&gt;
&lt;br /&gt;
====Two-Way Shell====&lt;br /&gt;
You can spawn a shell to do all sorts of neat things with the syntax:&lt;br /&gt;
 ./iRecovery -s&lt;br /&gt;
Once it has spawned, you can type 'help' and iBoot will respond with its built-in command list.&lt;br /&gt;
&lt;br /&gt;
====Single Command====&lt;br /&gt;
 ./iRecovery -c &amp;quot;command&amp;quot;&lt;br /&gt;
Sends a single command to the device *without* spawning a shell.&lt;br /&gt;
&lt;br /&gt;
====usb_control_msg(0x21, 2) Exploit Command====&lt;br /&gt;
 ./iRecovery -k &lt;br /&gt;
Sends Chronic Dev's + Geohot's latest usb exploit. Implemented into blackra1n.&lt;br /&gt;
This was just updated a few days ago. (10/17/09) [http://github.com/posixninja/irecovery posixninja's fork]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
[http://github.com/westbaer/irecovery Offical Repository / Download here]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=0x24000_Segment_Overflow&amp;diff=5129</id>
		<title>0x24000 Segment Overflow</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=0x24000_Segment_Overflow&amp;diff=5129"/>
		<updated>2009-10-13T20:39:26Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: As this has *nothing* to do with NitroKey and/or the timing impact.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Also known by its codename, 24kPwn, this was the first exploit in the [[S5L8720]] that allowed us to bypass the bootrom signature checks on [[LLB]] and create what is known as an [[untethered jailbreak]].&lt;br /&gt;
&lt;br /&gt;
As of October 2009, seven months after the exposure of this hole, Apple is now selling updated [[iPhone 3GS]] units with a new bootrom, erasing the vulnerability used by this exploit.&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
A &amp;quot;hybrid&amp;quot; dev team, in alphabetical order: '''chronic''', '''CPICH''', '''ius''', '''MuscleNerd''', '''planetbeing''', '''pod2g''', '''posixninja''', et al. (anyone wishing to be unnamed)&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
&lt;br /&gt;
Upon boot-up, the [[S5L8720]] and [[S5L8920]] SoC have a MIU configuration which maps the [[VROM (S5L8720)|Secure ROM]] to 0x0, providing the newly turned on device with an ARM exception vector and the first code to execute. This MIU configuration also maps a small amount of SRAM to 0x22000000 for the [[S5L8720]], and 0x84000000 for the [[S5L8920]]. Statically allocated variables, heap, and stack must use the SRAM, as &amp;quot;[[VROM (S5L8720)|Secure ROM]]&amp;quot; is unwritable. A region of memory starting from (SRAM Start)+24000 is used for this purpose. The region of memory from the start of SRAM to (SRAM Start)+0x24000 is used as a buffer for loading the [[LLB|next stage bootloader]] code. The [[LLB]] code is stored in [[NOR]], along with code for all other bootloader stages, as well as art resources (boot logos) and the [[DeviceTree|OpenFirmware device tree]] to provide to the XNU [[kernel]]. The first portion (first 0x160 bytes) of memory at (SRAM Start)+0x24000 is used for initialized statically allocated variables. Shortly after boot, values for that region are initialized from [[VROM (S5L8720)|Secure ROM]].&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
The code that reads the [[LLB]] img3 from [[NOR]] into memory does not check the size of the [[LLB]] image being loaded, instead taking the size directly from the non-signature checked portion of its img3 header on the [[NOR]] (see ROM offset 0x2178). Any image greater than 0x24000 bytes in length will begin overwriting the portion of memory used to store Secure ROM statically allocated variables. Immediately vulnerable data includes USB data structures for [[DFU]] mode, a pointer to the bdev list structure, task list structures for the Secure ROM's scheduler, as well as the addresses of the hardware SHA1 registers. All of the above are potential avenues for exploitation.  The method described below uses the SHA1 register addresses.&lt;br /&gt;
&lt;br /&gt;
This vulnerability was discovered independently by '''pod2g''' and '''MuscleNerd'''.&lt;br /&gt;
&lt;br /&gt;
== Exploit==&lt;br /&gt;
&lt;br /&gt;
The goal of the exploit is to gain arbitrary code execution capability.&lt;br /&gt;
&lt;br /&gt;
The exploit, as proposed by '''planetbeing''', uses the overflow to overwrite one of the addresses of the SHA1 registers. The particular register is the only one that directly copies data to be hashed into the hardware (or into an arbitrary memory location, once the destination address has been overwritten). Code execution is achieved by writing data into the stack, specifically by overwriting the LR of the function performing the write to the &amp;quot;SHA1 register&amp;quot; so that instead of returning to the main SHA1 routine, it returns to a chosen location in memory that contains the payload code. The location chosen is within the range of memory that is filled with the [[LLB]] img3, so that the payload code can be placed within the [[LLB]] img3.&lt;br /&gt;
&lt;br /&gt;
The challenge is determining what to put in as the SHA1 register location so that the right portion of stack can be overwritten with the payload LR. This can be challenging without having access to any sort of exception dump (crash register dumps in the bootrom had been disabled by Apple). '''planetbeing''' performed a static analysis of a very detailed IDB produced by '''chronic''' and '''CPICH''' and determined the theoretical call stack for both of the invocations of the SHA1 hardware within the bootrom code [http://pastie.org/414981].&lt;br /&gt;
&lt;br /&gt;
In-situ verification of the LR location was performed by '''posixninja'''. '''CPICH''' discovered a way to alter the img3 DER so that the second invocation of the SHA1 hardware was not performed without affecting the first, allowing better confirmation that this step was performed properly.&lt;br /&gt;
&lt;br /&gt;
The final SHA1 register address was chosen so that the first dword of the DATA tag of the [[LLB]] img3 would replace sub_5E54's LR. This is because this is the first dword of the img3 that can be altered without substantially changing the img3's structure (and possibly disrupting earlier parsing code). The LR replacement must be done the first time the exploit is triggered (by the invocation of sub_5E54), or else the bootrom would crash. Since sub_5E54 takes 0x40 bytes of data at a time, the replacement LR thus must be within the first 0x40 bytes of data to be hashed. Data to be hashed starts at 0xC bytes from the start of the img3, and the first dword of the DATA tag is 0x20 bytes from the start of the img3. Thus, the SHA1 register address chosen should be 0x20 - 0xC = 0x14 bytes before sub_5E54's LR. So, it must be 0x2202FE24. Note that the exploit will also trash up to 0x2202FE24 + 0x40 = 0x2202FE64. So a sizeable portion of doComputeSHA1's stack will be trashed as well.&lt;br /&gt;
&lt;br /&gt;
The final exploit img3 was verified by '''posixninja''' under '''planetbeing''''s instructions to allow arbitrary code execution. It was a regular Img3 with padding up to 0x24000 bytes. The next 0x100 bytes were taken from the original initialization values for 0x22024000. However, 0x240FC, the offset of the SHA1 register address, was altered to 0x2202FE24. The first dword of the DATA tag (offset 0x20) was altered to 0x22023000. Payload code was placed at offset 0x23000.&lt;br /&gt;
&lt;br /&gt;
==Payload==&lt;br /&gt;
&lt;br /&gt;
The goal of the payload is to allow an unsigned [[LLB]] to be loaded.&lt;br /&gt;
&lt;br /&gt;
There are several ways that can be used, including directly calling the JumpToMemory function which is designed to prepare the SoC and invoke the [[LLB]] code. However, it's designed to be used on decrypted, unpacked code, and the [[LLB]] code currently resides in an encrypted from within the img3's DATA tag. The simplest solution is thus to use the bootrom's own machinery to decrypt and execute the code.&lt;br /&gt;
&lt;br /&gt;
The final payload evolved out of a discussion between '''pod2g''' and '''planetbeing''', based on an IDB documented by '''pod2g''', '''chronic''', '''CPICH''', et al. The lowest impact solution is to apply the pwnage patch to the rsaCheck subroutine of the bootrom, and returning from the payload from computing the SHA1 without crashing the bootrom. However, in this case, since bootrom text is unwritable, this was not a viable solution.&lt;br /&gt;
&lt;br /&gt;
The next lowest impact solution is to return from the entire parseFirmwareFooter function with a successful value, instead of the failure value it would normally return if signature checks fail. This would skip any remaining code  in that subroutine. This solution did not work in-situ. Failures checking the epoch tags prevented the firmware from being executed. The cause of this was not investigated.&lt;br /&gt;
&lt;br /&gt;
The final payload was to return past the verification of epoch and other tags in the [[LLB]] img3 to a spot right before the DATA tag was loaded from memory and decrypted. R5 was set to 0 to ensure decryption would not be skipped. The original value for the first DATA dword (before we had to overwrite it with the exploit LR) is written back to 0x22000020 by the payload, and the original SHA1 register value was written back to 0x2202FE24 to ensure the payload only activates once.&lt;br /&gt;
&lt;br /&gt;
==Deployment==&lt;br /&gt;
&lt;br /&gt;
Although the exploitive [[LLB]] can be manually written to [[NOR]] by bootstrapping from a tethered jailbreak, the easiest way is to use the Apple restore process itself. Apple's Restore process will write arbitrary img3s onto the [[NOR]], even if they fail signature checks. However, the &amp;quot;total size&amp;quot; value of the img3 is fixed up by the kernel before it is written to [[NOR]]. This would negate the exploit. However, '''MuscleNerd''' discovered that this could be bypassed by including the padding in another tag, such as CERT. Then, the written exploit [[LLB]] would have the &amp;quot;correct&amp;quot;, exploitive total size.&lt;br /&gt;
&lt;br /&gt;
==Timing Impact==&lt;br /&gt;
This exploit would have allowed the [[pwnage]] of the next generation iPhone without the discovery of an additional code execution vulnerability (required to write the exploit [[LLB]]), provided that the bug still existed in the next generation's bootrom. Even though it was too late to patch the bootrom, it was not too late for Apple to repair the restore process in the stock IPSW, removing the method used to get the exploitive [[LLB]] onto the device. Before, Apple would have no reason to fix this, since writing arbitrary data to [[NOR]] does not negate their chain of trust. However, now that a way has been found, they were able to prioritize a fix for this oversight thus making the permanent [[pwnage]] of future devices significantly more difficult.&lt;br /&gt;
&lt;br /&gt;
Thanks to irresponsible handling of the exploit by a third-party company known as [[NitroKey]] who were interested in making financial gain from the work of others, this eventuality became a near-certainty and pretty much erased the possibility of a day-of-release jailbreak for the [[iPhone 3GS]] and the third-generation iPod touch. In addition, to counteract the exploit, with the early exposure of the exploit, Apple were able to add the [[ECID]] tag to the [[IMG3 File Format|IMG3 format]] in the iPhone 3GS. The early leak of the exploit allowed Apple to understand that an iBoot exploit would be necessary to flash the required oversized LLB and through doing so, Apple have prevented this exploit from allowing the iPhone 3GS to be permanently jailbroken through this exploit unless new iBoot hacks can be found in every firmware release.  &lt;br /&gt;
&lt;br /&gt;
May the bastards of NitroKey burn in hell for all eternity.&lt;br /&gt;
&lt;br /&gt;
==3GS Implementation==&lt;br /&gt;
&lt;br /&gt;
The exploit remains the same in spirit.&lt;br /&gt;
&lt;br /&gt;
The call tree and stacks analysis is very similar although a few bytes here and there changed it slightly. It was again done manually but afterward, and out of fun, an IDA Python Script was written to automate the process. The new static analysis can be seen here [http://pastie.org/551212], and the IDA Python Script for it there [http://github.com/iZsh/IDA-Python-Scripts/].&lt;br /&gt;
&lt;br /&gt;
The main differences are:&lt;br /&gt;
&lt;br /&gt;
* the SRAM is at 0x84000000 instead of 0x22000000&lt;br /&gt;
* the Original value of the first DATA dword is written back to 0x84000040 (which was overwritten by the LR address)&lt;br /&gt;
* the SHA1 register original value is written back to 0x840241CC&lt;br /&gt;
* '''The decrypt flag is not held in R5 anymore''', but in a local variable of the function &amp;quot;my_process_module&amp;quot; (sub_2564). An extra static analysis tells us this variable is held at 0x84033F30, thus that's where you have to store your 0x0 value before returning to this function.&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=0x24000_Segment_Overflow&amp;diff=5128</id>
		<title>0x24000 Segment Overflow</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=0x24000_Segment_Overflow&amp;diff=5128"/>
		<updated>2009-10-13T20:37:52Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Also known by its codename, 24kPwn, this was the first exploit in the [[S5L8720]] that allowed us to bypass the bootrom signature checks on [[LLB]] and create what is known as an [[untethered jailbreak]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
A &amp;quot;hybrid&amp;quot; dev team, in alphabetical order: '''chronic''', '''CPICH''', '''ius''', '''MuscleNerd''', '''planetbeing''', '''pod2g''', '''posixninja''', et al. (anyone wishing to be unnamed)&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
&lt;br /&gt;
Upon boot-up, the [[S5L8720]] and [[S5L8920]] SoC have a MIU configuration which maps the [[VROM (S5L8720)|Secure ROM]] to 0x0, providing the newly turned on device with an ARM exception vector and the first code to execute. This MIU configuration also maps a small amount of SRAM to 0x22000000 for the [[S5L8720]], and 0x84000000 for the [[S5L8920]]. Statically allocated variables, heap, and stack must use the SRAM, as &amp;quot;[[VROM (S5L8720)|Secure ROM]]&amp;quot; is unwritable. A region of memory starting from (SRAM Start)+24000 is used for this purpose. The region of memory from the start of SRAM to (SRAM Start)+0x24000 is used as a buffer for loading the [[LLB|next stage bootloader]] code. The [[LLB]] code is stored in [[NOR]], along with code for all other bootloader stages, as well as art resources (boot logos) and the [[DeviceTree|OpenFirmware device tree]] to provide to the XNU [[kernel]]. The first portion (first 0x160 bytes) of memory at (SRAM Start)+0x24000 is used for initialized statically allocated variables. Shortly after boot, values for that region are initialized from [[VROM (S5L8720)|Secure ROM]].&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
The code that reads the [[LLB]] img3 from [[NOR]] into memory does not check the size of the [[LLB]] image being loaded, instead taking the size directly from the non-signature checked portion of its img3 header on the [[NOR]] (see ROM offset 0x2178). Any image greater than 0x24000 bytes in length will begin overwriting the portion of memory used to store Secure ROM statically allocated variables. Immediately vulnerable data includes USB data structures for [[DFU]] mode, a pointer to the bdev list structure, task list structures for the Secure ROM's scheduler, as well as the addresses of the hardware SHA1 registers. All of the above are potential avenues for exploitation.  The method described below uses the SHA1 register addresses.&lt;br /&gt;
&lt;br /&gt;
This vulnerability was discovered independently by '''pod2g''' and '''MuscleNerd'''.&lt;br /&gt;
&lt;br /&gt;
== Exploit==&lt;br /&gt;
&lt;br /&gt;
The goal of the exploit is to gain arbitrary code execution capability.&lt;br /&gt;
&lt;br /&gt;
The exploit, as proposed by '''planetbeing''', uses the overflow to overwrite one of the addresses of the SHA1 registers. The particular register is the only one that directly copies data to be hashed into the hardware (or into an arbitrary memory location, once the destination address has been overwritten). Code execution is achieved by writing data into the stack, specifically by overwriting the LR of the function performing the write to the &amp;quot;SHA1 register&amp;quot; so that instead of returning to the main SHA1 routine, it returns to a chosen location in memory that contains the payload code. The location chosen is within the range of memory that is filled with the [[LLB]] img3, so that the payload code can be placed within the [[LLB]] img3.&lt;br /&gt;
&lt;br /&gt;
The challenge is determining what to put in as the SHA1 register location so that the right portion of stack can be overwritten with the payload LR. This can be challenging without having access to any sort of exception dump (crash register dumps in the bootrom had been disabled by Apple). '''planetbeing''' performed a static analysis of a very detailed IDB produced by '''chronic''' and '''CPICH''' and determined the theoretical call stack for both of the invocations of the SHA1 hardware within the bootrom code [http://pastie.org/414981].&lt;br /&gt;
&lt;br /&gt;
In-situ verification of the LR location was performed by '''posixninja'''. '''CPICH''' discovered a way to alter the img3 DER so that the second invocation of the SHA1 hardware was not performed without affecting the first, allowing better confirmation that this step was performed properly.&lt;br /&gt;
&lt;br /&gt;
The final SHA1 register address was chosen so that the first dword of the DATA tag of the [[LLB]] img3 would replace sub_5E54's LR. This is because this is the first dword of the img3 that can be altered without substantially changing the img3's structure (and possibly disrupting earlier parsing code). The LR replacement must be done the first time the exploit is triggered (by the invocation of sub_5E54), or else the bootrom would crash. Since sub_5E54 takes 0x40 bytes of data at a time, the replacement LR thus must be within the first 0x40 bytes of data to be hashed. Data to be hashed starts at 0xC bytes from the start of the img3, and the first dword of the DATA tag is 0x20 bytes from the start of the img3. Thus, the SHA1 register address chosen should be 0x20 - 0xC = 0x14 bytes before sub_5E54's LR. So, it must be 0x2202FE24. Note that the exploit will also trash up to 0x2202FE24 + 0x40 = 0x2202FE64. So a sizeable portion of doComputeSHA1's stack will be trashed as well.&lt;br /&gt;
&lt;br /&gt;
The final exploit img3 was verified by '''posixninja''' under '''planetbeing''''s instructions to allow arbitrary code execution. It was a regular Img3 with padding up to 0x24000 bytes. The next 0x100 bytes were taken from the original initialization values for 0x22024000. However, 0x240FC, the offset of the SHA1 register address, was altered to 0x2202FE24. The first dword of the DATA tag (offset 0x20) was altered to 0x22023000. Payload code was placed at offset 0x23000.&lt;br /&gt;
&lt;br /&gt;
==Payload==&lt;br /&gt;
&lt;br /&gt;
The goal of the payload is to allow an unsigned [[LLB]] to be loaded.&lt;br /&gt;
&lt;br /&gt;
There are several ways that can be used, including directly calling the JumpToMemory function which is designed to prepare the SoC and invoke the [[LLB]] code. However, it's designed to be used on decrypted, unpacked code, and the [[LLB]] code currently resides in an encrypted from within the img3's DATA tag. The simplest solution is thus to use the bootrom's own machinery to decrypt and execute the code.&lt;br /&gt;
&lt;br /&gt;
The final payload evolved out of a discussion between '''pod2g''' and '''planetbeing''', based on an IDB documented by '''pod2g''', '''chronic''', '''CPICH''', et al. The lowest impact solution is to apply the pwnage patch to the rsaCheck subroutine of the bootrom, and returning from the payload from computing the SHA1 without crashing the bootrom. However, in this case, since bootrom text is unwritable, this was not a viable solution.&lt;br /&gt;
&lt;br /&gt;
The next lowest impact solution is to return from the entire parseFirmwareFooter function with a successful value, instead of the failure value it would normally return if signature checks fail. This would skip any remaining code  in that subroutine. This solution did not work in-situ. Failures checking the epoch tags prevented the firmware from being executed. The cause of this was not investigated.&lt;br /&gt;
&lt;br /&gt;
The final payload was to return past the verification of epoch and other tags in the [[LLB]] img3 to a spot right before the DATA tag was loaded from memory and decrypted. R5 was set to 0 to ensure decryption would not be skipped. The original value for the first DATA dword (before we had to overwrite it with the exploit LR) is written back to 0x22000020 by the payload, and the original SHA1 register value was written back to 0x2202FE24 to ensure the payload only activates once.&lt;br /&gt;
&lt;br /&gt;
==Deployment==&lt;br /&gt;
&lt;br /&gt;
Although the exploitive [[LLB]] can be manually written to [[NOR]] by bootstrapping from a tethered jailbreak, the easiest way is to use the Apple restore process itself. Apple's Restore process will write arbitrary img3s onto the [[NOR]], even if they fail signature checks. However, the &amp;quot;total size&amp;quot; value of the img3 is fixed up by the kernel before it is written to [[NOR]]. This would negate the exploit. However, '''MuscleNerd''' discovered that this could be bypassed by including the padding in another tag, such as CERT. Then, the written exploit [[LLB]] would have the &amp;quot;correct&amp;quot;, exploitive total size.&lt;br /&gt;
&lt;br /&gt;
==Timing Impact==&lt;br /&gt;
This exploit would have allowed the [[pwnage]] of the next generation iPhone without the discovery of an additional code execution vulnerability (required to write the exploit [[LLB]]), provided that the bug still existed in the next generation's bootrom. Even though it was too late to patch the bootrom, it was not too late for Apple to repair the restore process in the stock IPSW, removing the method used to get the exploitive [[LLB]] onto the device. Before, Apple would have no reason to fix this, since writing arbitrary data to [[NOR]] does not negate their chain of trust. However, now that a way has been found, they were able to prioritize a fix for this oversight thus making the permanent [[pwnage]] of future devices significantly more difficult.&lt;br /&gt;
&lt;br /&gt;
Thanks to irresponsible handling of the exploit by a third-party company known as [[NitroKey]] who were interested in making financial gain from the work of others, this eventuality became a near-certainty and pretty much erased the possibility of a day-of-release jailbreak for the [[iPhone 3GS]] and the third-generation iPod touch. In addition, to counteract the exploit, with the early exposure of the exploit, Apple were able to add the [[ECID]] tag to the [[IMG3 File Format|IMG3 format]] in the iPhone 3GS. The early leak of the exploit allowed Apple to understand that an iBoot exploit would be necessary to flash the required oversized LLB and through doing so, Apple have prevented this exploit from allowing the iPhone 3GS to be permanently jailbroken through this exploit unless new iBoot hacks can be found in every firmware release.  &lt;br /&gt;
&lt;br /&gt;
May the bastards of NitroKey burn in hell for all eternity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As of October 2009, seven months after the exposure of this hole, Apple are now selling 'updated' iPhone 3GS units with a new bootrom, erasing the vulnerability used by this exploit.&lt;br /&gt;
&lt;br /&gt;
==3GS Implementation==&lt;br /&gt;
&lt;br /&gt;
The exploit remains the same in spirit.&lt;br /&gt;
&lt;br /&gt;
The call tree and stacks analysis is very similar although a few bytes here and there changed it slightly. It was again done manually but afterward, and out of fun, an IDA Python Script was written to automate the process. The new static analysis can be seen here [http://pastie.org/551212], and the IDA Python Script for it there [http://github.com/iZsh/IDA-Python-Scripts/].&lt;br /&gt;
&lt;br /&gt;
The main differences are:&lt;br /&gt;
&lt;br /&gt;
* the SRAM is at 0x84000000 instead of 0x22000000&lt;br /&gt;
* the Original value of the first DATA dword is written back to 0x84000040 (which was overwritten by the LR address)&lt;br /&gt;
* the SHA1 register original value is written back to 0x840241CC&lt;br /&gt;
* '''The decrypt flag is not held in R5 anymore''', but in a local variable of the function &amp;quot;my_process_module&amp;quot; (sub_2564). An extra static analysis tells us this variable is held at 0x84033F30, thus that's where you have to store your 0x0 value before returning to this function.&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Blackra1n&amp;diff=5089</id>
		<title>Blackra1n</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Blackra1n&amp;diff=5089"/>
		<updated>2009-10-12T13:57:44Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Credit ==&lt;br /&gt;
* '''Vulnerability, Exploit''': [[geohot]]&lt;br /&gt;
&lt;br /&gt;
== Info ==&lt;br /&gt;
This is geohot's latest [[jailbreak]] utility. It is an updated version of [[purplera1n]] but now uses geohot's implementation of the [[usb_control_msg(0x21, 2) Exploit]].&lt;br /&gt;
It has been released for Windows and undoubtedly a Mac version is to follow. It will jailbreak all devices on 3.1, 3.1.1 and 3.1.2.&lt;br /&gt;
It will even jailbreak OTB [[N88ap|iPhone 3GS]] and [[N18AP|iPod touch 3G]].&lt;br /&gt;
&lt;br /&gt;
blackra1n does '''not''' support hacktivation, so it will your iPhone will need to be officially activated.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
[http://www.blackra1n.com/ Official blackra1n website]&lt;br /&gt;
[http://iphonejtag.blogspot.com/ Geohot's blog]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
[[greenpois0n]]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Usb_control_msg(0x21,_2)_Exploit&amp;diff=4949</id>
		<title>Usb control msg(0x21, 2) Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Usb_control_msg(0x21,_2)_Exploit&amp;diff=4949"/>
		<updated>2009-10-06T12:35:24Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:usb_control_msg(0x21, 2) Exploit}}&lt;br /&gt;
== Credit (Alphabetical) ==&lt;br /&gt;
* '''vulnerability''': pod2g and westbaer&lt;br /&gt;
* '''exploitation''': ius, chronic, pod2g, and posixninja&lt;br /&gt;
* '''payload ([[greenpois0n]])''': chronic and posixninja&lt;br /&gt;
&lt;br /&gt;
== Vulnerability ==&lt;br /&gt;
'''pod2g''' and '''westbaer''' discovered, via some reversing + fuzzing, you could overwrite the content of 0x0 thanks to Apple not checking the contents of a register they should have, shown in the disassm below. Now, the reason that this is useful is because the MMU maps whatever is running ([[LLB]], [[iBoot]], etc.) to 0x0 so that if an exception vector is triggered, it would jump to the one designed to be used with what is running, versus jumping to what is normally located at 0x0, the [[S5L8920 (Bootrom)|bootrom]].&lt;br /&gt;
&lt;br /&gt;
All you need to do is send the following (assuming you're using libusb 0.1.x)...&lt;br /&gt;
 usb_control_msg(iDev, 0x21, 2, 0, 0, 0, 0, 1000);&lt;br /&gt;
And thanks to our vulnerability, it will do this:&lt;br /&gt;
 memcpy(0, LOAD_ADDR, 0x2000);&lt;br /&gt;
&lt;br /&gt;
As you can see, we have full control over the first 0x2000 bytes of iBoot.&lt;br /&gt;
&lt;br /&gt;
=== Disassm ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// R5: a pointer to a buffer is here if requesttype==0xA1.&lt;br /&gt;
//     however, if requesttype==0x21, R5 is undefined.&lt;br /&gt;
&lt;br /&gt;
SRAM:22009ED2                 code_1                                  ; CODE XREF: handle_file_io_control_req+62�j&lt;br /&gt;
SRAM:22009ED2 014 36 49                       LDR     R1, =usb_file_loadaddr&lt;br /&gt;
SRAM:22009ED4 014 36 4B                       LDR     R3, =usb_file_offset&lt;br /&gt;
SRAM:22009ED6 014 28 68                       LDR     R0, [R5]&lt;br /&gt;
SRAM:22009ED8 014 09 68                       LDR     R1, [R1]&lt;br /&gt;
SRAM:22009EDA 014 1B 68                       LDR     R3, [R3]&lt;br /&gt;
SRAM:22009EDC 014 22 1C                       ADDS    R2, R4, #0&lt;br /&gt;
SRAM:22009EDE 014 C9 18                       ADDS    R1, R1, R3&lt;br /&gt;
SRAM:22009EE0 014 07 F0 94 EF                 BLX     memcpy&lt;br /&gt;
SRAM:22009EE4 014 00 2E                       CMP     R6, #0&lt;br /&gt;
SRAM:22009EE6 014 53 D0                       BEQ     return&lt;br /&gt;
SRAM:22009EE8 014 01 23                       MOVS    R3, #1&lt;br /&gt;
SRAM:22009EEA 014 33 60                       STR     R3, [R6]&lt;br /&gt;
SRAM:22009EEC 014 50 E0                       B       return&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Exploitation ==&lt;br /&gt;
So, how do you actually run code with this? Well, '''chronic''' suggested that since the irq vector was in constant use, we try that, so we were able to simply replace the address of the irq vector handler in the 0x2000 [[iBoot]] chunk that we send with 0x41002000, and then just tack our payload to the end of that chunk. Of course, since we are hijacking the irq exception, you must disable interrupts first. Here is the basic procedure:&lt;br /&gt;
* Call enter_critical_task(); disabling interrupts, so that your code can reliably execute.&lt;br /&gt;
* Restore 0x38 with the original irq vector address&lt;br /&gt;
* '''DO WHAT YOU WANT AT THIS POINT, YOU MAY NOT USE INTERRUPTS'''.&lt;br /&gt;
* Call exit_critical_task(); re-enabling interrupts.&lt;br /&gt;
* Call the irq handler so that the interrupt request that you jijacked can execute.&lt;br /&gt;
&lt;br /&gt;
=== Roadblocks ===&lt;br /&gt;
* If what you send is not 0x2000 bytes, the remainder is filled in with zeroes, which is bad.&lt;br /&gt;
* Due to the above rule, you need the first 0x2000 of a decrypted iBoot by the time your payload is done running.&lt;br /&gt;
* You must disable interrupts to reliably execute your payload. Due to this, this will rule out the possibility of reading the 0x2000 iBoot chunk needed from NOR, since nor_read(); requires interrupts.&lt;br /&gt;
&lt;br /&gt;
The [[PwnageTool]] method requires an [[IPSW]] to be input in order to create a custom firmware anyway, so the 0x2000 chunk is not an issue. It can just be copied from the [[iBoot]] in the [[IPSW]].&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Main_Page&amp;diff=4709</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Main_Page&amp;diff=4709"/>
		<updated>2009-09-09T20:07:49Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Logo by iHassan --&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:Iptwiki.jpg‎]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;!-- Added a split column information box- computid --&amp;gt;&lt;br /&gt;
{{:Main Page/Welcome}}&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;background-color:orange; text-align:center; width:25%;&amp;quot;&amp;gt;&amp;lt;b&amp;gt;[[Jailbreak iPhone2,1|Find bootrom exploit allowing unsigned code exec via USB (S5L8920)]]&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;background-color:orange; text-align:center; width:25%;&amp;quot;&amp;gt;&amp;lt;b&amp;gt;[[Unlock 2.0|Break Chain of Trust (X-Gold 608)]]&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td colspan=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[Disclaimer]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==Software==&lt;br /&gt;
* [[/|Filesystem]]&lt;br /&gt;
* [[Firmware]]&lt;br /&gt;
* [[Keys]]&lt;br /&gt;
* [[Protocols]]&lt;br /&gt;
* [[System Log]]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
=== iPhone ===&lt;br /&gt;
* [[m68ap|iPhone (m68ap)]]&lt;br /&gt;
* [[n82ap|iPhone 3G (n82ap)]]&lt;br /&gt;
* [[N88AP|iPhone 3GS (n88ap)]]&lt;br /&gt;
&lt;br /&gt;
=== iPod touch ===&lt;br /&gt;
* [[n45ap|iPod touch (n45ap)]]&lt;br /&gt;
* [[n72ap|iPod touch 2nd Generation (n72ap)]]&lt;br /&gt;
* [[N18AP|iPod touch 3rd Generation (n18ap)]]&lt;br /&gt;
&lt;br /&gt;
==App Processor ([[Jailbreak]])==&lt;br /&gt;
The [[iPhone]], [[iPod touch]], and [[iPhone 3G]] makes use of the [[S5L8900]] platform as application processor. Current models, such as the [[iPod touch 2G]] and the [[N88AP|iPhone 3GS]], use newer processors. The [[S5L8720]] and [[S5L8920]] are used, respectively. Here is where the [[Jailbreak|jailbreak]] applies.&lt;br /&gt;
&lt;br /&gt;
==Baseband ([[Unlock]])==&lt;br /&gt;
The [[Baseband Device]] is where the [[unlock]] applies.&lt;br /&gt;
&lt;br /&gt;
==Application Development==&lt;br /&gt;
* [[Toolchain]] (Includes tutorials)&lt;br /&gt;
* [[Toolchain 2.0]] (Includes tutorials)&lt;br /&gt;
* [[Frameworks]]&lt;br /&gt;
* [[MobileDevice Library]]&lt;br /&gt;
* [[Apple Certification Process]]&lt;br /&gt;
* [[Bypassing iPhone Code Signatures]]&lt;br /&gt;
* [[Distribution Methods]]&lt;br /&gt;
&lt;br /&gt;
==Application Copy Protection==&lt;br /&gt;
* [[Copy Protection Overview]]&lt;br /&gt;
* [[Application Structure and Signatures]]&lt;br /&gt;
* [[Mach-O Loading Process]]&lt;br /&gt;
* [[Bugging Debuggers]]&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
* [[Jailbreak]]&lt;br /&gt;
* [[Activation]]&lt;br /&gt;
* [[Unlock]]&lt;br /&gt;
* [[Baseband Device|Baseband]]&lt;br /&gt;
* [[Baseband Bootloader|Bootloader]]&lt;br /&gt;
* [[DFU]]&lt;br /&gt;
* [[iBoot]]&lt;br /&gt;
* [[iBEC]]&lt;br /&gt;
* [[iBSS]]&lt;br /&gt;
* [[NORID]]&lt;br /&gt;
* [[CHIPID]]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
* [[Bluetooth]]&lt;br /&gt;
* [[Glossary]]&lt;br /&gt;
* [[Tutorials]]&lt;br /&gt;
* [[Useful Links]]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Purplera1n&amp;diff=4199</id>
		<title>Purplera1n</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Purplera1n&amp;diff=4199"/>
		<updated>2009-07-13T20:39:02Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Credit ==&lt;br /&gt;
[[geohot]]&lt;br /&gt;
&lt;br /&gt;
Mac OS X client: AriX, and westbaer.&lt;br /&gt;
&lt;br /&gt;
== Phase 1: Signature Grabber ==&lt;br /&gt;
* '''Blog Post''': http://iphonejtag.blogspot.com/2009/06/usbdump-huh-how.html&lt;br /&gt;
&lt;br /&gt;
Allows anyone with a [[N88AP|3GS]] right now to generate a file that contains:&lt;br /&gt;
* The [[ECID|Exclusive Chip ID tag]] for your device&lt;br /&gt;
* The new RSA signature for a 3.0GM [[N88AP|iPhone 3GS]] iBSS that includes your ECID&lt;br /&gt;
&lt;br /&gt;
This way, if Apple tries to pull a fast one and disallow downgrades to earlier versions, you have a backup that can be used to still allow you to boot an older iBSS.&lt;br /&gt;
&lt;br /&gt;
Apple can not stop you from obtaining the ECID from your phone. But the webapp behind purplera1n calls the same Apple servers which are also used by iTunes for signing your personal iBSS ECID combination. So this will stop working, when&lt;br /&gt;
* a new firmware gets released and Apple does not allow downgrading any more or&lt;br /&gt;
* Apple finds a way to distinguish between requests from iTunes and purplera1n&lt;br /&gt;
&lt;br /&gt;
As purplera1n uses a distributed application hosting it is not easy for Apple to filter it using IP addresses.&lt;br /&gt;
&lt;br /&gt;
== Phase 2: Jailbreak Tool (3.0) ==&lt;br /&gt;
* '''Web Site''': http://purplera1n.com&lt;br /&gt;
&lt;br /&gt;
One-Click, dead simple, jailbreak for the [[iPhone 3GS]]. Currently available for Windows, Mac, and Linux. It utilizes the [[iBoot Environment Variable Overflow]].&lt;br /&gt;
&lt;br /&gt;
== How purplera1n Works ==&lt;br /&gt;
&lt;br /&gt;
purplera1n is so simple, that it hides the complex work it's doing from the user. Figured I'd describe it step by step&lt;br /&gt;
* purplera1n sends the enter recovery commands using iTunesMobileDevice&lt;br /&gt;
* once in recovery(iBoot), it sends the [[IBoot Environment Variable Overflow]] exploit&lt;br /&gt;
* the exploit adds a &amp;quot;geohot&amp;quot; command to the phone which runs the payload&lt;br /&gt;
* the &amp;quot;geohot&amp;quot; command is run, control is now transferred from iboot to the payload&lt;br /&gt;
* the purplera1n client is done&lt;br /&gt;
Inside payload&lt;br /&gt;
* the payload restores the default environment variable ring buffer and saves the environment to nvram(sets auto-boot to true)&lt;br /&gt;
* it patches iBoot to load unsigned img3s and not care about the tags&lt;br /&gt;
* it loads the purplera1n picture(sent with payload)&lt;br /&gt;
* the nor patcher starts&lt;br /&gt;
* llb is decrypted, patched, and increased in size to 0x24200. this is the resident [[0x24000 Segment Overflow]] exploit&lt;br /&gt;
* a little loader code is put @ 0x20000 in the LLB to load it and fix the stack&lt;br /&gt;
* iboot is decrypted, patched&lt;br /&gt;
* everything else is read as is&lt;br /&gt;
* nor is written back, nor patcher is done&lt;br /&gt;
* kernel is loaded, decrypted, and patched&lt;br /&gt;
* ramdisk is loaded(sent with payload) and moved to ramdisk region at 0x44000000, patched kernel is tacked on to the end&lt;br /&gt;
* patched kernel is booted&lt;br /&gt;
* control is now transferred from payload to ramdisk&lt;br /&gt;
Inside ramdisk&lt;br /&gt;
* launchd is run, all stuff happens here&lt;br /&gt;
* /dev/disk0s1 is mounted&lt;br /&gt;
* fstab and services are overwritten here to allow disk0s1 writes and afc2 respectively&lt;br /&gt;
* Freeze.app is transferred and Freeze.app loader has SUID bit set&lt;br /&gt;
* patched kernel is read from end of ramdisk block device and written to filesystem&lt;br /&gt;
* ramdisk is done, rebooting...&lt;br /&gt;
Reboots as jailbroken phone&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Decrypting_Firmwares&amp;diff=4100</id>
		<title>Decrypting Firmwares</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Decrypting_Firmwares&amp;diff=4100"/>
		<updated>2009-07-05T23:14:51Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==1.0.x==&lt;br /&gt;
If you want to decrypt 1.0.x iPhone ramdisk you must remove some trash from the beginning of them. You can do this in Terminal.app (on Mac OS X you can find them in /Applications/Utilities/).&lt;br /&gt;
&lt;br /&gt;
Unzip firmware image (change extension .ipsw to .zip and double click on archive) and find restore ramdisk. In Terminal.app enter simple command:&lt;br /&gt;
&lt;br /&gt;
''dd if=restore_ramdisk.dmg of=restore_ramdisk.stripped.dmg bs=512 skip=4 count=37464 conv=sync''&lt;br /&gt;
&lt;br /&gt;
Where '''restore_ramdisk.dmg''' is image of restore ramdisk (for example 1.0 iPhone firmware restore ramdisk is 694-5259-38.dmg), and '''restore_ramdisk.stripped.dmg''' is 'decrypted' image, that you can mount and explore from Finder.&lt;br /&gt;
&lt;br /&gt;
Note: If after mounting stripped ramdisk you see errors, ignore them.&lt;br /&gt;
&lt;br /&gt;
==1.1.x==&lt;br /&gt;
To decrypt the 1.1.x ramdisk, strip the first 0x800 bytes. I'm not proficient in dd, but the above command could be modified for this, or it could be done in a hex editor. Once that's complete, run this command:&lt;br /&gt;
&lt;br /&gt;
''openssl enc -d -in ramdisk.dmg -out de.dmg -aes-128-cbc -K 188458A6D15034DFE386F23B61D43774 -iv 0''&lt;br /&gt;
&lt;br /&gt;
This uses the iPhone's 0x837 key which was first leaked by Zibri and had its purpose revealed on Geohot's blog.&lt;br /&gt;
&lt;br /&gt;
==2.x+==&lt;br /&gt;
The ramdisk on both 2.x and 3.x firmwares is a simple [[IMG3_File_Format|img3 file]], that you can decrypt using [http://code.google.com/p/img3decrypt/ img3decrypt] or [http://github.com/planetbeing/xpwn/tree/master xpwntool]. You must download one of these utilities. For easier access, put them in '''/usr/local/bin'''&lt;br /&gt;
&lt;br /&gt;
If you're using img3decrypt use this:&lt;br /&gt;
''img3decrypt e restore_ramdisk.dmg restore_ramdisk_decrypted.dmg Ramdisk_IV Ramdisk_Key'' &lt;br /&gt;
&lt;br /&gt;
Use this if you're using xpwntool:&lt;br /&gt;
''xpwntool restore_ramdisk.dmg restore_ramdisk_decrypted.dmg -k Ramdisk_Key -iv Ramdisk_IV''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where '''restore_ramdisk.dmg''' is image of restore ramdisk (for example 3.0 beta 1 iPhone GSM firmware restore ramdisk is 018-4793-1.dmg), and '''restore_ramdisk_decrypted.dmg''' is decrypted image, that you can mount and explore from Finder. Ramdisk_IV and Ramdisk_Key is a decrypted keys that you can find in [[VFDecrypt_Keys:_3.x|vfdecrypt page]] or in Info.plist from PwnageTool FirmwareBundles folder (when Dev Team include support for this firmware).&lt;br /&gt;
&lt;br /&gt;
Because of the new HFS Compression used in Snow Leopard and 3.0 DMGs, you may see zero-sized files in the DMG if you don't use Snow Leopard. In order to extract those, check [[Talk:Ramdisk Decryption]].&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Ultrasn0w&amp;diff=4091</id>
		<title>Ultrasn0w</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Ultrasn0w&amp;diff=4091"/>
		<updated>2009-07-05T12:18:33Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ultrasn0w (previously: '''yellowsn0w''') is the only [[iPhone 3G]] [[Unlock 2.0|unlock]] payload. yellowsn0w was released on 01/01/09 [http://blog.iphone-dev.org/post/67797811/dont-eat-yellowsn0w]. ultrasn0w was released on June 23th 2009 [http://blog.iphone-dev.org/post/128573459/ultras-now].&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
MuscleNerd, and [[The dev team]]&lt;br /&gt;
&lt;br /&gt;
==Exploit==&lt;br /&gt;
Relies on an unsigned code injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
The actual unlock works by a daemon patching the baseband's RAM on-the-fly, overriding the carrier lock code. It is not permanent because of the signature checks - the bootloader has to pass the sigchecks and the baseband has to pass them too, so any change to the baseband/bootloader cannot be made.&lt;br /&gt;
&lt;br /&gt;
==Current Injection Vector==&lt;br /&gt;
ultrasn0w refers to the reuseable '''payload''', but it requires an injection vector in order to be inserted into the baseband. yellowsn0w was originally to be released with an injection vector that works on pre-2.28.00 baseband versions. However, [[geohot]] had an injection vector for 2.28.00 and the decision was made to release yellowsn0w with this injection vector to benefit the most people. This injection vector is discussed [[AT+stkprof Exploit|here]]. ultrasn0w uses a different injection vector - [[AT+XLOG Exploit]].&lt;br /&gt;
&lt;br /&gt;
==ultrasn0w payload with comments (by Oranav)==&lt;br /&gt;
&lt;br /&gt;
===Code loader (incl. Stage2)===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ROM:00000000 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
ROM:00000000&lt;br /&gt;
ROM:00000000&lt;br /&gt;
ROM:00000000 code_loader&lt;br /&gt;
ROM:00000000 dest_addr = R1&lt;br /&gt;
ROM:00000000 src_addr = R6&lt;br /&gt;
ROM:00000000                 MOVLS   dest_addr, 0x110&lt;br /&gt;
ROM:00000004                 ADDS    dest_addr, #6&lt;br /&gt;
ROM:00000006                 LSLS    dest_addr, dest_addr, #8 ; unused ram to place code = 0x11600&lt;br /&gt;
ROM:00000008                 ADDS    R2, dest_addr, #1 ; thumbing&lt;br /&gt;
ROM:0000000A&lt;br /&gt;
ROM:0000000A loop                                    ; CODE XREF: code_loader+24�j&lt;br /&gt;
ROM:0000000A                 MOVLS   R0, 0x22 ; '&amp;quot;'&lt;br /&gt;
ROM:0000000E                 LDRB    R3, [src_addr]  ; first nibble&lt;br /&gt;
ROM:00000010                 CMP     R0, R3&lt;br /&gt;
ROM:00000012                 LDRB    R0, [src_addr,#1] ; second nibble&lt;br /&gt;
ROM:00000014                 BEQ     run             ; branch if end of string&lt;br /&gt;
ROM:00000016                 SUBS    R3, #0x41       ; subtract 'A'&lt;br /&gt;
ROM:00000018                 SUBS    R0, #0x41       ; subtract 'A'&lt;br /&gt;
ROM:0000001A                 LSLS    R3, R3, #4      ; make room for next nibble&lt;br /&gt;
ROM:0000001C                 ADDS    R3, R3, R0      ; put them together as a byte&lt;br /&gt;
ROM:0000001E                 STRB    R3, [dest_addr]&lt;br /&gt;
ROM:00000020                 ADDS    dest_addr, #1&lt;br /&gt;
ROM:00000022                 ADDS    src_addr, #2&lt;br /&gt;
ROM:00000024                 B       loop&lt;br /&gt;
ROM:00000026 ; ---------------------------------------------------------------------------&lt;br /&gt;
ROM:00000026&lt;br /&gt;
ROM:00000026 run                                     ; CODE XREF: code_loader+14�j&lt;br /&gt;
ROM:00000026                 BLX     R2              ; handler_replace()&lt;br /&gt;
ROM:00000028                 MOVLS   R0, 0           ; safe exit&lt;br /&gt;
ROM:0000002C                 ADDS    dest_addr, R0, #0&lt;br /&gt;
ROM:0000002E                 BLX     R4&lt;br /&gt;
ROM:00000030                 MOV     SP, R5&lt;br /&gt;
ROM:00000032                 POP     {R0-src_addr,PC}&lt;br /&gt;
ROM:00000032 ; End of function code_loader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Handler replace===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RAM:00011600 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00011600&lt;br /&gt;
RAM:00011600&lt;br /&gt;
RAM:00011600 handler_replace&lt;br /&gt;
RAM:00011600                 PUSH    {LR}&lt;br /&gt;
RAM:00011602                 LDR     R0, =0x40492FC0 ; (probably) where to save task_loop_jmp + task_loop&lt;br /&gt;
RAM:00011604                 ADR     R1, task_loop_jmp&lt;br /&gt;
RAM:00011606                 ADR     R2, task_loop_end&lt;br /&gt;
RAM:00011608                 SUBS    R2, R2, R1      ; size of task_loop + task_loop_jmp = 0x70&lt;br /&gt;
RAM:0001160A                 LDR     R3, =0x2040882C ; memcpy()&lt;br /&gt;
RAM:0001160C                 BLX     R3&lt;br /&gt;
RAM:0001160E                 LDR     R0, =0x40492C20 ; where to save task_creator_jmp + task_creator&lt;br /&gt;
RAM:00011610                 ADR     R1, task_creator_jmp&lt;br /&gt;
RAM:00011612                 ADR     R2, task_creator_end&lt;br /&gt;
RAM:00011614                 SUBS    R2, R2, R1      ; size of task_creator + task_creator_jmp = 0xA0&lt;br /&gt;
RAM:00011616                 LDR     R3, =0x2040882C ; memcpy()&lt;br /&gt;
RAM:00011618                 BLX     R3&lt;br /&gt;
RAM:0001161A                 LDR     R0, =0x40492C20&lt;br /&gt;
RAM:0001161C                 BLX     R0              ; task_creator_jmp()&lt;br /&gt;
RAM:0001161E                 POP     {PC}&lt;br /&gt;
RAM:0001161E ; End of function handler_replace&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task creator (thanks Darkmen for the comments!)===&lt;br /&gt;
I'm also missing here a comment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RAM:40492C20 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:40492C20&lt;br /&gt;
RAM:40492C20&lt;br /&gt;
RAM:40492C20 task_creator_jmp&lt;br /&gt;
RAM:40492C20                 STMFD   SP!, {R1-R12,LR}&lt;br /&gt;
RAM:40492C24                 BLX     task_creator&lt;br /&gt;
RAM:40492C28                 LDMFD   SP!, {R1-R12,PC}&lt;br /&gt;
RAM:40492C28 ; End of function task_creator_jmp&lt;br /&gt;
RAM:40492C28&lt;br /&gt;
RAM:40492C2C&lt;br /&gt;
RAM:40492C2C ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:40492C2C&lt;br /&gt;
RAM:40492C2C&lt;br /&gt;
RAM:40492C2C task_creator                            ; CODE XREF: task_creator_jmp+4�p&lt;br /&gt;
RAM:40492C2C                 PUSH    {R4-R7,LR}&lt;br /&gt;
RAM:40492C2E                 LDR     R3, =0x401ED3B8 ; jumptable var&lt;br /&gt;
RAM:40492C30                 MOVLS   R4, 0x800&lt;br /&gt;
RAM:40492C34                 SUB     SP, SP, #0x24&lt;br /&gt;
RAM:40492C36                 STRH    R0, [R3]        ; R0 = task_creator_jmp addr&lt;br /&gt;
RAM:40492C38                 LDR     R5, =0x201493F0 ; malloc&lt;br /&gt;
RAM:40492C3A                 ADDS    R0, R4, #0      ; 0x800&lt;br /&gt;
RAM:40492C3C                 ADDS    R7, R1, #0      ; R7 = resp_string&lt;br /&gt;
RAM:40492C3E                 BLX     R5              ; malloc(0x800)&lt;br /&gt;
RAM:40492C40                 ADDS    R6, R0, #0      ; R6 = addr returned from malloc&lt;br /&gt;
RAM:40492C42                 MOVS    R0, #0x98       ; sizeof(NU_TASK)&lt;br /&gt;
RAM:40492C44                 BLX     R5              ; malloc(sizeof(NU_TASK))&lt;br /&gt;
RAM:40492C46                 MOVS    R2, #0&lt;br /&gt;
RAM:40492C48                 MOVS    R3, #0x44&lt;br /&gt;
RAM:40492C4A                 LDR     R1, =aDevteam1  ; char *name&lt;br /&gt;
RAM:40492C4C                 STR     R2, [R0,#0xC]   ; task.field=0&lt;br /&gt;
RAM:40492C4E                 STR     R3, [SP,#0xC]   ; priority = 0x44&lt;br /&gt;
RAM:40492C50                 MOVS    R3, #0xA&lt;br /&gt;
RAM:40492C52                 STR     R3, [SP,#0x14]  ; preempt = NU_PREEMPT&lt;br /&gt;
RAM:40492C54                 MOVS    R3, #0xC&lt;br /&gt;
RAM:40492C56                 STR     R2, [SP]        ; void *argv = 0&lt;br /&gt;
RAM:40492C58                 STR     R4, [SP,#8]     ; stack_size = 0x800&lt;br /&gt;
RAM:40492C5A                 STR     R2, [SP,#0x10]  ; time_slice = 0&lt;br /&gt;
RAM:40492C5C                 STR     R3, [SP,#0x18]  ; auto_start = NU_START&lt;br /&gt;
RAM:40492C5E                 LDR     R2, =0x40492FC0 ; ???&lt;br /&gt;
RAM:40492C60                 STR     R6, [SP,#4]     ; void *stack_address = malloc(0x800)&lt;br /&gt;
RAM:40492C62                 MOVS    R3, #0&lt;br /&gt;
RAM:40492C64                 LDR     R4, =0x2043E5B4 ; NU_Create_Task&lt;br /&gt;
RAM:40492C66                 BLX     R4              ; status = NU_Create_Task()&lt;br /&gt;
RAM:40492C68                 ADDS    R2, R0, #0      ; R2 = status (for the %d reference in sprintf)&lt;br /&gt;
RAM:40492C6A                 CMP     R0, #0          ; success = zero&lt;br /&gt;
RAM:40492C6C                 BNE     status_error&lt;br /&gt;
RAM:40492C6E                 LDR     R1, =aOk        ; &amp;quot;OK!&amp;quot;&lt;br /&gt;
RAM:40492C70                 ADDS    R0, R7, #0      ; resp_string&lt;br /&gt;
RAM:40492C72                 LDR     R3, =0x204B11F0 ; sprintf&lt;br /&gt;
RAM:40492C74                 BLX     R3              ; sprintf(resp_string, &amp;quot;OK!&amp;quot;)&lt;br /&gt;
RAM:40492C76                 B       exit&lt;br /&gt;
RAM:40492C78 ; ---------------------------------------------------------------------------&lt;br /&gt;
RAM:40492C78&lt;br /&gt;
RAM:40492C78 status_error                            ; CODE XREF: task_creator+40�j&lt;br /&gt;
RAM:40492C78                 LDR     R1, =aErrorD    ; &amp;quot;ERROR %d&amp;quot;&lt;br /&gt;
RAM:40492C7A                 ADDS    R0, R7, #0      ; resp_string&lt;br /&gt;
RAM:40492C7C                 LDR     R3, =0x204B11F0 ; sprintf&lt;br /&gt;
RAM:40492C7E                 BLX     R3              ; sprintf(resp_string, &amp;quot;ERROR %d&amp;quot;, status)&lt;br /&gt;
RAM:40492C80&lt;br /&gt;
RAM:40492C80 exit                                    ; CODE XREF: task_creator+4A�j&lt;br /&gt;
RAM:40492C80                 ADD     SP, SP, #0x24   ; fixing stack&lt;br /&gt;
RAM:40492C82                 POP     {R4-R7,PC}&lt;br /&gt;
RAM:40492C82 ; End of function task_creator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unlock task loop (thanks Darkmen for the comments!)===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RAM:00011630 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00011630&lt;br /&gt;
RAM:00011630&lt;br /&gt;
RAM:00011630 task_loop_jmp&lt;br /&gt;
RAM:00011630                 STMFD   SP!, {R1-R12,LR}&lt;br /&gt;
RAM:00011634                 BLX     task_loop&lt;br /&gt;
RAM:00011634 ; ---------------------------------------------------------------------------&lt;br /&gt;
RAM:00011638                 LDMFD   SP!, {R1-R12,PC}&lt;br /&gt;
RAM:00011638 ; End of function task_loop_jmp&lt;br /&gt;
RAM:00011638&lt;br /&gt;
RAM:0001163C&lt;br /&gt;
RAM:0001163C ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:0001163C&lt;br /&gt;
RAM:0001163C&lt;br /&gt;
RAM:0001163C task_loop&lt;br /&gt;
RAM:0001163C                 PUSH    {R4,R5,LR}&lt;br /&gt;
RAM:0001163E                 LDR     R5, =0x401E829C ; sec mailbox&lt;br /&gt;
RAM:00011640                 SUB     SP, SP, #0x14&lt;br /&gt;
RAM:00011642&lt;br /&gt;
RAM:00011642 loop                                    ; CODE XREF: task_loop+44�j&lt;br /&gt;
RAM:00011642                 LDR     R3, =0x2042FFD8 ; NU_Receive_From_Mailbox&lt;br /&gt;
RAM:00011644                 ADDS    R0, R5, #0      ; NU_MAILBOX *mailbox&lt;br /&gt;
RAM:00011646                 MOV     R1, SP          ; void *Message&lt;br /&gt;
RAM:00011648                 MOVS    R2, #0xFF       ; Timeout&lt;br /&gt;
RAM:0001164A                 BLX     R3              ; NU_Receive_From_Mailbox(sec_mailbox,SP,0xFF)&lt;br /&gt;
RAM:0001164C                 LDR     R3, [SP]        ; Message[0]&lt;br /&gt;
RAM:0001164E                 CMP     R3, #0xD        ; Message[0] = 0xD ?&lt;br /&gt;
RAM:00011650                 BNE     skip&lt;br /&gt;
RAM:00011652                 LDR     R1, [SP,#4]     ; Message[1]&lt;br /&gt;
RAM:00011654                 LDR     R3, =0x40301650&lt;br /&gt;
RAM:00011656                 LDR     R2, [R1]        ; Message[1].field0&lt;br /&gt;
RAM:00011658                 STR     R2, [R3]        ; sec_task_var1 = Message[1].field0&lt;br /&gt;
RAM:0001165A                 ADDS    R3, #4          ; 0x40301654&lt;br /&gt;
RAM:0001165C                 LDR     R2, [R1,#4]     ; Message[1].field1&lt;br /&gt;
RAM:0001165E                 STR     R2, [R3]        ; sec_task_var2 = Message[1].field1&lt;br /&gt;
RAM:00011660                 LDR     R2, [R1,#8]     ; Message[1].field2&lt;br /&gt;
RAM:00011662                 LDR     R3, =0x100FF00&lt;br /&gt;
RAM:00011664                 STR     R3, [R2]        ; Message[1].field2[0] = 0x100FF00&lt;br /&gt;
RAM:00011666                 LDR     R3, =0x4020401&lt;br /&gt;
RAM:00011668                 STR     R3, [R2,#4]     ; Message[1].field2[1] = 0x4020401&lt;br /&gt;
RAM:0001166A                 LDR     R3, =0x4040403&lt;br /&gt;
RAM:0001166C                 STR     R3, [R2,#8]     ; Message[1].field2[2] = 0x4040403&lt;br /&gt;
RAM:0001166E                 MOVS    R3, #1&lt;br /&gt;
RAM:00011670                 STR     R3, [R1,#0xC]   ; Message[1].field3 = 1&lt;br /&gt;
RAM:00011672                 MOVS    R3, #0x20 ; ' '&lt;br /&gt;
RAM:00011674                 STR     R3, [SP] ; Message[0] = 0x20&lt;br /&gt;
RAM:00011676&lt;br /&gt;
RAM:00011676 skip                                    ; CODE XREF: task_loop+14�j&lt;br /&gt;
RAM:00011676                 ADDS    R0, R5, #0      ; sec mailbox&lt;br /&gt;
RAM:00011678                 MOV     R1, SP          ; void *Message&lt;br /&gt;
RAM:0001167A                 MOVS    R2, #0xFF       ; timeout&lt;br /&gt;
RAM:0001167C                 LDR     R3, =0x20430040&lt;br /&gt;
RAM:0001167E                 BLX     R3              ; NU_Send_To_Mailbox()&lt;br /&gt;
RAM:00011680                 B       loop&lt;br /&gt;
RAM:00011680 ; End of function task_loop&lt;br /&gt;
RAM:00011680&lt;br /&gt;
RAM:00011680 ; ---------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Old yellowsn0w payload w/ comments (by Darkmen) ===&lt;br /&gt;
&lt;br /&gt;
The exploit consists from 4 parts:&lt;br /&gt;
&lt;br /&gt;
===Code loader===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ROM:00000000 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
ROM:00000000&lt;br /&gt;
ROM:00000000&lt;br /&gt;
ROM:00000000 loader&lt;br /&gt;
ROM:00000000                 LDR     R2, =0x11700    ; unused ram to place code&lt;br /&gt;
ROM:00000002                 ADDS    R4, R2, #1      ; thumb switch&lt;br /&gt;
ROM:00000004                 LDR     R3, =0x40159FBF ; at-handler buffer where stage2 binary and following hexdata are&lt;br /&gt;
ROM:00000006&lt;br /&gt;
ROM:00000006 copy.loop                               ; CODE XREF: loader+12�j&lt;br /&gt;
ROM:00000006                 LDRB    R0, [R3]        ; copying code+data until double quotes&lt;br /&gt;
ROM:00000008                 CMP     R0, #0x22 ; '&amp;quot;'&lt;br /&gt;
ROM:0000000A                 BEQ     run             ; jump thumb code&lt;br /&gt;
ROM:0000000C                 STRB    R0, [R2]&lt;br /&gt;
ROM:0000000E                 ADDS    R2, #1&lt;br /&gt;
ROM:00000010                 ADDS    R3, #1&lt;br /&gt;
ROM:00000012                 B       copy.loop       ; &lt;br /&gt;
ROM:00000014 run                                     ; CODE XREF: loader+A�j&lt;br /&gt;
ROM:00000014                 BX      R4              ; jump stage2 code&lt;br /&gt;
ROM:00000014 ; End of function loader&lt;br /&gt;
ROM:00000014&lt;br /&gt;
ROM:00000014 ; ---------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stage2(tm)===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RAM:00000000 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00000000 stage2&lt;br /&gt;
RAM:00000000                 ADDS    R2, #0x10       ; R2 = 0x11700 + stage2 size&lt;br /&gt;
RAM:00000002                 MOVS    R7, #0xF&lt;br /&gt;
RAM:00000004                 BICS    R2, R7          ; align offset by 0x10&lt;br /&gt;
RAM:00000006                 ADDS    R7, R2, #0      ; saving address to jump&lt;br /&gt;
RAM:00000008                 ADR     R4, 0x44        ; skipping Stage2 size and taking first char from at-string&lt;br /&gt;
RAM:0000000A                 ADR     R5, char2byte   ; loading routine addr&lt;br /&gt;
RAM:0000000C                 ADDS    R5, #1          ; thumb&lt;br /&gt;
RAM:0000000E&lt;br /&gt;
RAM:0000000E loop                                    ; CODE XREF: stage2+2C�j&lt;br /&gt;
RAM:0000000E                 LDRB    R1, [R4]        ; at-string[index]&lt;br /&gt;
RAM:00000010                 CMP     R1, #'x'        ; end of line?&lt;br /&gt;
RAM:00000012                 BEQ     jump_code&lt;br /&gt;
RAM:00000014                 BLX     R5              ; char2byte first hakfbyte&lt;br /&gt;
RAM:00000016                 LSLS    R3, R1, #4      ; &amp;lt;&amp;lt;4 0X becoming X0&lt;br /&gt;
RAM:00000018                 LDRB    R1, [R4,#1]     ; at-string[index+1]&lt;br /&gt;
RAM:0000001A                 BLX     R5              ; char2hex second halfbyte&lt;br /&gt;
RAM:0000001C                 NOP&lt;br /&gt;
RAM:0000001E                 NOP&lt;br /&gt;
RAM:00000020                 NOP&lt;br /&gt;
RAM:00000022                 NOP&lt;br /&gt;
RAM:00000024                 ADDS    R1, R1, R3      ; R1 = complete byte&lt;br /&gt;
RAM:00000026                 STRB    R1, [R2]        ; storing byte to dst&lt;br /&gt;
RAM:00000028                 ADDS    R4, #2          ; hexstr_index+=2&lt;br /&gt;
RAM:0000002A                 ADDS    R2, #1          ; dst++&lt;br /&gt;
RAM:0000002C                 B       loop            ; at-string[index]&lt;br /&gt;
RAM:0000002E jump_code&lt;br /&gt;
RAM:0000002E                 NOP&lt;br /&gt;
RAM:00000030                 NOP&lt;br /&gt;
RAM:00000032                 ADDS    R7, #1          ; thumbing&lt;br /&gt;
RAM:00000034                 BX      R7              ; run Task creator code&lt;br /&gt;
RAM:00000034 ; End of function stage2&lt;br /&gt;
RAM:00000038&lt;br /&gt;
RAM:00000038 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00000038 char2byte                               ; DATA XREF: stage2+A�o&lt;br /&gt;
RAM:00000038                 CMP     R1, #0x41 ; 'A'&lt;br /&gt;
RAM:0000003A                 BGE     letter          ; letter to number&lt;br /&gt;
RAM:0000003C                 SUBS    R1, #0x30 ; '0' ; digit to number&lt;br /&gt;
RAM:0000003E                 BX      LR&lt;br /&gt;
RAM:00000040 letter                                  ; CODE XREF: char2byte+2�j&lt;br /&gt;
RAM:00000040                 SUBS    R1, #0x37 ; '7' ; letter to number&lt;br /&gt;
RAM:00000042                 BX      LR              ; ret&lt;br /&gt;
RAM:00000042 ; End of function char2byte&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task creator===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RAM:000119A0 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:000119A0&lt;br /&gt;
RAM:000119A0&lt;br /&gt;
RAM:000119A0 handler_replace&lt;br /&gt;
RAM:000119A0                 LDR     R0, =0x4011714C ; soft reset handler addr&lt;br /&gt;
RAM:000119A2                 ADR     R1, new_handler&lt;br /&gt;
RAM:000119A4                 ADDS    R1, #1          ; thumbing&lt;br /&gt;
RAM:000119A6                 STR     R1, [R0]        ; setting new handler&lt;br /&gt;
RAM:000119A8                 POP     {R0-R4,PC}      ; safe exit fixing stack&lt;br /&gt;
RAM:000119A8 ; End of function handler_replace&lt;br /&gt;
&lt;br /&gt;
RAM:000119B0 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:000119B0&lt;br /&gt;
RAM:000119B0&lt;br /&gt;
RAM:000119B0 new_handler                             ; DATA XREF: handler_replace+2�o&lt;br /&gt;
RAM:000119B0                 PUSH    {R4-R7,LR}&lt;br /&gt;
RAM:000119B2                 LDR     R3, =0x403BB344 ; jamptable var&lt;br /&gt;
RAM:000119B4                 MOVS    R6, #0x80&lt;br /&gt;
RAM:000119B6                 SUB     SP, SP, #0x2C&lt;br /&gt;
RAM:000119B8                 LSLS    R6, R6, #4      ; 0x200&lt;br /&gt;
RAM:000119BA                 STRH    R0, [R3]        ; saving R0 to mem var&lt;br /&gt;
RAM:000119BC                 STR     R1, [SP,#0x40+resp_string] ; saving responce prt to stack&lt;br /&gt;
RAM:000119BE                 LDR     R4, =0x201420AC ; malloc&lt;br /&gt;
RAM:000119C0                 ADDS    R0, R6, #0&lt;br /&gt;
RAM:000119C2                 BLX     R4              ; malloc(0x200)&lt;br /&gt;
RAM:000119C4                 MOVS    R5, #0&lt;br /&gt;
RAM:000119C6                 STR     R0, [SP,#0x40+ptr_200] ; saving pointer to stack&lt;br /&gt;
RAM:000119C8                 MOVS    R0, #0x98       ; sizeof(NU_TASK)&lt;br /&gt;
RAM:000119CA                 BLX     R4              ; malloc(0x98)&lt;br /&gt;
RAM:000119CC                 ADDS    R7, R0, #0      ; R7 = task&lt;br /&gt;
RAM:000119CE                 STR     R5, [R0,#0xC]   ; task.field=0&lt;br /&gt;
RAM:000119D0                 MOVS    R0, 0x100&lt;br /&gt;
RAM:000119D4                 BLX     R4              ; malloc(0x100)&lt;br /&gt;
RAM:000119D6                 MOVS    R2, #0x80&lt;br /&gt;
RAM:000119D8                 LDR     R1, =task_loop  ; src&lt;br /&gt;
RAM:000119DA                 LSLS    R2, R2, #1      ; size to copy&lt;br /&gt;
RAM:000119DC                 LDR     R3, =0x203C58A0 ; bytecpy&lt;br /&gt;
RAM:000119DE                 ADDS    R4, R0, #0      ; R4 = dyn_task_loop&lt;br /&gt;
RAM:000119E0                 BLX     R3              ; bytecpy(task_loop, dyn_task_loop, 0x100)&lt;br /&gt;
RAM:000119E2                 LDR     R3, [SP,#0x40+ptr_200]&lt;br /&gt;
RAM:000119E4                 STR     R3, [SP,#4]     ; void *stack_address = malloc(0x200)&lt;br /&gt;
RAM:000119E6                 MOVS    R3, #0x44&lt;br /&gt;
RAM:000119E8                 STR     R3, [SP,#0xC]   ; priority = 0x44&lt;br /&gt;
RAM:000119EA                 MOVS    R3, #0xA&lt;br /&gt;
RAM:000119EC                 ADDS    R4, #1          ; thumbing dyn_task_loop&lt;br /&gt;
RAM:000119EE                 STR     R3, [SP,#0x14]  ; preempt = NU_PREEMPT&lt;br /&gt;
RAM:000119F0                 MOVS    R3, #0xC&lt;br /&gt;
RAM:000119F2                 ADDS    R2, R4, #0      ; void(*task_entry)&lt;br /&gt;
RAM:000119F4                 STR     R3, [SP,#0x18]  ; auto_start = NU_START&lt;br /&gt;
RAM:000119F6                 LDR     R1, =devteam1   ; char *name&lt;br /&gt;
RAM:000119F8                 STR     R5, [SP]        ; void *argv = 0&lt;br /&gt;
RAM:000119FA                 STR     R6, [SP,#8]     ; stack_size = 0x200&lt;br /&gt;
RAM:000119FC                 STR     R5, [SP,#0x10]  ; time_slice = 0&lt;br /&gt;
RAM:000119FE                 ADDS    R0, R7, #0      ; NU_TASK *task&lt;br /&gt;
RAM:00011A00                 MOVS    R3, #0          ; int argc = 0&lt;br /&gt;
RAM:00011A02                 LDR     R4, =0x203FB540 ; NU_Create_Task&lt;br /&gt;
RAM:00011A04                 BLX     R4              ; status = NU_Create_Task()&lt;br /&gt;
RAM:00011A06                 ADDS    R2, R0, #0&lt;br /&gt;
RAM:00011A08                 CMP     R0, #0          ; success = zero&lt;br /&gt;
RAM:00011A0A                 BNE     status_error&lt;br /&gt;
RAM:00011A0C                 LDR     R1, =OK&lt;br /&gt;
RAM:00011A0E                 LDR     R0, [SP,#0x40+resp_string]&lt;br /&gt;
RAM:00011A10                 LDR     R3, =0x2046DD00 ; sprintf&lt;br /&gt;
RAM:00011A12                 BLX     R3              ; sprintf(resp_string,&amp;quot;OK&amp;quot;)&lt;br /&gt;
RAM:00011A14                 B       exit            ; fixing stack&lt;br /&gt;
RAM:00011A16 ; ---------------------------------------------------------------------------&lt;br /&gt;
RAM:00011A16&lt;br /&gt;
RAM:00011A16 status_error                            ; CODE XREF: new_handler+5A�j&lt;br /&gt;
RAM:00011A16                 LDR     R1, =ERROR&lt;br /&gt;
RAM:00011A18                 LDR     R0, [SP,#0x40+resp_string]&lt;br /&gt;
RAM:00011A1A                 LDR     R3, =0x2046DD00 ; sprintf&lt;br /&gt;
RAM:00011A1C                 BLX     R3              ; sprintf(resp_string,&amp;quot;ERROR&amp;quot;)&lt;br /&gt;
RAM:00011A1E&lt;br /&gt;
RAM:00011A1E exit                                    ; CODE XREF: new_handler+64�j&lt;br /&gt;
RAM:00011A1E                 ADD     SP, SP, #0x2C   ; fixing stack&lt;br /&gt;
RAM:00011A20                 POP     {R4-R7,PC}      ; bye&lt;br /&gt;
RAM:00011A20 ; End of function new_handler&lt;br /&gt;
RAM:00011A20&lt;br /&gt;
RAM:00011A20 ; ---------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unlock task loop===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RAM:00011A64 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00011A64&lt;br /&gt;
RAM:00011A64 task_loop                               ; DATA XREF: RAM:off_11A2C�o&lt;br /&gt;
RAM:00011A64                 PUSH    {R4,R5,LR}&lt;br /&gt;
RAM:00011A66                 LDR     R5, =0x40232754 ; sec mailbox&lt;br /&gt;
RAM:00011A68                 SUB     SP, SP, #0x14&lt;br /&gt;
RAM:00011A6A&lt;br /&gt;
RAM:00011A6A loop                                    ; CODE XREF: task_loop+44�j&lt;br /&gt;
RAM:00011A6A                 LDR     R3, =0x20165998 ; NU_Receive_From_Mailbox&lt;br /&gt;
RAM:00011A6C                 ADDS    R0, R5, #0      ; NU_MAILBOX *mailbox&lt;br /&gt;
RAM:00011A6E                 MOV     R1, SP          ; void *Message&lt;br /&gt;
RAM:00011A70                 MOVS    R2, #0xFF       ; Timeout&lt;br /&gt;
RAM:00011A72                 BLX     R3              ; NU_Receive_From_Mailbox(sec_mailbox,SP,0xFF)&lt;br /&gt;
RAM:00011A74                 LDR     R3, [SP]        ; Message[0]&lt;br /&gt;
RAM:00011A76                 CMP     R3, #0xD        ; Message[0] = 0xD ?&lt;br /&gt;
RAM:00011A78                 BNE     skip            ; &lt;br /&gt;
RAM:00011A7A                 LDR     R1, [SP,#4]     ; Message[1]&lt;br /&gt;
RAM:00011A7C                 LDR     R3, =0x402F79BC&lt;br /&gt;
RAM:00011A7E                 LDR     R2, [R1]        ; Message[1].field0&lt;br /&gt;
RAM:00011A80                 STR     R2, [R3]        ; sec_task_var1 = Message[1].field0&lt;br /&gt;
RAM:00011A82                 ADDS    R3, #4          ; 0x402F79C0&lt;br /&gt;
RAM:00011A84                 LDR     R2, [R1,#4]     ; Message[1].field1&lt;br /&gt;
RAM:00011A86                 STR     R2, [R3]        ; sec_task_var2 = Message[1].field1&lt;br /&gt;
RAM:00011A88                 LDR     R2, [R1,#8]     ; Message[1].field2&lt;br /&gt;
RAM:00011A8A                 LDR     R3, =0x100FF00&lt;br /&gt;
RAM:00011A8C                 STR     R3, [R2]        ; Message[1].field2[0] = 0x100FF00&lt;br /&gt;
RAM:00011A8E                 LDR     R3, =0x4020401&lt;br /&gt;
RAM:00011A90                 STR     R3, [R2,#4]     ; Message[1].field2[1] = 0x4020401&lt;br /&gt;
RAM:00011A92                 LDR     R3, =0x4040403&lt;br /&gt;
RAM:00011A94                 STR     R3, [R2,#8]     ; Message[1].field2[2] = 0x4040403&lt;br /&gt;
RAM:00011A96                 MOVS    R3, #1&lt;br /&gt;
RAM:00011A98                 STR     R3, [R1,#0xC]   ; Message[1].field3 = 1&lt;br /&gt;
RAM:00011A9A                 MOVS    R3, #0x20       &lt;br /&gt;
RAM:00011A9C                 STR     R3, [SP]        ; Message[0] = 0x20&lt;br /&gt;
RAM:00011A9E&lt;br /&gt;
RAM:00011A9E skip                                    ; CODE XREF: task_loop+14�j&lt;br /&gt;
RAM:00011A9E                 ADDS    R0, R5, #0      ; sec mailbox&lt;br /&gt;
RAM:00011AA0                 MOV     R1, SP          ; void *Message&lt;br /&gt;
RAM:00011AA2                 MOVS    R2, #0xFF       ; timeout&lt;br /&gt;
RAM:00011AA4                 LDR     R3, =0x203ED568&lt;br /&gt;
RAM:00011AA6                 BLX     R3              ; NU_Send_To_Mailbox()&lt;br /&gt;
RAM:00011AA8                 B       loop            ; NU_Receive_From_Mailbox&lt;br /&gt;
RAM:00011AA8 ; End of function task_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Planetbeing explains...===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
13:24:29  &amp;lt;crash-x_&amp;gt; especially how does ultra/yellow sn0w work&lt;br /&gt;
13:24:40  &amp;lt;crash-x_&amp;gt; are you overwriting instructions&lt;br /&gt;
13:24:48  &amp;lt;crash-x_&amp;gt; or some values in memory to make it accept the sim?&lt;br /&gt;
13:24:48  &amp;lt;planetbeing&amp;gt; Nah.&lt;br /&gt;
13:24:53  &amp;lt;planetbeing&amp;gt; It's a task.&lt;br /&gt;
13:25:06  &amp;lt;planetbeing&amp;gt; That just waits for securiy messages to go through the inbox.&lt;br /&gt;
13:25:13  &amp;lt;westbaer&amp;gt; planetbeing: btw, why isnt yellowsn0w/ultrasn0w not open-source anymore? like u posted an *oooold* version once&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
13:26:33  &amp;lt;planetbeing&amp;gt; The only thing I do for ys/us is the loader bit.&lt;br /&gt;
13:26:39  &amp;lt;westbaer&amp;gt; so whats actually the loader stuff you've been talking about?&lt;br /&gt;
13:26:46  &amp;lt;planetbeing&amp;gt; That uses the exploit to start MuscleNerd's payload.&lt;br /&gt;
13:27:21  &amp;lt;westbaer&amp;gt; ah&lt;br /&gt;
13:27:26  &amp;lt;planetbeing&amp;gt; Well, you have a vulnerability.&lt;br /&gt;
13:27:30  &amp;lt;planetbeing&amp;gt; And you want to load a large chunk of code.&lt;br /&gt;
13:27:39  &amp;lt;planetbeing&amp;gt; And you don't have much room to wriggle in for your overflow&lt;br /&gt;
13:28:21  &amp;lt;westbaer&amp;gt; aah, makes sense&lt;br /&gt;
13:28:50  &amp;lt;planetbeing&amp;gt; So the solution is a small loader that loads the rest of the code, and overcomes any restrictions there are on allowable characters.&lt;br /&gt;
13:28:55  &amp;lt;ashikase&amp;gt; francis: pm&lt;br /&gt;
13:28:59  &amp;lt;westbaer&amp;gt; yeah&lt;br /&gt;
13:29:10  &amp;lt;crash-x_&amp;gt; planetbeing: the baseband is it like one process that runs there&lt;br /&gt;
13:29:19  &amp;lt;crash-x_&amp;gt; or is it like a small os with process and stuff&lt;br /&gt;
13:29:19  &amp;lt;planetbeing&amp;gt; Basically a good loader should turn a vulnerability into a reliable platform for the execution of arbitrary code, unrestricted by vulnerability-specific stuff.&lt;br /&gt;
13:29:37  &amp;lt;planetbeing&amp;gt; Oh, it's a full-featured OS.&lt;br /&gt;
13:29:38  &amp;lt;planetbeing&amp;gt; Nucleus.&lt;br /&gt;
13:29:51  &amp;lt;planetbeing&amp;gt; http://www.mentor.com/products/embedded_software/nucleus_rtos/&lt;br /&gt;
13:29:54  &amp;lt;crash-x_&amp;gt; and when you execute an at command&lt;br /&gt;
13:30:06  &amp;lt;crash-x_&amp;gt; does that start another process that is crashed then&lt;br /&gt;
13:30:21  &amp;lt;planetbeing&amp;gt; Ideally, you don't crash anything.&lt;br /&gt;
13:30:21  &amp;lt;crash-x_&amp;gt; or does it crash like the main baseband program&lt;br /&gt;
13:30:23  &amp;lt;planetbeing&amp;gt; And we don't.&lt;br /&gt;
13:30:49  &amp;lt;crash-x_&amp;gt; so am i understand it right&lt;br /&gt;
13:30:50  &amp;lt;westbaer&amp;gt; wait. is nucleus on the baseband already installed or do you actually inject it with ultrasn0w?&lt;br /&gt;
13:30:51  &amp;lt;planetbeing&amp;gt; We load a bunch of code into certain memory locations, execute them, and then return safely back to the main command parser task.&lt;br /&gt;
13:31:00  &amp;lt;planetbeing&amp;gt; Nucleus is what the baseband runs.&lt;br /&gt;
13:31:04  &amp;lt;westbaer&amp;gt; ah ok&lt;br /&gt;
13:31:29  &amp;lt;planetbeing&amp;gt; I mean, even the bootrom is an OS.&lt;br /&gt;
13:31:36  &amp;lt;planetbeing&amp;gt; With one task, but it still has a scheduler. =P&lt;br /&gt;
13:31:39  &amp;lt;crash-x_&amp;gt; ah thats how you do it&lt;br /&gt;
13:31:42  &amp;lt;westbaer&amp;gt; heh&lt;br /&gt;
13:31:44  &amp;lt;crash-x_&amp;gt; and about your payload&lt;br /&gt;
13:31:57  &amp;lt;crash-x_&amp;gt; does it start a new process like using fork() &lt;br /&gt;
13:32:03  &amp;lt;crash-x_&amp;gt; or does it all the work in the exploited process&lt;br /&gt;
13:32:11  &amp;lt;planetbeing&amp;gt; It uses Nucleus-specific calls that create the new task.&lt;br /&gt;
13:32:19  &amp;lt;planetbeing&amp;gt; Well, the payload has to create a new task&lt;br /&gt;
13:32:22  &amp;lt;westbaer&amp;gt; I think they are documented on the wiki&lt;br /&gt;
13:32:25  &amp;lt;planetbeing&amp;gt; To monitor for certain events.&lt;br /&gt;
13:32:47  &amp;lt;planetbeing&amp;gt; Yeah, just read Darkmen's decompile.&lt;br /&gt;
13:33:00  &amp;lt;planetbeing&amp;gt; us has the exact same payload as ys&lt;br /&gt;
13:33:08  &amp;lt;planetbeing&amp;gt; Just different addresses for function calls and stuff.&lt;br /&gt;
13:33:19  &amp;lt;planetbeing&amp;gt; And I had to rewrite the loader due to even tighter constraints.&lt;br /&gt;
13:33:28  &amp;lt;crash-x_&amp;gt; thats cool, thanks for explaining&lt;br /&gt;
13:33:34  &amp;lt;westbaer&amp;gt; yup, thanks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From irc.saurik.com #iphone on sunday the 5th of july.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source Code==&lt;br /&gt;
The source code for yellowsn0w 0.9.1 (old version) was released along with yellowsn0w release. [http://xs1.iphwn.org/releases/yellowsn0w.tar.bz2]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[X-Gold 608 Unlock]]&lt;br /&gt;
* [[X-Gold 608]]&lt;br /&gt;
* [[Baseband]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [http://chronic-dev.org/blog/2008/12/props/ Chronic Dev's post about Yellowsn0w]&lt;br /&gt;
* [http://blog.iphone-dev.org/post/65126957/tis-the-season-to-be-jolly Yellowsn0w Announcement]&lt;br /&gt;
* [http://qik.com/video/729275 MuscleNerd's yellowsn0w Demo]&lt;br /&gt;
* [http://yellowsn0w.com yellowsn0w Official Website]&lt;br /&gt;
* [http://www.youtube.com/watch?v=kd5vOy2m5uY MuscleNerd's ultrasn0w demo]&lt;br /&gt;
&lt;br /&gt;
[[Category:Unlocking Methods]]&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Main_Page&amp;diff=4075</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Main_Page&amp;diff=4075"/>
		<updated>2009-07-04T16:22:00Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Logo by iHassan --&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:Iptwiki.jpg‎]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;!-- Added a split column information box- computid --&amp;gt;&lt;br /&gt;
{{:Main Page/Welcome}}&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;background-color:orange; text-align:center; width:25%;&amp;quot;&amp;gt;&amp;lt;b&amp;gt;[[Unlock 2.0|Break Chain of Trust (X-Gold 608)]]&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td colspan=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[Disclaimer]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==Software==&lt;br /&gt;
* [[Filesystem]]&lt;br /&gt;
* [[Firmware]]&lt;br /&gt;
* [[Keys]]&lt;br /&gt;
* [[Protocols]]&lt;br /&gt;
* [[System Log]]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
=== iPhone ===&lt;br /&gt;
* [[m68ap|iPhone (m68ap)]]&lt;br /&gt;
* [[n82ap|iPhone 3G (n82ap)]]&lt;br /&gt;
* [[N88AP|iPhone 3GS (n88ap)]]&lt;br /&gt;
&lt;br /&gt;
=== iPod touch ===&lt;br /&gt;
* [[n45ap|iPod touch (n45ap)]]&lt;br /&gt;
* [[n72ap|iPod touch 2nd Generation (n72ap)]]&lt;br /&gt;
&lt;br /&gt;
==App Processor ([[Jailbreak]])==&lt;br /&gt;
The [[iPhone]], [[iPod touch]], and [[iPhone 3G]] makes use of the [[S5L8900]] platform as application processor. Current models, such as the [[iPod touch 2G]] and the [[N88AP|iPhone 3GS]], use newer processors. The [[S5L8720]] and [[S5L8920]] are used, respectively. Here is where the [[Jailbreak|jailbreak]] applies.&lt;br /&gt;
&lt;br /&gt;
==Baseband ([[Unlock]])==&lt;br /&gt;
The [[Baseband Device]] is where the [[unlock]] applies.&lt;br /&gt;
&lt;br /&gt;
==Application Development==&lt;br /&gt;
* [[Toolchain]] (Includes tutorials)&lt;br /&gt;
* [[Toolchain 2.0]] (Includes tutorials)&lt;br /&gt;
* [[Frameworks]]&lt;br /&gt;
* [[MobileDevice Library]]&lt;br /&gt;
* [[Apple Certification Process]]&lt;br /&gt;
* [[Bypassing iPhone Code Signatures]]&lt;br /&gt;
* [[Distribution Methods]]&lt;br /&gt;
&lt;br /&gt;
==Application Copy Protection==&lt;br /&gt;
* [[Copy Protection Overview]]&lt;br /&gt;
* [[Application Structure and Signatures]]&lt;br /&gt;
* [[Mach-O Loading Process]]&lt;br /&gt;
* [[Bugging Debuggers]]&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
* [[Jailbreak]]&lt;br /&gt;
* [[Activation]]&lt;br /&gt;
* [[Unlock]]&lt;br /&gt;
* [[Baseband Device|Baseband]]&lt;br /&gt;
* [[Baseband Bootloader|Bootloader]]&lt;br /&gt;
* [[DFU]]&lt;br /&gt;
* [[iBoot]]&lt;br /&gt;
* [[iBEC]]&lt;br /&gt;
* [[iBSS]]&lt;br /&gt;
* [[NORID]]&lt;br /&gt;
* [[CHIPID]]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
* [[Bluetooth]]&lt;br /&gt;
* [[Glossary]]&lt;br /&gt;
* [[Tutorials]]&lt;br /&gt;
* [[Useful Links]]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Main_Page&amp;diff=3805</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Main_Page&amp;diff=3805"/>
		<updated>2009-06-13T23:47:26Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Logo by iHassan --&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:Iptwiki.jpg‎]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;!-- Added a split column information box- computid --&amp;gt;&lt;br /&gt;
{{:Main Page/Welcome}}&lt;br /&gt;
&amp;lt;table border=1 width=100%&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=orange width=25%&amp;gt;&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;[[Jailbreak iPhone2,1|Break Chain of Trust (S5L8920x)]]&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=orange width=25%&amp;gt;&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;[[Unlock 2.0|Break Chain of Trust (X-Gold 608)]]&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td colspan=4&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[Disclaimer]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
==Software==&lt;br /&gt;
* [[Filesystem]]&lt;br /&gt;
* [[Firmware]]&lt;br /&gt;
* [[Keys]]&lt;br /&gt;
* [[Protocols]]&lt;br /&gt;
* [[System Log]]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
=== iPhone ===&lt;br /&gt;
* [[m68ap|iPhone (m68ap)]]&lt;br /&gt;
* [[n82ap|iPhone 3G (n82ap)]]&lt;br /&gt;
* [[N88AP|iPhone 3G S (n88ap)]]&lt;br /&gt;
&lt;br /&gt;
=== iPod touch ===&lt;br /&gt;
* [[n45ap|iPod touch (n45ap)]]&lt;br /&gt;
* [[n72ap|iPod touch 2nd Generation (n72ap)]]&lt;br /&gt;
&lt;br /&gt;
==App Processor ([[Jailbreak]])==&lt;br /&gt;
The [[iPhone]], [[iPod touch]], and [[iPhone 3G]] makes use of the [[S5L8900]] platform as application processor, while the [[iPod touch 2G]] uses the [[S5L8720]]. Here is where the [[Jailbreak|jailbreak]] applies.&lt;br /&gt;
&lt;br /&gt;
==Baseband ([[Unlock]])==&lt;br /&gt;
The [[Baseband Device]] is where the [[unlock]] applies.&lt;br /&gt;
&lt;br /&gt;
==Application Development==&lt;br /&gt;
* [[Toolchain]] (Includes tutorials)&lt;br /&gt;
* [[Toolchain 2.0]] (Includes tutorials)&lt;br /&gt;
* [[Frameworks]]&lt;br /&gt;
* [[MobileDevice Library]]&lt;br /&gt;
* [[Apple Certification Process]]&lt;br /&gt;
* [[Bypassing iPhone Code Signatures]]&lt;br /&gt;
* [[Distribution Methods]]&lt;br /&gt;
&lt;br /&gt;
==Application Copy Protection==&lt;br /&gt;
* [[Copy Protection Overview]]&lt;br /&gt;
* [[Application Structure and Signatures]]&lt;br /&gt;
* [[Mach-O Loading Process]]&lt;br /&gt;
* [[Bugging Debuggers]]&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
* [[Jailbreak]]&lt;br /&gt;
* [[Activation]]&lt;br /&gt;
* [[Unlock]]&lt;br /&gt;
* [[Baseband Device|Baseband]]&lt;br /&gt;
* [[Baseband Bootloader|Bootloader]]&lt;br /&gt;
* [[DFU]]&lt;br /&gt;
* [[iBoot]]&lt;br /&gt;
* [[iBEC]]&lt;br /&gt;
* [[iBSS]]&lt;br /&gt;
* [[NORID]]&lt;br /&gt;
* [[CHIPID]]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
* [[Bluetooth]]&lt;br /&gt;
* [[Glossary]]&lt;br /&gt;
* [[Tutorials]]&lt;br /&gt;
* [[Useful Links]]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=N88AP&amp;diff=3803</id>
		<title>N88AP</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=N88AP&amp;diff=3803"/>
		<updated>2009-06-13T23:47:05Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: IPhone2,1 moved to N88AP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:IPhone3GS.jpg|right|thumb|iPhone 3G S, back and front.]]&lt;br /&gt;
&lt;br /&gt;
This is the iPhone 3G S. It will be released on June 19, 2009 with a price tag of $199 for the 16GB model and $299 for the 32GB model, in the U.S., Canada and major European countries. Price varies depending on the operator selling it. It features the same design as the [[iPhone 3G]], but has also new features such as video recording, voice control, digital compass, faster CPU, increased RAM etc.&lt;br /&gt;
&lt;br /&gt;
== Baseband ==&lt;br /&gt;
The iPhone 3G S will probably use the [[X-Gold 608]] baseband chip, same as in the iPhone 3G.&lt;br /&gt;
&lt;br /&gt;
== Application Processor ==&lt;br /&gt;
It makes use of the [[S5L8920x]] application processor.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
'''Color''': Black or white &amp;lt;br&amp;gt;&lt;br /&gt;
'''Size''': 4.5 inches (115.5 mm) (h) × 2.4 inches (62.1 mm) (w) × 0.48 inch (12.3 mm) (d) &amp;lt;br&amp;gt;&lt;br /&gt;
'''Weight''': 135 g (4.8 oz) &amp;lt;br&amp;gt;&lt;br /&gt;
'''Battery''': Up to 12 hours of 2G talk, 5 hours of 3G talk, 5 (3G) or 9 (Wi-Fi) hours of Internet use, 10 hours of video playback, and up to 30 hours of audio playback, lasting over 300 hours on standby. &amp;lt;br&amp;gt;&lt;br /&gt;
'''3G''': Broadband data speeds, supporting 7.2Mbps HSDPA &amp;lt;br&amp;gt;&lt;br /&gt;
'''Camera''': 3.15MP with Autofocus and manual focus (''Tap to focus''), supporting VGA video recording @ 30FPS&lt;br /&gt;
&lt;br /&gt;
More specifications available in [http://www.gsmarena.com/apple_iphone_3g_s-2826.php GSMArena].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Jailbreak iPhone2,1]]&lt;br /&gt;
* [[X-Gold 608 Unlock]]&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
* [http://www.anandtech.com/gadgets/showdoc.aspx?i=3579 AnandTech: The iPhone 3GS Hardware Exposed &amp;amp; Analyzed]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=IPhone2,1&amp;diff=3804</id>
		<title>IPhone2,1</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=IPhone2,1&amp;diff=3804"/>
		<updated>2009-06-13T23:47:05Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: IPhone2,1 moved to N88AP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[N88AP]]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=IRecovery&amp;diff=3753</id>
		<title>IRecovery</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=IRecovery&amp;diff=3753"/>
		<updated>2009-05-27T19:19:23Z</updated>

		<summary type="html">&lt;p&gt;Westbaer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;iRecovery is a libusb-based commandline utility for Mac OS X and Linux (perhaps Windows too). It is able to talk to the iBoot/iBSS in Apple's iPhone/iPod touch via USB.&lt;br /&gt;
&lt;br /&gt;
It's completely open-source, the source-code is released under the terms of the GNU General Public License version 3.&lt;br /&gt;
The full license text can be found in the LICENSE file on github.&lt;br /&gt;
&lt;br /&gt;
It currently connects to 0x1281 (iPhone, iPhone 3G, iPod touch, iPod touch 2G: Recovery Mode/iBSS), 0x1227 (iPhone, &lt;br /&gt;
iPhone 3G, iPod touch: WTF Mode; iPod touch 2G: DFU Mode).&lt;br /&gt;
&lt;br /&gt;
==Credits==&lt;br /&gt;
westbaer&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
&lt;br /&gt;
===DFU 2.0 (0x1227)===&lt;br /&gt;
It can upload a file, such as an iBSS, so that you can unplug and spawn a shell with 0x1281.&lt;br /&gt;
&lt;br /&gt;
===Recovery 2.0 (0x1281)===&lt;br /&gt;
====File Uploading====&lt;br /&gt;
You can upload a file to 0x9000000 with the following syntax:&lt;br /&gt;
 ./iRecovery -f file&lt;br /&gt;
&lt;br /&gt;
====Two-Way Shell====&lt;br /&gt;
You can spawn a shell to do all sorts of neat things with the syntax:&lt;br /&gt;
 ./iRecovery -s&lt;br /&gt;
Once it has spawned, you can type 'help' and iBoot will respond with its built-in command list.&lt;br /&gt;
&lt;br /&gt;
====Single Command====&lt;br /&gt;
 ./iRecovery -c &amp;quot;command&amp;quot;&lt;br /&gt;
Sends a single command to the device *without* spawning a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
[http://github.com/westbaer/irecovery/tree Latest version always on GitHub]&lt;/div&gt;</summary>
		<author><name>Westbaer</name></author>
		
	</entry>
</feed>