-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathipsw_unzip.txt
193 lines (147 loc) · 7.19 KB
/
ipsw_unzip.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
echo Extracting IPSW...
7z.exe x -oIPSW "iPod2,1_3.1.2_7D11_Restore.ipsw"
echo Done Extracting IPSW...
echo Patching Kernel...
bspatch "IPSW/kernelcache.release.s5l8720x" "IPSW/kernel.patched" "8720.patch"
cd IPSW
DEL kernelcache.release.s5l8720x
RENAME kernel.patched kernelcache.release.s5l8720x
echo Done Patching Kernel...
echo Decrypting RootFS...
rename "018-6133-014.dmg" "018-6133-014.dmg.orig"
cd ..
dmg.exe extract "IPSW/018-6133-014.dmg.orig" "IPSW/DECRYPTED.dmg" -k FC68C25F1DCC929F37C2BE82B94E4C92B48EAC3DDD67ADEFD462404663265E3DCA43A930
echo Done Decrypting...
echo Extracting FSTAB...
hfsplus.exe "IPSW/DECRYPTED.dmg" extract /private/etc/fstab fstab.original
echo Done Extracting FSTAB...
echo Patching FSTAB...
bspatch "fstab.original" "fstab" fstab.patch
echo Done Patching FSTAB...
echo Uploading Patched FSTAB...
hfsplus.exe "IPSW/DECRYPTED.dmg" add fstab /private/etc/fstab
echo Done Uploading Patched FSTAB...
echo Extracting Services...
hfsplus.exe "IPSW/DECRYPTED.dmg" extract System/Library/Lockdown/Services.plist Services.plist.orig
echo Done Extracting Services...
echo Patching Services...
bspatch Services.plist.orig Services.plist Services.patch
echo Done Patching Services...
echo Uploading Patched Services...
hfsplus.exe "IPSW/DECRYPTED.dmg" add Services.plist System/Library/Lockdown/Services.plist
echo Done Uploading Patched Services...
echo Adding LockBackground...
hfsplus.exe "IPSW/DECRYPTED.dmg" add LockBackground.jpg private/var/mobile/Library/LockBackground.jpg
echo Done Adding LockBackground...
echo Uploading PWNED Kernel...
hfsplus.exe "IPSW/DECRYPTED.dmg" add "IPSW/kernelcache.release.s5l8720x" System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8720x
echo Done Uploading PWNED Kernel...
echo Rebuilding with Read-Only Access...
dmg.exe build "IPSW/DECRYPTED.dmg" "IPSW/018-6133-014.dmg"
echo Done Building RootFS!
echo Decrypting Ramdisk...
cd IPSW
RENAME 018-6141-014.dmg 018-6141-014.dmg.orig
cd ..
xpwntool "IPSW/018-6141-014.dmg.orig" "IPSW/ramdisk_decrypted.dmg" -iv f37bd3f9597c1acba87bfd4029a08ff9 -K de0e35e16213e69cb9c19dc527d9a96c
echo Done Decrypting Ramdisk...
echo Freeing Space on Ramdisk...
hfsplus.exe "IPSW/ramdisk_decrypted.dmg" rm /usr/local/share/restore/PASS.png
echo Done Freeing Space on Ramdisk...
echo Extracting ASR...
hfsplus.exe "IPSW/ramdisk_decrypted.dmg" extract /usr/sbin/asr asr.orig
echo Done Extracting ASR...
echo Patching ASR...
bspatch asr.orig asr asr.patch
echo Done Patching ASR...
echo Uploading Patched ASR...
hfsplus.exe "IPSW/ramdisk_decrypted.dmg" add asr /usr/sbin/asr
echo Done Uploading Patched ASR...
echo Uploading options.plist...
hfsplus.exe "IPSW/ramdisk_decrypted.dmg" add options.plist /usr/local/share/restore/options.plist
echo Done Uploading options.plist...
echo Re-Encrypting Ramdisk...
xpwntool.exe "IPSW/ramdisk_decrypted.dmg" "IPSW/018-6141-014.dmg" -t "IPSW/018-6141-014.dmg.orig"
cd IPSW
DEL 018-6141-014.dmg.orig
cd ..
echo Done Ramdisk...
echo Decrypting iBSS...
cd IPSW/Firmware/dfu
RENAME iBSS.n72ap.RELEASE.dfu iBSS.n72ap.RELEASE.dfu.orig
cd ../../..
xpwntool.exe "IPSW/Firmware/dfu/iBSS.n72ap.RELEASE.dfu.orig" "IPSW/Firmware/dfu/iBSS.n72ap.RELEASE.dfu.decrypted" -iv 083528a985c2e3f90f8324e1e9dce4e4 -k c7af1cfc980b24e2464b70310e2b1713
echo Done Decrypting iBSS...
echo Patching iBSS...
bspatch.exe "IPSW/Firmware/dfu/iBSS.n72ap.RELEASE.dfu.decrypted" "IPSW/Firmware/dfu/iBSS.n72ap.RELEASE.dfu.patched" iBSS.n72ap.RELEASE.patch
xpwntool.exe "IPSW/Firmware/dfu/iBSS.n72ap.RELEASE.dfu.patched" "IPSW/Firmware/dfu/iBSS.n72ap.RELEASE.dfu" -t "IPSW/Firmware/dfu/iBSS.n72ap.RELEASE.dfu.orig"
cd IPSW/Firmware/dfu
DEL iBSS.n72ap.RELEASE.dfu.patched
DEL iBSS.n72ap.RELEASE.dfu.decrypted
DEL iBSS.n72ap.RELEASE.dfu.orig
cd ../../..
echo Done Patching iBSS...
echo Decrypting iBEC...
cd IPSW/Firmware/dfu
RENAME iBEC.n72ap.RELEASE.dfu iBEC.n72ap.RELEASE.dfu.orig
cd ../../..
xpwntool.exe "IPSW/Firmware/dfu/iBEC.n72ap.RELEASE.dfu.orig" "IPSW/Firmware/dfu/iBEC.n72ap.RELEASE.dfu.decrypted" -iv 0551d6bca63f6e458d65d0e308a4a676 -k a2f0497c17e7181705c002f1b1c8edcf
echo Done Decrypting iBEC...
echo Patching iBEC...
bspatch.exe "IPSW/Firmware/dfu/iBEC.n72ap.RELEASE.dfu.decrypted" "IPSW/Firmware/dfu/iBEC.n72ap.RELEASE.dfu.patched" iBEC.n72ap.RELEASE.patch
xpwntool.exe "IPSW/Firmware/dfu/iBEC.n72ap.RELEASE.dfu.patched" "IPSW/Firmware/dfu/iBEC.n72ap.RELEASE.dfu" -t "IPSW/Firmware/dfu/iBEC.n72ap.RELEASE.dfu.orig"
cd IPSW/Firmware/dfu
DEL iBEC.n72ap.RELEASE.dfu.patched
DEL iBEC.n72ap.RELEASE.dfu.decrypted
DEL iBEC.n72ap.RELEASE.dfu.orig
cd ../../..
echo Done Patching iBEC...
echo Applying Custom Logo...
cd "IPSW/Firmware/all_flash/all_flash.n72ap.production"
RENAME applelogo.s5l8720x.img3 applelogo.s5l8720x.img3.orig
cd ../../../..
xpwntool.exe "IPSW/Firmware/all_flash/all_flash.n72ap.production/applelogo.s5l8720x.img3.orig" "IPSW/Firmware/all_flash/all_flash.n72ap.production/applelogo.s5l8720x.img3.decrypted" -iv fb91437b42eff2bc7c41366a1a97537f -k 99d6958cca282856f8b2c38aa429d7f7 -decrypt
imagetool inject sn0wflak3.png "IPSW/Firmware/all_flash/all_flash.n72ap.production/applelogo.s5l8720x.img3" "IPSW/Firmware/all_flash/all_flash.n72ap.production/applelogo.s5l8720x.img3.decrypted"
cd "IPSW/Firmware/all_flash/all_flash.n72ap.production"
DEL applelogo.s5l8720x.img3.orig
DEL applelogo.s5l8720x.img3.decrypted
echo Done Applying Custom Logo...
echo Patching LLB...
cd "IPSW/Firmware/all_flash/all_flash.n72ap.production"
RENAME LLB.n72ap.RELEASE.img3 LLB.n72ap.RELEASE.img3.orig
cd ../../../..
bspatch.exe "IPSW/Firmware/all_flash/all_flash.n72ap.production/LLB.n72ap.RELEASE.img3.orig" "IPSW/Firmware/all_flash/all_flash.n72ap.production/LLB.n72ap.RELEASE.img3" LLB.n72ap.RELEASE.patch
cd "IPSW/Firmware/all_flash/all_flash.n72ap.production"
DEL LLB.n72ap.RELEASE.img3.orig
cd ../../../..
echo Done Patching LLB...
echo Patching iBoot...
cd "IPSW/Firmware/all_flash/all_flash.n72ap.production"
RENAME iBoot.n72ap.RELEASE.img3 iBoot.n72ap.RELEASE.img3.orig
cd ../../../..
xpwntool.exe "IPSW/Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3.orig" "IPSW/Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3.decrypted" -iv 5e421f8ce8c811311bbbb8a734ec07ce -k 191b6846543d7026b6f0d5247f030588
bspatch.exe "IPSW/Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3.decrypted""IPSW/Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3.patched" iBoot.n72ap.RELEASE.patch
xpwntool.exe "IPSW/Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3.patched" "IPSW/Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3" -t "IPSW/Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3.orig"
cd "IPSW/Firmware/all_flash/all_flash.n72ap.production"
DEL iBoot.n72ap.RELEASE.img3.orig
DEL iBoot.n72ap.RELEASE.img3.decrypted
DEL iBoot.n72ap.RELEASE.img3.patched
cd ../../../..
echo Done Patching iBoot...
echo Deleting Unrequired Files...
cd IPSW
DEL BuildManifest.plist
DEL 018-6142-014.dmg
cd ..
echo Done Deleting unrequired Files...
echo Zipping IPSW...
COPY 7z.exe "IPSW/7z.exe
cd IPSW
7z.exe u -tzip -mx0 sn0wbreeze.ipsw -x!7z.exe
MOVE sn0wbreeze.ipsw ../
echo Done Zipping IPSW...
echo Cleaning Up...
rmdir /S /Q IPSW
echo Done Cleaning Up...
echo CJ Fail0rz.
pause