<?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=Expired-</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=Expired-"/>
	<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/wiki/Special:Contributions/Expired-"/>
	<updated>2026-04-10T18:44:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.14</generator>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=PMB8878&amp;diff=3523</id>
		<title>PMB8878</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=PMB8878&amp;diff=3523"/>
		<updated>2009-04-14T17:10:18Z</updated>

		<summary type="html">&lt;p&gt;Expired-: Removed circular wiki reference :)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the baseband processor used in the iPhone 3G. It is upgraded with [[BBUpdaterExtreme]]. It is also known as the PMB8878.&lt;br /&gt;
&lt;br /&gt;
==Datasheet==&lt;br /&gt;
Anyone got one? Infineon provides [http://www.infineon.com/dgdl/X-GOLD608_XMM6080.pdf?location=Products.Mobile_Phone_Baseband_ICs.WCDMA___HSDPA.X-GOLD__608_-_PMB_8878.PRODUCT_TYPE_DOCUMENTS.X-GOLD608_XMM6080.pdf&amp;amp;folderId=db3a304312fcb1bc0113000c158f0004&amp;amp;fileId=db3a30431936bc4b011957c66fee3850 this], which isn't really useful.&lt;br /&gt;
&lt;br /&gt;
==Secpack 2.0==&lt;br /&gt;
This is the security region in the files sent to the [[X-Gold 608]]. This is the first 0xCF8 is new fls and eep files.&lt;br /&gt;
&lt;br /&gt;
===Layout===&lt;br /&gt;
 0x634--Memory Map&lt;br /&gt;
 0x714--Descriptor&lt;br /&gt;
 0xCD4--Post secpack pointer to name&lt;br /&gt;
 0xCEC--Data length&lt;br /&gt;
&lt;br /&gt;
==Endpack==&lt;br /&gt;
The fls and eep files also have a footer tacked onto the end containing the loader and signature.&lt;br /&gt;
&lt;br /&gt;
==Memory Map==&lt;br /&gt;
  FLASH      0x20000000 0x1000000&lt;br /&gt;
  CODE       0x20000000   0x40000 0b0010(bootstrapper)&lt;br /&gt;
  CODE       0x20040000  0xDC0000 0b0100(main firmware)&lt;br /&gt;
  FFS        0x20A00000  0x100000 0b1100(empty)&lt;br /&gt;
  DYNFFS     0x20A00000  0x100000 0b1100(empty)&lt;br /&gt;
  FFS        0x20B00000   0x40000 0b1011(empty)&lt;br /&gt;
  DYN_EEP    0x20E40000   0x80000 0b0110&lt;br /&gt;
  SECPACK    0x20EC0000   0x40000&lt;br /&gt;
  SECZONE    0x20F80000   0x40000&lt;br /&gt;
  STATIC_EEP 0x20FC0000   0x40000 0b0111&lt;br /&gt;
  RAM        0x40000000  0x800000&lt;br /&gt;
&lt;br /&gt;
==MMU relocation table==&lt;br /&gt;
===Bootloader===&lt;br /&gt;
[[Image:Bltbl.png]]&lt;br /&gt;
&lt;br /&gt;
===Firmware===&lt;br /&gt;
[[Image:Bbmmu.png]]&lt;br /&gt;
&lt;br /&gt;
==Complete memory dump==&lt;br /&gt;
[http://depositfiles.com/files/i5119hpzm 0x00000000-0x0001FFFF]&lt;br /&gt;
&lt;br /&gt;
[http://depositfiles.com/files/mxslfu4dp 0x20000000-0x20FFFFFF]&lt;br /&gt;
&lt;br /&gt;
[http://depositfiles.com/files/6wiet73wn 0x40000000-0x407FFFFF]&lt;br /&gt;
&lt;br /&gt;
[http://depositfiles.com/files/fioppsphe 0xFFFF0000-0xFFFFFFFF]&lt;br /&gt;
&lt;br /&gt;
== Known Firmware Versions ==&lt;br /&gt;
  [[1.43.00]]    2.0 (Build 5A331 - Internal Beta)&lt;br /&gt;
  [[1.45.00]]    2.0 (Build 5A347 - Gold Master)&lt;br /&gt;
  [[1.48.02]]    2.0.1 (Build 5B108)&lt;br /&gt;
  [[2.04.03]]    2.1 (Build 5F90)&lt;br /&gt;
  [[2.08.01]]    2.0.2 (Build 5C1)&lt;br /&gt;
  [[2.11.07]]    2.1 (Build 5F136)&lt;br /&gt;
  [[2.28.00]]    2.2 (Build 5G77)&lt;br /&gt;
  [[2.30.03]]    2.2.1 (Build 5H11)&lt;br /&gt;
  [[4.20.01]]    3.0 beta 1 (Build 7A238j)&lt;br /&gt;
  [[4.22.01]]    3.0 beta 2 (Build 7A259g)&lt;br /&gt;
&lt;br /&gt;
==Accessing Interactive Mode==&lt;br /&gt;
Interactive mode isn't accessed by sending characters to the baseband. Instead a GPIO pin is raised with a kernel call to preupdate reset.&lt;br /&gt;
 result = IOConnectCallScalarMethod(conn, 0, 0, 0, 0, 0);	//reset&lt;br /&gt;
 result = IOConnectCallScalarMethod(conn, 1, 0, 0, 0, 0);	//power set&lt;br /&gt;
 result = IOConnectCallScalarMethod(conn, 2, 0, 0, 0, 0);	//configuring mux&lt;br /&gt;
 result = IOConnectCallScalarMethod(conn, 7, 0, 0, 0, 0);	//powercycle&lt;br /&gt;
 result = IOConnectCallScalarMethod(conn, 8, 0, 0, 0, 0);	//preupdate reset&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=PMB8878&amp;diff=3522</id>
		<title>PMB8878</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=PMB8878&amp;diff=3522"/>
		<updated>2009-04-14T17:09:38Z</updated>

		<summary type="html">&lt;p&gt;Expired-: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the baseband processor used in the iPhone 3G. It is upgraded with [[BBUpdaterExtreme]]. It is also known as the [[PMB8878]]&lt;br /&gt;
&lt;br /&gt;
==Datasheet==&lt;br /&gt;
Anyone got one? Infineon provides [http://www.infineon.com/dgdl/X-GOLD608_XMM6080.pdf?location=Products.Mobile_Phone_Baseband_ICs.WCDMA___HSDPA.X-GOLD__608_-_PMB_8878.PRODUCT_TYPE_DOCUMENTS.X-GOLD608_XMM6080.pdf&amp;amp;folderId=db3a304312fcb1bc0113000c158f0004&amp;amp;fileId=db3a30431936bc4b011957c66fee3850 this], which isn't really useful.&lt;br /&gt;
&lt;br /&gt;
==Secpack 2.0==&lt;br /&gt;
This is the security region in the files sent to the [[X-Gold 608]]. This is the first 0xCF8 is new fls and eep files.&lt;br /&gt;
&lt;br /&gt;
===Layout===&lt;br /&gt;
 0x634--Memory Map&lt;br /&gt;
 0x714--Descriptor&lt;br /&gt;
 0xCD4--Post secpack pointer to name&lt;br /&gt;
 0xCEC--Data length&lt;br /&gt;
&lt;br /&gt;
==Endpack==&lt;br /&gt;
The fls and eep files also have a footer tacked onto the end containing the loader and signature.&lt;br /&gt;
&lt;br /&gt;
==Memory Map==&lt;br /&gt;
  FLASH      0x20000000 0x1000000&lt;br /&gt;
  CODE       0x20000000   0x40000 0b0010(bootstrapper)&lt;br /&gt;
  CODE       0x20040000  0xDC0000 0b0100(main firmware)&lt;br /&gt;
  FFS        0x20A00000  0x100000 0b1100(empty)&lt;br /&gt;
  DYNFFS     0x20A00000  0x100000 0b1100(empty)&lt;br /&gt;
  FFS        0x20B00000   0x40000 0b1011(empty)&lt;br /&gt;
  DYN_EEP    0x20E40000   0x80000 0b0110&lt;br /&gt;
  SECPACK    0x20EC0000   0x40000&lt;br /&gt;
  SECZONE    0x20F80000   0x40000&lt;br /&gt;
  STATIC_EEP 0x20FC0000   0x40000 0b0111&lt;br /&gt;
  RAM        0x40000000  0x800000&lt;br /&gt;
&lt;br /&gt;
==MMU relocation table==&lt;br /&gt;
===Bootloader===&lt;br /&gt;
[[Image:Bltbl.png]]&lt;br /&gt;
&lt;br /&gt;
===Firmware===&lt;br /&gt;
[[Image:Bbmmu.png]]&lt;br /&gt;
&lt;br /&gt;
==Complete memory dump==&lt;br /&gt;
[http://depositfiles.com/files/i5119hpzm 0x00000000-0x0001FFFF]&lt;br /&gt;
&lt;br /&gt;
[http://depositfiles.com/files/mxslfu4dp 0x20000000-0x20FFFFFF]&lt;br /&gt;
&lt;br /&gt;
[http://depositfiles.com/files/6wiet73wn 0x40000000-0x407FFFFF]&lt;br /&gt;
&lt;br /&gt;
[http://depositfiles.com/files/fioppsphe 0xFFFF0000-0xFFFFFFFF]&lt;br /&gt;
&lt;br /&gt;
== Known Firmware Versions ==&lt;br /&gt;
  [[1.43.00]]    2.0 (Build 5A331 - Internal Beta)&lt;br /&gt;
  [[1.45.00]]    2.0 (Build 5A347 - Gold Master)&lt;br /&gt;
  [[1.48.02]]    2.0.1 (Build 5B108)&lt;br /&gt;
  [[2.04.03]]    2.1 (Build 5F90)&lt;br /&gt;
  [[2.08.01]]    2.0.2 (Build 5C1)&lt;br /&gt;
  [[2.11.07]]    2.1 (Build 5F136)&lt;br /&gt;
  [[2.28.00]]    2.2 (Build 5G77)&lt;br /&gt;
  [[2.30.03]]    2.2.1 (Build 5H11)&lt;br /&gt;
  [[4.20.01]]    3.0 beta 1 (Build 7A238j)&lt;br /&gt;
  [[4.22.01]]    3.0 beta 2 (Build 7A259g)&lt;br /&gt;
&lt;br /&gt;
==Accessing Interactive Mode==&lt;br /&gt;
Interactive mode isn't accessed by sending characters to the baseband. Instead a GPIO pin is raised with a kernel call to preupdate reset.&lt;br /&gt;
 result = IOConnectCallScalarMethod(conn, 0, 0, 0, 0, 0);	//reset&lt;br /&gt;
 result = IOConnectCallScalarMethod(conn, 1, 0, 0, 0, 0);	//power set&lt;br /&gt;
 result = IOConnectCallScalarMethod(conn, 2, 0, 0, 0, 0);	//configuring mux&lt;br /&gt;
 result = IOConnectCallScalarMethod(conn, 7, 0, 0, 0, 0);	//powercycle&lt;br /&gt;
 result = IOConnectCallScalarMethod(conn, 8, 0, 0, 0, 0);	//preupdate reset&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Ultrasn0w&amp;diff=3521</id>
		<title>Ultrasn0w</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Ultrasn0w&amp;diff=3521"/>
		<updated>2009-04-14T17:09:09Z</updated>

		<summary type="html">&lt;p&gt;Expired-: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first [[iPhone 3G]] [[Unlock 2.0|unlock]] payload. Released on 01/01/09. [http://blog.iphone-dev.org/post/67797811/dont-eat-yellowsn0w]&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
MuscleNerd, and [[The dev team]]&lt;br /&gt;
&lt;br /&gt;
==Exploit==&lt;br /&gt;
Relies on an unsigned code injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
The actual unlock works by a daemon patching the baseband's RAM on-the-fly, overriding the carrier lock code. It is not permanent because of the signature checks - the bootloader has to pass the sigchecks and the baseband has to pass them too, so any change to the baseband/bootloader cannot be made.&lt;br /&gt;
&lt;br /&gt;
==Current Injection Vector==&lt;br /&gt;
yellowsn0w refers to the reuseable '''payload''', but it requires an injection vector in order to be inserted into the baseband. yellowsn0w was originally to be released with an injection vector that works on pre-2.28.00 baseband versions. However, [[geohot]] had an injection vector for 2.28.00 and the decision was made to release yellowsn0w with this injection vector to benefit the most people.&lt;br /&gt;
 &lt;br /&gt;
The injection vector is discussed [[AT+stkprof Exploit|here]]&lt;br /&gt;
&lt;br /&gt;
==Payload w/ Comments (by Darkmen) ===&lt;br /&gt;
&lt;br /&gt;
The exploit consists from 4 parts:&lt;br /&gt;
&lt;br /&gt;
===Code loader===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ROM:00000000 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
ROM:00000000&lt;br /&gt;
ROM:00000000&lt;br /&gt;
ROM:00000000 loader&lt;br /&gt;
ROM:00000000                 LDR     R2, =0x11700    ; unused ram to place code&lt;br /&gt;
ROM:00000002                 ADDS    R4, R2, #1      ; thumb switch&lt;br /&gt;
ROM:00000004                 LDR     R3, =0x40159FBF ; at-handler buffer where stage2 binary and following hexdata are&lt;br /&gt;
ROM:00000006&lt;br /&gt;
ROM:00000006 copy.loop                               ; CODE XREF: loader+12�j&lt;br /&gt;
ROM:00000006                 LDRB    R0, [R3]        ; copying code+data until double quotes&lt;br /&gt;
ROM:00000008                 CMP     R0, #0x22 ; '&amp;quot;'&lt;br /&gt;
ROM:0000000A                 BEQ     run             ; jump thumb code&lt;br /&gt;
ROM:0000000C                 STRB    R0, [R2]&lt;br /&gt;
ROM:0000000E                 ADDS    R2, #1&lt;br /&gt;
ROM:00000010                 ADDS    R3, #1&lt;br /&gt;
ROM:00000012                 B       copy.loop       ; &lt;br /&gt;
ROM:00000014 run                                     ; CODE XREF: loader+A�j&lt;br /&gt;
ROM:00000014                 BX      R4              ; jump stage2 code&lt;br /&gt;
ROM:00000014 ; End of function loader&lt;br /&gt;
ROM:00000014&lt;br /&gt;
ROM:00000014 ; ---------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stage2(tm)===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RAM:00000000 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00000000 stage2&lt;br /&gt;
RAM:00000000                 ADDS    R2, #0x10       ; R2 = 0x11700 + stage2 size&lt;br /&gt;
RAM:00000002                 MOVS    R7, #0xF&lt;br /&gt;
RAM:00000004                 BICS    R2, R7          ; align offset by 0x10&lt;br /&gt;
RAM:00000006                 ADDS    R7, R2, #0      ; saving address to jump&lt;br /&gt;
RAM:00000008                 ADR     R4, 0x44        ; skipping Stage2 size and taking first char from at-string&lt;br /&gt;
RAM:0000000A                 ADR     R5, char2byte   ; loading routine addr&lt;br /&gt;
RAM:0000000C                 ADDS    R5, #1          ; thumb&lt;br /&gt;
RAM:0000000E&lt;br /&gt;
RAM:0000000E loop                                    ; CODE XREF: stage2+2C�j&lt;br /&gt;
RAM:0000000E                 LDRB    R1, [R4]        ; at-string[index]&lt;br /&gt;
RAM:00000010                 CMP     R1, #'x'        ; end of line?&lt;br /&gt;
RAM:00000012                 BEQ     jump_code&lt;br /&gt;
RAM:00000014                 BLX     R5              ; char2byte first hakfbyte&lt;br /&gt;
RAM:00000016                 LSLS    R3, R1, #4      ; &amp;lt;&amp;lt;4 0X becoming X0&lt;br /&gt;
RAM:00000018                 LDRB    R1, [R4,#1]     ; at-string[index+1]&lt;br /&gt;
RAM:0000001A                 BLX     R5              ; char2hex second halfbyte&lt;br /&gt;
RAM:0000001C                 NOP&lt;br /&gt;
RAM:0000001E                 NOP&lt;br /&gt;
RAM:00000020                 NOP&lt;br /&gt;
RAM:00000022                 NOP&lt;br /&gt;
RAM:00000024                 ADDS    R1, R1, R3      ; R1 = complete byte&lt;br /&gt;
RAM:00000026                 STRB    R1, [R2]        ; storing byte to dst&lt;br /&gt;
RAM:00000028                 ADDS    R4, #2          ; hexstr_index+=2&lt;br /&gt;
RAM:0000002A                 ADDS    R2, #1          ; dst++&lt;br /&gt;
RAM:0000002C                 B       loop            ; at-string[index]&lt;br /&gt;
RAM:0000002E jump_code&lt;br /&gt;
RAM:0000002E                 NOP&lt;br /&gt;
RAM:00000030                 NOP&lt;br /&gt;
RAM:00000032                 ADDS    R7, #1          ; thumbing&lt;br /&gt;
RAM:00000034                 BX      R7              ; run Task creator code&lt;br /&gt;
RAM:00000034 ; End of function stage2&lt;br /&gt;
RAM:00000038&lt;br /&gt;
RAM:00000038 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00000038 char2byte                               ; DATA XREF: stage2+A�o&lt;br /&gt;
RAM:00000038                 CMP     R1, #0x41 ; 'A'&lt;br /&gt;
RAM:0000003A                 BGE     letter          ; letter to number&lt;br /&gt;
RAM:0000003C                 SUBS    R1, #0x30 ; '0' ; digit to number&lt;br /&gt;
RAM:0000003E                 BX      LR&lt;br /&gt;
RAM:00000040 letter                                  ; CODE XREF: char2byte+2�j&lt;br /&gt;
RAM:00000040                 SUBS    R1, #0x37 ; '7' ; letter to number&lt;br /&gt;
RAM:00000042                 BX      LR              ; ret&lt;br /&gt;
RAM:00000042 ; End of function char2byte&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task creator===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RAM:000119A0 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:000119A0&lt;br /&gt;
RAM:000119A0&lt;br /&gt;
RAM:000119A0 handler_replace&lt;br /&gt;
RAM:000119A0                 LDR     R0, =0x4011714C ; soft reset handler addr&lt;br /&gt;
RAM:000119A2                 ADR     R1, new_handler&lt;br /&gt;
RAM:000119A4                 ADDS    R1, #1          ; thumbing&lt;br /&gt;
RAM:000119A6                 STR     R1, [R0]        ; setting new handler&lt;br /&gt;
RAM:000119A8                 POP     {R0-R4,PC}      ; safe exit fixing stack&lt;br /&gt;
RAM:000119A8 ; End of function handler_replace&lt;br /&gt;
&lt;br /&gt;
RAM:000119B0 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:000119B0&lt;br /&gt;
RAM:000119B0&lt;br /&gt;
RAM:000119B0 new_handler                             ; DATA XREF: handler_replace+2�o&lt;br /&gt;
RAM:000119B0                 PUSH    {R4-R7,LR}&lt;br /&gt;
RAM:000119B2                 LDR     R3, =0x403BB344 ; jamptable var&lt;br /&gt;
RAM:000119B4                 MOVS    R6, #0x80&lt;br /&gt;
RAM:000119B6                 SUB     SP, SP, #0x2C&lt;br /&gt;
RAM:000119B8                 LSLS    R6, R6, #4      ; 0x200&lt;br /&gt;
RAM:000119BA                 STRH    R0, [R3]        ; saving R0 to mem var&lt;br /&gt;
RAM:000119BC                 STR     R1, [SP,#0x40+resp_string] ; saving responce prt to stack&lt;br /&gt;
RAM:000119BE                 LDR     R4, =0x201420AC ; malloc&lt;br /&gt;
RAM:000119C0                 ADDS    R0, R6, #0&lt;br /&gt;
RAM:000119C2                 BLX     R4              ; malloc(0x200)&lt;br /&gt;
RAM:000119C4                 MOVS    R5, #0&lt;br /&gt;
RAM:000119C6                 STR     R0, [SP,#0x40+ptr_200] ; saving pointer to stack&lt;br /&gt;
RAM:000119C8                 MOVS    R0, #0x98       ; sizeof(NU_TASK)&lt;br /&gt;
RAM:000119CA                 BLX     R4              ; malloc(0x98)&lt;br /&gt;
RAM:000119CC                 ADDS    R7, R0, #0      ; R7 = task&lt;br /&gt;
RAM:000119CE                 STR     R5, [R0,#0xC]   ; task.field=0&lt;br /&gt;
RAM:000119D0                 MOVS    R0, 0x100&lt;br /&gt;
RAM:000119D4                 BLX     R4              ; malloc(0x100)&lt;br /&gt;
RAM:000119D6                 MOVS    R2, #0x80&lt;br /&gt;
RAM:000119D8                 LDR     R1, =task_loop  ; src&lt;br /&gt;
RAM:000119DA                 LSLS    R2, R2, #1      ; size to copy&lt;br /&gt;
RAM:000119DC                 LDR     R3, =0x203C58A0 ; bytecpy&lt;br /&gt;
RAM:000119DE                 ADDS    R4, R0, #0      ; R4 = dyn_task_loop&lt;br /&gt;
RAM:000119E0                 BLX     R3              ; bytecpy(task_loop, dyn_task_loop, 0x100)&lt;br /&gt;
RAM:000119E2                 LDR     R3, [SP,#0x40+ptr_200]&lt;br /&gt;
RAM:000119E4                 STR     R3, [SP,#4]     ; void *stack_address = malloc(0x200)&lt;br /&gt;
RAM:000119E6                 MOVS    R3, #0x44&lt;br /&gt;
RAM:000119E8                 STR     R3, [SP,#0xC]   ; priority = 0x44&lt;br /&gt;
RAM:000119EA                 MOVS    R3, #0xA&lt;br /&gt;
RAM:000119EC                 ADDS    R4, #1          ; thumbing dyn_task_loop&lt;br /&gt;
RAM:000119EE                 STR     R3, [SP,#0x14]  ; preempt = NU_PREEMPT&lt;br /&gt;
RAM:000119F0                 MOVS    R3, #0xC&lt;br /&gt;
RAM:000119F2                 ADDS    R2, R4, #0      ; void(*task_entry)&lt;br /&gt;
RAM:000119F4                 STR     R3, [SP,#0x18]  ; auto_start = NU_START&lt;br /&gt;
RAM:000119F6                 LDR     R1, =devteam1   ; char *name&lt;br /&gt;
RAM:000119F8                 STR     R5, [SP]        ; void *argv = 0&lt;br /&gt;
RAM:000119FA                 STR     R6, [SP,#8]     ; stack_size = 0x200&lt;br /&gt;
RAM:000119FC                 STR     R5, [SP,#0x10]  ; time_slice = 0&lt;br /&gt;
RAM:000119FE                 ADDS    R0, R7, #0      ; NU_TASK *task&lt;br /&gt;
RAM:00011A00                 MOVS    R3, #0          ; int argc = 0&lt;br /&gt;
RAM:00011A02                 LDR     R4, =0x203FB540 ; NU_Create_Task&lt;br /&gt;
RAM:00011A04                 BLX     R4              ; status = NU_Create_Task()&lt;br /&gt;
RAM:00011A06                 ADDS    R2, R0, #0&lt;br /&gt;
RAM:00011A08                 CMP     R0, #0          ; success = zero&lt;br /&gt;
RAM:00011A0A                 BNE     status_error&lt;br /&gt;
RAM:00011A0C                 LDR     R1, =OK&lt;br /&gt;
RAM:00011A0E                 LDR     R0, [SP,#0x40+resp_string]&lt;br /&gt;
RAM:00011A10                 LDR     R3, =0x2046DD00 ; sprintf&lt;br /&gt;
RAM:00011A12                 BLX     R3              ; sprintf(resp_string,&amp;quot;OK&amp;quot;)&lt;br /&gt;
RAM:00011A14                 B       exit            ; fixing stack&lt;br /&gt;
RAM:00011A16 ; ---------------------------------------------------------------------------&lt;br /&gt;
RAM:00011A16&lt;br /&gt;
RAM:00011A16 status_error                            ; CODE XREF: new_handler+5A�j&lt;br /&gt;
RAM:00011A16                 LDR     R1, =ERROR&lt;br /&gt;
RAM:00011A18                 LDR     R0, [SP,#0x40+resp_string]&lt;br /&gt;
RAM:00011A1A                 LDR     R3, =0x2046DD00 ; sprintf&lt;br /&gt;
RAM:00011A1C                 BLX     R3              ; sprintf(resp_string,&amp;quot;ERROR&amp;quot;)&lt;br /&gt;
RAM:00011A1E&lt;br /&gt;
RAM:00011A1E exit                                    ; CODE XREF: new_handler+64�j&lt;br /&gt;
RAM:00011A1E                 ADD     SP, SP, #0x2C   ; fixing stack&lt;br /&gt;
RAM:00011A20                 POP     {R4-R7,PC}      ; bye&lt;br /&gt;
RAM:00011A20 ; End of function new_handler&lt;br /&gt;
RAM:00011A20&lt;br /&gt;
RAM:00011A20 ; ---------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unlock task loop===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RAM:00011A64 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00011A64&lt;br /&gt;
RAM:00011A64 task_loop                               ; DATA XREF: RAM:off_11A2C�o&lt;br /&gt;
RAM:00011A64                 PUSH    {R4,R5,LR}&lt;br /&gt;
RAM:00011A66                 LDR     R5, =0x40232754 ; sec mailbox&lt;br /&gt;
RAM:00011A68                 SUB     SP, SP, #0x14&lt;br /&gt;
RAM:00011A6A&lt;br /&gt;
RAM:00011A6A loop                                    ; CODE XREF: task_loop+44�j&lt;br /&gt;
RAM:00011A6A                 LDR     R3, =0x20165998 ; NU_Receive_From_Mailbox&lt;br /&gt;
RAM:00011A6C                 ADDS    R0, R5, #0      ; NU_MAILBOX *mailbox&lt;br /&gt;
RAM:00011A6E                 MOV     R1, SP          ; void *Message&lt;br /&gt;
RAM:00011A70                 MOVS    R2, #0xFF       ; Timeout&lt;br /&gt;
RAM:00011A72                 BLX     R3              ; NU_Receive_From_Mailbox(sec_mailbox,SP,0xFF)&lt;br /&gt;
RAM:00011A74                 LDR     R3, [SP]        ; Message[0]&lt;br /&gt;
RAM:00011A76                 CMP     R3, #0xD        ; Message[0] = 0xD ?&lt;br /&gt;
RAM:00011A78                 BNE     skip            ; &lt;br /&gt;
RAM:00011A7A                 LDR     R1, [SP,#4]     ; Message[1]&lt;br /&gt;
RAM:00011A7C                 LDR     R3, =0x402F79BC&lt;br /&gt;
RAM:00011A7E                 LDR     R2, [R1]        ; Message[1].field0&lt;br /&gt;
RAM:00011A80                 STR     R2, [R3]        ; sec_task_var1 = Message[1].field0&lt;br /&gt;
RAM:00011A82                 ADDS    R3, #4          ; 0x402F79C0&lt;br /&gt;
RAM:00011A84                 LDR     R2, [R1,#4]     ; Message[1].field1&lt;br /&gt;
RAM:00011A86                 STR     R2, [R3]        ; sec_task_var2 = Message[1].field1&lt;br /&gt;
RAM:00011A88                 LDR     R2, [R1,#8]     ; Message[1].field2&lt;br /&gt;
RAM:00011A8A                 LDR     R3, =0x100FF00&lt;br /&gt;
RAM:00011A8C                 STR     R3, [R2]        ; Message[1].field2[0] = 0x100FF00&lt;br /&gt;
RAM:00011A8E                 LDR     R3, =0x4020401&lt;br /&gt;
RAM:00011A90                 STR     R3, [R2,#4]     ; Message[1].field2[1] = 0x4020401&lt;br /&gt;
RAM:00011A92                 LDR     R3, =0x4040403&lt;br /&gt;
RAM:00011A94                 STR     R3, [R2,#8]     ; Message[1].field2[2] = 0x4040403&lt;br /&gt;
RAM:00011A96                 MOVS    R3, #1&lt;br /&gt;
RAM:00011A98                 STR     R3, [R1,#0xC]   ; Message[1].field3 = 1&lt;br /&gt;
RAM:00011A9A                 MOVS    R3, #0x20       &lt;br /&gt;
RAM:00011A9C                 STR     R3, [SP]        ; Message[0] = 0x20&lt;br /&gt;
RAM:00011A9E&lt;br /&gt;
RAM:00011A9E skip                                    ; CODE XREF: task_loop+14�j&lt;br /&gt;
RAM:00011A9E                 ADDS    R0, R5, #0      ; sec mailbox&lt;br /&gt;
RAM:00011AA0                 MOV     R1, SP          ; void *Message&lt;br /&gt;
RAM:00011AA2                 MOVS    R2, #0xFF       ; timeout&lt;br /&gt;
RAM:00011AA4                 LDR     R3, =0x203ED568&lt;br /&gt;
RAM:00011AA6                 BLX     R3              ; NU_Send_To_Mailbox()&lt;br /&gt;
RAM:00011AA8                 B       loop            ; NU_Receive_From_Mailbox&lt;br /&gt;
RAM:00011AA8 ; End of function task_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source Code==&lt;br /&gt;
The source code for yellowsn0w is now live [http://xs1.iphwn.org/releases/yellowsn0w.tar.bz2]&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; style=&amp;quot;text-align: center; width: auto; table-layout: fixed; border-collapse: collapse;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Country&lt;br /&gt;
! Provider&lt;br /&gt;
! yellowsn0w Version&lt;br /&gt;
! SIM/USIM&lt;br /&gt;
! Ingoing Calls?&lt;br /&gt;
! Outgoing Calls?&lt;br /&gt;
! SMS?&lt;br /&gt;
! GPRS/EDGE?&lt;br /&gt;
! UMTS/HSDPA?&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Bermuda&lt;br /&gt;
| Mobility&lt;br /&gt;
| 0.9.6&lt;br /&gt;
| SIM&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| Not Available&lt;br /&gt;
| Works but often loses signal. &lt;br /&gt;
|-&lt;br /&gt;
| Germany&lt;br /&gt;
| O2&lt;br /&gt;
| 0.9.6&lt;br /&gt;
| SIM&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Israel&lt;br /&gt;
| IL Orange&lt;br /&gt;
| 0.9.6&lt;br /&gt;
| USIM&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| Works perfect.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additional information:&lt;br /&gt;
http://report.yellowsn0w.com/&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Unlock 2.0]]&lt;br /&gt;
* [[X-Gold 608]]&lt;br /&gt;
* [[Baseband]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [http://chronic-dev.org/blog/2008/12/props/ Chronic Dev's post about Yellowsn0w]&lt;br /&gt;
* [http://blog.iphone-dev.org/post/65126957/tis-the-season-to-be-jolly Yellowsn0w Announcement]&lt;br /&gt;
* [http://qik.com/video/729275 MuscleNerd's Demo]&lt;br /&gt;
* [http://yellowsn0w.com Official Website]&lt;br /&gt;
&lt;br /&gt;
[[Category:Unlocking Methods]]&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=NCK_Brute_Force&amp;diff=3520</id>
		<title>NCK Brute Force</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=NCK_Brute_Force&amp;diff=3520"/>
		<updated>2009-04-14T17:08:28Z</updated>

		<summary type="html">&lt;p&gt;Expired-: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a theoretical exploit which involves brute forcing the NCK from the [[seczone]] the CHIPID and the NORID. So far no one has made public an instance of NCK discovery using this theortical approach.&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
gray, geohot&lt;br /&gt;
&lt;br /&gt;
==Feasibility==&lt;br /&gt;
Given that [[NCK]]s are 15 digits long, the keyspace is log(10^15)/log(2)~=2^50  This would be searchable if all the cryptography used was symmetric. But the algo is TEA(RSA(token), NCK+CHIPID+NORID) [[http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm TEA]]. So that inside [http://en.wikipedia.org/wiki/RSA RSA] has to be done. A modern machine can search the 8 digit keyspace in about 5 minutes, which means we need a couple orders of magnitude speed increase to consider 15 digit.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
[http://lpahome.com/nckbf/nckbf.rar Multithreaded NCK Brute Forcer]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;br /&gt;
[[Category:Unlocking Methods]]&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_Device&amp;diff=3519</id>
		<title>Baseband Device</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_Device&amp;diff=3519"/>
		<updated>2009-04-14T17:08:04Z</updated>

		<summary type="html">&lt;p&gt;Expired-: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the device in the iPhone that manages all the functions which require an antenna. The baseband processor has its own RAM and firmware in NOR flash, separate from the ARM core resources. The baseband is a resource to the OS. The Wi-Fi and bluetooth are managed by the main CPU, although the baseband stores their MAC addresses in it's NVRAM.&lt;br /&gt;
&lt;br /&gt;
The [[iPhone]]'s baseband processor is the [[S-Gold 2]] and the [[iPhone 3G]] makes use of the [[X-Gold 608]] chip for this purpose.&lt;br /&gt;
&lt;br /&gt;
You can check some [[Baseband Commands]] too (by pH and EvilPenguin)&lt;br /&gt;
&lt;br /&gt;
==Seczone==&lt;br /&gt;
This is the area in the baseband where the lock state is stored.&lt;br /&gt;
&lt;br /&gt;
===Layout===&lt;br /&gt;
 0x400--NCK token&lt;br /&gt;
 0xB00--IMEI&lt;br /&gt;
 0xB10--IMEI signature&lt;br /&gt;
 0xC00--Locks table&lt;br /&gt;
&lt;br /&gt;
===Encryption===&lt;br /&gt;
Many of the sections are encrypted using TEA based off the CHIPID and NORID. See [[NCK Brute Force]] for more info.&lt;br /&gt;
&lt;br /&gt;
==Exploits==&lt;br /&gt;
* [[SIM hacks]]&lt;br /&gt;
* [[Fakeblank|Hardware Fakeblank]]&lt;br /&gt;
* [[IPSF]]&lt;br /&gt;
* [[Minus 0x400]]&lt;br /&gt;
* [[Jerrysim]]&lt;br /&gt;
* [[Minus 0x20000 with Back Extend Erase]]&lt;br /&gt;
* [[yellowsn0w]]&lt;br /&gt;
&lt;br /&gt;
==Theoretical Attacks==&lt;br /&gt;
* [[NCK Brute Force]]&lt;br /&gt;
* [[Baseband JTAG]]&lt;br /&gt;
&lt;br /&gt;
==Boot Chain==&lt;br /&gt;
[[Baseband Bootrom|bootrom]]-&amp;gt;[[Baseband Bootloader|bootloader]]-&amp;gt;[[Baseband Firmware|firmware]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_Bootloader&amp;diff=3518</id>
		<title>Baseband Bootloader</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_Bootloader&amp;diff=3518"/>
		<updated>2009-04-14T17:07:43Z</updated>

		<summary type="html">&lt;p&gt;Expired-: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband bootloader is the code which runs before the baseband FW, it is responsible for signature checking and updating the baseband. See also [[bootloader]].&lt;br /&gt;
&lt;br /&gt;
==Revisions==&lt;br /&gt;
===3.9===&lt;br /&gt;
This is the old bootloader from the [[iPhone]]/[[S-Gold 2]]. It is vulnerable to [[Minus 0x400]] and [[IPSF]]&lt;br /&gt;
&lt;br /&gt;
===4.6===&lt;br /&gt;
This is the new bootloader from the [[iPhone]]/[[S-Gold 2]]. It is vulnerable to [[Minus 0x20000 with Back Extend Erase]]&lt;br /&gt;
&lt;br /&gt;
===5.8===&lt;br /&gt;
This is the bootloader from the [[iPhone 3G]]/[[X-Gold 608]]. It is, in contrast to 3.9 and 4.6, sig checked on startup. There is an exploit where the main fw cert is passed with the loader instead of the loader cert, and it checks the main firmware instead, allowing you to upload unsigned loader code. This has been fixed in 5.9. You can downgrade from 02.30.03 to 02.28.00 using [[pHaseBanDowngrader]] (by pH) in the Bootloader 5.8.&lt;br /&gt;
&lt;br /&gt;
DWD_ICE2_SECURE_BOOTLOADER/Secure_ICE2_Bootloader.5.8.fls.&lt;br /&gt;
&lt;br /&gt;
===5.9===&lt;br /&gt;
This is the bootloader of version 2.1 and 2.2 OTB (and some 2.0 OTB) [[iPhone 3G]]/[[X-Gold 608]]. Still has no known exploits and it was released as soon as Apple knew [[iPhone Dev Team]] could downgrade their iPhone 3G baseband from 1.48 to 1.45. Now, all the iPhone 3G has bootloader 5.9 and higher. &lt;br /&gt;
&lt;br /&gt;
DWD_ICE2_SECURE_BOOTLOADER/Secure_ICE2_Bootloader.5.9.fls&lt;br /&gt;
&lt;br /&gt;
===6.2===&lt;br /&gt;
This is the latest bootloader of version 2.2.1 OTB [[iPhone 3G]]/[[X-Gold 608]]. Still has no known exploits and it was released as soon as Apple knew [[iPhone Dev Team]] could unlock their iPhone 3G baseband version 2.28 by yellowsn0w. Now, all the iPhone 3G 2.2.1 OTB has bootloader 6.2. &lt;br /&gt;
&lt;br /&gt;
DWD_ICE2_SECURE_BOOTLOADER/Secure_ICE2_Bootloader.6.2.fls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=GenPass&amp;diff=3501</id>
		<title>GenPass</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=GenPass&amp;diff=3501"/>
		<updated>2009-04-14T00:00:47Z</updated>

		<summary type="html">&lt;p&gt;Expired-: Added category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
// genpass&lt;br /&gt;
// get asr key for 3.x firmware&lt;br /&gt;
//&lt;br /&gt;
// by posixninja, geohot, and chronic&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
#include &amp;lt;openssl/sha.h&amp;gt;&lt;br /&gt;
#include &amp;lt;openssl/evp.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define BUF_SIZE 0x100000&lt;br /&gt;
#define SHA256_DIGEST_LENGTH 32&lt;br /&gt;
&lt;br /&gt;
typedef unsigned char uint8;&lt;br /&gt;
typedef unsigned int uint32;&lt;br /&gt;
typedef unsigned long long uint64;&lt;br /&gt;
&lt;br /&gt;
uint64 u32_to_u64(uint32 msq, uint32 lsq) {&lt;br /&gt;
        uint64 ms = (uint64)msq;&lt;br /&gt;
        uint64 ls = (uint64)lsq;&lt;br /&gt;
        return ls | (ms &amp;lt;&amp;lt; 32);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint64 hash_platform(const char* platform) {&lt;br /&gt;
        uint8* md = malloc(SHA_DIGEST_LENGTH);&lt;br /&gt;
        SHA1(platform, strlen(platform), md);&lt;br /&gt;
        &lt;br /&gt;
        uint64 hash = u32_to_u64(&lt;br /&gt;
                                                         ((md[0] &amp;lt;&amp;lt; 24) | (md[1] &amp;lt;&amp;lt; 16) | (md[2] &amp;lt;&amp;lt; 8) | md[3]),&lt;br /&gt;
                                                         ((md[4] &amp;lt;&amp;lt; 24) | (md[5] &amp;lt;&amp;lt; 16) | (md[6] &amp;lt;&amp;lt; 8) | md[7])&lt;br /&gt;
                                                         );&lt;br /&gt;
        free(md);&lt;br /&gt;
        return hash;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint64 ramdisk_size(const char* ramdisk) {&lt;br /&gt;
        struct stat filestat;&lt;br /&gt;
        if(stat(ramdisk, &amp;amp;filestat) &amp;lt; 0) {&lt;br /&gt;
                return 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        return (uint64)filestat.st_size;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void keydump(uint8* passphrase,int l) {&lt;br /&gt;
        int i=0;&lt;br /&gt;
        for(i=0; i&amp;lt;l; i++) {&lt;br /&gt;
                printf(&amp;quot;%02x&amp;quot;, passphrase[i]);&lt;br /&gt;
        } printf(&amp;quot;\n&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int compare(const uint32* a, const uint32* b) {&lt;br /&gt;
        if(*a &amp;lt; *b) return -1;&lt;br /&gt;
        if(*a &amp;gt; *b) return 1;&lt;br /&gt;
        return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
const char platform[]=&amp;quot;s5l8900x&amp;quot;;&lt;br /&gt;
const char ramdisk[]=&amp;quot;ramdisk.dmg&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[]) {&lt;br /&gt;
        &lt;br /&gt;
        if(argc&amp;lt;3) {printf(&amp;quot;%s: &amp;lt;platform&amp;gt; &amp;lt;ramdisk&amp;gt; &amp;lt;main&amp;gt;\n&amp;quot;, argv[0]); return -1;}&lt;br /&gt;
        &lt;br /&gt;
        uint32 saltedHash[4];&lt;br /&gt;
        uint64 salt[4];&lt;br /&gt;
        &lt;br /&gt;
        salt[0] = 0xad79d29de5e2ac9e;&lt;br /&gt;
        salt[1] = 0xe6af2eb19e23925b;&lt;br /&gt;
        salt[2] = 0x3f1375b4bd88815c;&lt;br /&gt;
        salt[3] = 0x3bdff4e5564a9f87;&lt;br /&gt;
        &lt;br /&gt;
        FILE* fd = fopen(argv[2], &amp;quot;rb&amp;quot;);&lt;br /&gt;
        int i = 0;&lt;br /&gt;
        int x = 0;&lt;br /&gt;
        SHA256_CTX ctx;&lt;br /&gt;
        uint8* buffer = NULL;&lt;br /&gt;
        uint8* passphrase = NULL;&lt;br /&gt;
        uint64 totalSize = ramdisk_size(argv[2]);&lt;br /&gt;
        uint64 platformHash = hash_platform(argv[1]);&lt;br /&gt;
        &lt;br /&gt;
        /*printf(&amp;quot;size: %I64x  plat: %s  plathash %I64x\n&amp;quot;, totalSize,&lt;br /&gt;
         platform,platformHash);*/&lt;br /&gt;
        &lt;br /&gt;
        for(i=0;i&amp;lt;4;i++)&lt;br /&gt;
        {&lt;br /&gt;
                salt[i]+=platformHash;&lt;br /&gt;
                //printf(&amp;quot;%d: %I64x\n&amp;quot;, i, salt[i]);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        for(i = 0; i &amp;lt; 4; i++) {&lt;br /&gt;
                saltedHash[i] = ((uint32)(salt[i] % totalSize)) &amp;amp; 0xFFFFFE00;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        qsort(&amp;amp;saltedHash, 4, 4, &amp;amp;compare);&lt;br /&gt;
        &lt;br /&gt;
        SHA256_Init(&amp;amp;ctx);&lt;br /&gt;
        SHA256_Update(&amp;amp;ctx, salt, 32);&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        int r=0;&lt;br /&gt;
        i=0;    //hash count&lt;br /&gt;
        &lt;br /&gt;
        buffer = malloc(BUF_SIZE);&lt;br /&gt;
        passphrase = malloc(SHA256_DIGEST_LENGTH);&lt;br /&gt;
        &lt;br /&gt;
        while(r&amp;lt;totalSize) {&lt;br /&gt;
                x = fread(buffer, 1, BUF_SIZE, fd);&lt;br /&gt;
                SHA256_Update(&amp;amp;ctx, buffer, x);&lt;br /&gt;
                &lt;br /&gt;
                if(i&amp;lt;4)         //some salts remain&lt;br /&gt;
                {&lt;br /&gt;
                        if(r &amp;gt;= (saltedHash[i]+0x4000)) i++;&lt;br /&gt;
                        else if(  r &amp;lt; saltedHash[i] &amp;amp;&amp;amp; saltedHash[i] &amp;lt; (r+x) )&lt;br /&gt;
                        {&lt;br /&gt;
                                if( (saltedHash[i]+0x4000) &amp;lt; r ) &lt;br /&gt;
                                        SHA256_Update(&amp;amp;ctx, buffer, saltedHash[i]-r);&lt;br /&gt;
                                else SHA256_Update(&amp;amp;ctx, buffer+(saltedHash[i]-r), &lt;br /&gt;
                                                                   ( (x-(saltedHash[i]-r))&amp;lt;0x4000) ? (x-(saltedHash[i]-r)) : 0x4000 );&lt;br /&gt;
                        }&lt;br /&gt;
                }&lt;br /&gt;
                r+=x;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        fclose(fd);&lt;br /&gt;
        &lt;br /&gt;
        SHA256_Final(passphrase, &amp;amp;ctx);&lt;br /&gt;
        printf(&amp;quot;passphrase: &amp;quot;);&lt;br /&gt;
        keydump(passphrase, SHA256_DIGEST_LENGTH);&lt;br /&gt;
        &lt;br /&gt;
        if(buffer) free(buffer);&lt;br /&gt;
        &lt;br /&gt;
        if(argc==4)             //do main as well&lt;br /&gt;
        {&lt;br /&gt;
                fd=fopen(argv[3],&amp;quot;rb&amp;quot;);&lt;br /&gt;
                EVP_CIPHER_CTX ctx;&lt;br /&gt;
                &lt;br /&gt;
                int offset=0x1D4;&lt;br /&gt;
                uint8 data[0x30];&lt;br /&gt;
                uint8 out[0x30]; int outlen,tmplen;&lt;br /&gt;
                int a;&lt;br /&gt;
                for(a=0;a&amp;lt;7;a++)&lt;br /&gt;
                {&lt;br /&gt;
                        fseek(fd, offset, SEEK_SET); offset+=0x268;&lt;br /&gt;
                        fread(data, 1, 0x30, fd);&lt;br /&gt;
                        EVP_CIPHER_CTX_init(&amp;amp;ctx);&lt;br /&gt;
                        EVP_DecryptInit_ex(&amp;amp;ctx, EVP_des_ede3_cbc(),&lt;br /&gt;
                                                           NULL, passphrase, &amp;amp;passphrase[24]);&lt;br /&gt;
                        EVP_DecryptUpdate(&amp;amp;ctx, out, &amp;amp;outlen, data, 0x30);&lt;br /&gt;
                        if(!EVP_DecryptFinal_ex(&amp;amp;ctx, out + outlen, &amp;amp;tmplen))&lt;br /&gt;
                                printf(&amp;quot;not block %d\n&amp;quot;, a);&lt;br /&gt;
                        else&lt;br /&gt;
                                break;&lt;br /&gt;
                }&lt;br /&gt;
                printf(&amp;quot;vfdecryptk: &amp;quot;);&lt;br /&gt;
                keydump(out, 0x24);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if(passphrase) free(passphrase);&lt;br /&gt;
        &lt;br /&gt;
        return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:VFDecrypt]]&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Firmware_Keys&amp;diff=3497</id>
		<title>Firmware Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Firmware_Keys&amp;diff=3497"/>
		<updated>2009-04-13T23:59:30Z</updated>

		<summary type="html">&lt;p&gt;Expired-: Added category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
These keys are for use with the 'vfdecrypt' tool to decrypt the main filesystem DMG found in every iPhone/iPhone 3G/iPod touch .ipsw file. Every key will work on the main filesystem DMG for that build, regardless if it is for the iPhone or iPod touch unless specified. The DMG that you are after is the bigger one, in the case of current builds of 2.0, it can sometimes be 200+ MB!&lt;br /&gt;
&lt;br /&gt;
== VFDecrypt Usage ==&lt;br /&gt;
 ./vfdecrypt -i &amp;lt;dmg&amp;gt; -o decrypted_fs.dmg -k &amp;lt;key&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gaps ==&lt;br /&gt;
As you will notice, there may be a gap or two, or a key for a current build that is not there. Please feel free to add them, but please be sure that it is only the key for a User or Developer build, as if you gave the key for another type of build that might or may not be out there '''people could get in trouble, and we do not want that'''. Thanks for contributing!&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
* http://rgov.org/files/vfdecrypt-mac.zip (Mac OS X Universal)&lt;br /&gt;
* http://iphoneelite.googlecode.com/files/vfdecrypt.zip (Windows)&lt;br /&gt;
&lt;br /&gt;
* Source Credit: http://lorenzo.yellowspace.net/corrupt-sparseimage.html&lt;br /&gt;
&lt;br /&gt;
== Firmwares ==&lt;br /&gt;
* [[VFDecrypt Keys: 1.x|1.x]]&lt;br /&gt;
* [[VFDecrypt Keys: 2.x|2.x]]&lt;br /&gt;
* [[VFDecrypt Keys: 3.x|3.x]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[System]] - a page with links to download the firmware images&lt;br /&gt;
&lt;br /&gt;
[[Category:VFDecrypt]]&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_Commands&amp;diff=3454</id>
		<title>Baseband Commands</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_Commands&amp;diff=3454"/>
		<updated>2009-04-12T20:30:40Z</updated>

		<summary type="html">&lt;p&gt;Expired-: /* Running Minicom 2.2 from MobileTerminal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About==&lt;br /&gt;
In this page, you'll find some Baseband Commands. You can use them with Minicom 2.2, that can be found on Cydia.&lt;br /&gt;
&lt;br /&gt;
==Setting up Minicom 2.2==&lt;br /&gt;
# After installing Minicom from Cydia, make sure the folder /usr/etc exists. SSH into your iPhone and then, type: ''minicom -s''.&lt;br /&gt;
# Now, select ''Serial Port Setup'' in the Menu and press Enter. Then, press &amp;quot;a&amp;quot; and set Serial Device to ''/dev/tty.debug''.&lt;br /&gt;
# Press Esc, and in the Main Menu, select ''Save setup as dfl''. Now, select &amp;quot;exit&amp;quot;.&lt;br /&gt;
# To run minicom using ssh, just run minicom -w&lt;br /&gt;
&lt;br /&gt;
==Running Minicom 2.2 from MobileTerminal==&lt;br /&gt;
'''Note''': minicom does work on MobileTerminal only on root (use su) and only after it has been configured (through the steps above).&lt;br /&gt;
# Open MobileTerminal.&lt;br /&gt;
# Run the command su, enter your root password (default alpine) and then run minicom -w.&lt;br /&gt;
# To exit minicom, slide your finger on the screen (&amp;quot;gesture&amp;quot;) to the bottom right (if you haven't changed this setting in MobileTerminal settings), then press A, X and enter.&lt;br /&gt;
&lt;br /&gt;
==How to run Baseband Commands==&lt;br /&gt;
&lt;br /&gt;
Here is the list that me (pH) and EvilPenguin are doing of Baseband Commands. &lt;br /&gt;
&lt;br /&gt;
First, run Minicom. Then, type &amp;quot;at&amp;quot; and press Enter. Then, you can type the command that you want, have fun.&lt;br /&gt;
&lt;br /&gt;
==Baseband Commands==&lt;br /&gt;
===Getting Information===&lt;br /&gt;
* '''at+xgendata''': Display some baseband informations&lt;br /&gt;
* '''at&amp;amp;v''': Display the profiles in the Baseband (Active Profile, Stored Profile 0 and Stored Profile 1)&lt;br /&gt;
* '''at+clac''': Show some baseband commands&lt;br /&gt;
* '''at&amp;amp;h''': Show more Baseband Commands&lt;br /&gt;
&lt;br /&gt;
===Unlock===&lt;br /&gt;
* '''at+clck''': Traditional unlock command&lt;br /&gt;
* '''at+xlock''': Wildcard unlock&lt;br /&gt;
* '''at+xsimstate''': Print lock state (write at+xsimstate=1 to turn on, at+xsimstate=0 to turn off)&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_Commands&amp;diff=3437</id>
		<title>Baseband Commands</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_Commands&amp;diff=3437"/>
		<updated>2009-04-12T01:31:47Z</updated>

		<summary type="html">&lt;p&gt;Expired-: /* Baseband Commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About==&lt;br /&gt;
In this page, you'll find some Baseband Commands. You can use them with Minicom 2.2, that can be found on Cydia.&lt;br /&gt;
&lt;br /&gt;
==Setting up Minicom 2.2==&lt;br /&gt;
# After installing Minicom from Cydia, make sure the folder /usr/etc exists. SSH into your iPhone and then, type: ''minicom -s''.&lt;br /&gt;
# Now, select ''Serial Port Setup'' in the Menu and press Enter. Then, press &amp;quot;a&amp;quot; and set Serial Device to ''/dev/tty.debug''.&lt;br /&gt;
# Press Esc, and in the Main Menu, select ''Save setup as dfl''. Now, select &amp;quot;exit&amp;quot;.&lt;br /&gt;
#* '''Note''': minicom does work on MobileTerminal only on root (use su) and only after it has been configured.&lt;br /&gt;
# Run the command su, enter your root password (default alpine) and then run minicom -w.&lt;br /&gt;
# To exit minicom, slide your finger on the screen (&amp;quot;gesture&amp;quot;) to the bottom right (if you haven't changed this setting in MobileTerminal settings), then press A, X and enter.&lt;br /&gt;
&lt;br /&gt;
==Running Minicom==&lt;br /&gt;
To run minicom, is pretty simple: just type &amp;quot;minicom -w&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==How to run Baseband Commands==&lt;br /&gt;
&lt;br /&gt;
Here is the list that me (pH) and EvilPenguin are doing of Baseband Commands. &lt;br /&gt;
&lt;br /&gt;
First, run Minicom. Then, type &amp;quot;at&amp;quot; and press Enter. Then, you can type the command that you want, have fun.&lt;br /&gt;
&lt;br /&gt;
==Baseband Commands==&lt;br /&gt;
===Getting Information===&lt;br /&gt;
* '''at+xgendata''': Display some baseband informations&lt;br /&gt;
* '''at&amp;amp;v''': Display the profiles in the Baseband (Active Profile, Stored Profile 0 and Stored Profile 1)&lt;br /&gt;
* '''at+clac''': Show some baseband commands&lt;br /&gt;
* '''at&amp;amp;h''': Show more Baseband Commands&lt;br /&gt;
&lt;br /&gt;
===Unlock===&lt;br /&gt;
* '''at+clck''': Traditional unlock command&lt;br /&gt;
* '''at+xlock''': Wildcard unlock&lt;br /&gt;
* '''at+xsimstate''': Print lock state (write at+xsimstate=1 to turn on, at+xsimstate=0 to turn off)&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_Commands&amp;diff=3436</id>
		<title>Baseband Commands</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_Commands&amp;diff=3436"/>
		<updated>2009-04-12T01:30:34Z</updated>

		<summary type="html">&lt;p&gt;Expired-: /* Setting up Minicom 2.2 */ - reformatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About==&lt;br /&gt;
In this page, you'll find some Baseband Commands. You can use them with Minicom 2.2, that can be found on Cydia.&lt;br /&gt;
&lt;br /&gt;
==Setting up Minicom 2.2==&lt;br /&gt;
# After installing Minicom from Cydia, make sure the folder /usr/etc exists. SSH into your iPhone and then, type: ''minicom -s''.&lt;br /&gt;
# Now, select ''Serial Port Setup'' in the Menu and press Enter. Then, press &amp;quot;a&amp;quot; and set Serial Device to ''/dev/tty.debug''.&lt;br /&gt;
# Press Esc, and in the Main Menu, select ''Save setup as dfl''. Now, select &amp;quot;exit&amp;quot;.&lt;br /&gt;
#* '''Note''': minicom does work on MobileTerminal only on root (use su) and only after it has been configured.&lt;br /&gt;
# Run the command su, enter your root password (default alpine) and then run minicom -w.&lt;br /&gt;
# To exit minicom, slide your finger on the screen (&amp;quot;gesture&amp;quot;) to the bottom right (if you haven't changed this setting in MobileTerminal settings), then press A, X and enter.&lt;br /&gt;
&lt;br /&gt;
==Running Minicom==&lt;br /&gt;
To run minicom, is pretty simple: just type &amp;quot;minicom -w&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==How to run Baseband Commands==&lt;br /&gt;
&lt;br /&gt;
Here is the list that me (pH) and EvilPenguin are doing of Baseband Commands. &lt;br /&gt;
&lt;br /&gt;
First, run Minicom. Then, type &amp;quot;at&amp;quot; and press Enter. Then, you can type the command that you want, have fun.&lt;br /&gt;
&lt;br /&gt;
==Baseband Commands==&lt;br /&gt;
===Getting Information===&lt;br /&gt;
'''at+xgendata''': Display some baseband informations&lt;br /&gt;
&lt;br /&gt;
'''at&amp;amp;v''': Display the profiles in the Baseband (Active Profile, Stored Profile 0 and Stored Profile 1)&lt;br /&gt;
&lt;br /&gt;
'''at+clac''': Show some baseband commands&lt;br /&gt;
&lt;br /&gt;
'''at&amp;amp;h''': Show more Baseband Commands&lt;br /&gt;
&lt;br /&gt;
===Unlock===&lt;br /&gt;
'''at+clck''': Traditional unlock command&lt;br /&gt;
&lt;br /&gt;
'''at+xlock''': Wildcard unlock&lt;br /&gt;
&lt;br /&gt;
'''at+xsimstate''': Print lock state (write at+xsimstate=1 to turn on, at+xsimstate=0 to turn off)&lt;/div&gt;</summary>
		<author><name>Expired-</name></author>
		
	</entry>
</feed>