This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
macPixelClockPatcher.command
executable file
·191 lines (134 loc) · 8.57 KB
/
macPixelClockPatcher.command
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#!/bin/bash
iokit_md5_current="$(md5 -q /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit)"
nvda_md5_current="$(md5 -q /System/Library/Extensions/NVDAGK100Hal.kext/Contents/MacOS/NVDAGK100Hal)"
amd_md5_current="$(md5 -q /System/Library/Extensions/AMDSupport.kext/Contents/MacOS/AMDSupport)"
iokit_md5_10_7_4=b1e6fb797d7d3470acabe7c06e6c139e
iokit_md5_10_7_5=0176a6d9a7c3b8c39bb06785fcdfca6d
iokit_md5_10_8_3=9bf853999cff6ee4158d3fa2acc0ce7c
iokit_md5_10_8_4=233a4256b845b647b151739c87070695
iokit_md5_10_8_5_12F45=5d69bf9227997dfad5e48fa87bd14598
iokit_md5_10_9_1=d085445f30410008593a65ef4b5f9889
iokit_md5_10_9_2=9804392bbe8ba4b589175be56889c6c7
iokit_md5_10_10_beta=62195c9c8a2ddcf34b70d872afbd2835
iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed
iokit_md5_10_7_5_patched=b5b15d1ed5a404962bc7de895a0df56a
iokit_md5_10_8_3_patched=289039239535c91146518c64aea5907b
iokit_md5_10_8_4_patched=8c70a0ca62bf65e9ffa8667e2871c287
iokit_md5_10_8_5_12F45_patched=de3ad8279077c675ae8093193deb253f
iokit_md5_10_9_1_patched=0962001659a2031c2425206d9239bda4
iokit_md5_10_9_2_patched=45d8fc0e1210f0672297a7716478990e
iokit_md5_10_10_beta_patched=a1f6bdb69ac043f8ed3e3c86415b9b20
nvda_md5_10_8_3=6a2d5017b6ddd3d19de2f4039d4c88ec
nvda_md5_10_8_4=b553fd25b25d2262317e9de758888d2b
nvda_md5_10_8_5_12F45=f84d891f1a67aa278453be59a6e1fece
nvda_md5_10_9_1=6de28959ec948513c239b1bf31205465
nvda_md5_10_8_3_patched=7e8372fca35c5e7db90a229e70709d58
nvda_md5_10_8_4_patched=3c552ba24fa89b2ea892dd711088e8d5
nvda_md5_10_8_5_12F45_patched=5e65da83006468e8a69ef60a180ea08d
nvda_md5_10_9_1_patched=bbb0885323ea3221150839782fbd553f
amd_md5_10_9_1=693bffd29de3e5af0f49ae02f9d6a319
amd_md5_10_9_1_patched=874caed6a4abf8e596e43400a624ca79
if [ "$iokit_md5_current" = "$iokit_md5_10_7_4_patched" ]; then
echo "Detected patched IOKit on 10.7.4, no action taken."
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_7_5_patched" ]; then
echo "Detected patched IOKit on 10.7.5, no action taken."
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_8_3_patched" ]; then
echo "Detected patched IOKit on 10.8.3, no action taken."
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_8_4_patched" ]; then
echo "Detected patched IOKit on 10.8.4, no action taken."
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_8_5_12F45_patched" ]; then
echo "Detected patched IOKit on 10.8.5, no action taken."
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_9_1_patched" ]; then
echo "Detected patched IOKit on 10.9.1, no action taken."
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_9_2_patched" ]; then
echo "Detected patched IOKit on 10.9.2, no action taken."
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_10_beta_patched" ]; then
echo "Detected patched IOKit on 10.10 beta, no action taken."
fi
if [ "$nvda_md5_current" = "$nvda_md5_10_8_3_patched" ]; then
echo "Detected patched NVIDIA driver on 10.8.3, no action taken."
fi
if [ "$nvda_md5_current" = "$nvda_md5_10_8_4_patched" ]; then
echo "Detected patched NVIDIA driver on 10.8.4, no action taken."
fi
if [ "$nvda_md5_current" = "$nvda_md5_10_8_5_12F45_patched" ]; then
echo "Detected patched NVIDIA driver on 10.8.5, no action taken."
fi
if [ "$nvda_md5_current" = "$nvda_md5_10_9_1_patched" ]; then
echo "Detected patched NVIDIA driver on 10.9.1, no action taken."
fi
if [ "$amd_md5_current" = "$amd_md5_10_9_1_patched" ]; then
echo "Detected patched AMD Driver on 10.9.1, no action taken."
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_7_4" ]; then
echo "Detected unpatched IOKit on 10.7.4, patching."
sudo perl -i.bak -pe '$before = qr"\xF6\xC1\x01\x74\x0A"s;s/$before/\xE9\x71\x03\x00\x00/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
sudo touch /System/Library/Extensions
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_7_5" ]; then
echo "Detected unpatched IOKit on 10.7.5, patching."
sudo perl -i.bak -pe '$before = qr"\xF6\xC1\x01\x74\x0A"s;s/$before/\xE9\x71\x03\x00\x00/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
sudo touch /System/Library/Extensions
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_8_3" ]; then
echo "Detected unpatched IOKit on 10.8.3, patching."
sudo perl -i.bak -pe '$before = qr"\x0F\x85\xDE\x03\x00\x00"s;s/$before/\xE9\xC5\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
sudo touch /System/Library/Extensions
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_8_4" ]; then
echo "Detected unpatched IOKit on 10.8.4, patching."
sudo perl -i.bak -pe '$before = qr"\x0F\x85\xDE\x03\x00\x00"s;s/$before/\xE9\xC5\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
sudo touch /System/Library/Extensions
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_8_5_12F45" ]; then
echo "Detected unpatched IOKit on 10.8.5, patching."
sudo perl -i.bak -pe '$before = qr"\x0F\x85\xDE\x03\x00\x00"s;s/$before/\xE9\xC5\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
sudo touch /System/Library/Extensions
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_9_1" ]; then
echo "Detected unpatched IOKit on 10.9.1, patching."
sudo perl -i.bak -pe '$before = qr"\x0F\x85\x9D\x03\x00\x00"s;s/$before/\xE9\x84\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
sudo touch /System/Library/Extensions
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_9_2" ]; then
echo "Detected unpatched IOKit on 10.9.2, patching."
sudo perl -i.bak -pe '$before = qr"\x0F\x85\x9D\x03\x00\x00"s;s/$before/\xE9\x84\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
sudo touch /System/Library/Extensions
fi
if [ "$iokit_md5_current" = "$iokit_md5_10_10_beta" ]; then
echo "Detected unpatched IOKit on 10.10 beta, patching."
sudo perl -i.bak -pe '$before = qr"\x0F\x85\x9E\x03\x00\x00"s;s/$before/\xE9\x83\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
sudo touch /System/Library/Extensions
fi
if [ "$nvda_md5_current" = "$nvda_md5_10_8_3" ]; then
echo "Detected unpatched NVIDIA driver on 10.8.3, patching."
sudo perl -i.bak -pe '$oldLimit1 = qr"\xC7\x82\xC8\x00\x00\x00\x88\x84\x02\x00"s;$newLimit1 = "\xC7\x82\xC8\x00\x00\x00\x80\x1A\x06\x00";$oldLimit2 = qr"\xC7\x82\x10\x01\x00\x00\x88\x84\x02\x00"s;$newLimit2 = "\xC7\x82\x10\x01\x00\x00\x80\x1A\x06\x00";s/$oldLimit1/$newLimit1/g;s/$oldLimit2/$newLimit2/g' /System/Library/Extensions/NVDAGK100Hal.kext/Contents/MacOS/NVDAGK100Hal
sudo touch /System/Library/Extensions
fi
if [ "$nvda_md5_current" = "$nvda_md5_10_8_4" ]; then
echo "Detected unpatched NVIDIA driver on 10.8.4, patching."
sudo perl -i.bak -pe '$oldLimit1 = qr"\xC7\x82\xD0\x00\x00\x00\x88\x84\x02\x00"s;$newLimit1 = "\xC7\x82\xD0\x00\x00\x00\x80\x1A\x06\x00";$oldLimit2 = qr"\xC7\x82\x20\x01\x00\x00\x88\x84\x02\x00"s;$newLimit2 = "\xC7\x82\x20\x01\x00\x00\x80\x1A\x06\x00";s/$oldLimit1/$newLimit1/g;s/$oldLimit2/$newLimit2/g' /System/Library/Extensions/NVDAGK100Hal.kext/Contents/MacOS/NVDAGK100Hal
sudo touch /System/Library/Extensions
fi
if [ "$nvda_md5_current" = "$nvda_md5_10_8_5_12F45" ]; then
echo "Detected unpatched NVIDIA driver on 10.8.5, patching."
sudo perl -i.bak -pe '$oldLimit1 = qr"\xC7\x82\xD0\x00\x00\x00\x88\x84\x02\x00"s;$newLimit1 = "\xC7\x82\xD0\x00\x00\x00\x80\x1A\x06\x00";$oldLimit2 = qr"\xC7\x82\x20\x01\x00\x00\x88\x84\x02\x00"s;$newLimit2 = "\xC7\x82\x20\x01\x00\x00\x80\x1A\x06\x00";s/$oldLimit1/$newLimit1/g;s/$oldLimit2/$newLimit2/g' /System/Library/Extensions/NVDAGK100Hal.kext/Contents/MacOS/NVDAGK100Hal
sudo touch /System/Library/Extensions
fi
if [ "$nvda_md5_current" = "$nvda_md5_10_9_1" ]; then
echo "Detected unpatched NVIDIA driver on 10.8.4, patching."
sudo perl -i.bak -pe '$oldLimit1 = qr"\xC7\x82\xD0\x00\x00\x00\x88\x84\x02\x00"s;$newLimit1 = "\xC7\x82\xD0\x00\x00\x00\x80\x1A\x06\x00";$oldLimit2 = qr"\xC7\x82\x20\x01\x00\x00\x88\x84\x02\x00"s;$newLimit2 = "\xC7\x82\x20\x01\x00\x00\x80\x1A\x06\x00";s/$oldLimit1/$newLimit1/g;s/$oldLimit2/$newLimit2/g' /System/Library/Extensions/NVDAGK100Hal.kext/Contents/MacOS/NVDAGK100Hal
sudo touch /System/Library/Extensions
fi
if [ "$amd_md5_current" = "$amd_md5_10_9_1" ]; then
echo "Detected unpatched AMD driver on 10.9.1, patching."
sudo perl -i.bak -pe '$oldLimit1 = qr"\x75\x0C\x49\x81\x7E\x28\x40\xB3\xD5\x09"s;$newLimit1 = "\x75\x0C\x49\x81\x7E\x28\x00\x84\xD7\x17";$oldLimit2 = qr"\xFF\xFF\x48\x81\x7D\x80\x41\xB3\xD5\x09"s;$newLimit2 = "\xFF\xFF\x48\x81\x7D\x80\x01\x84\xD7\x17";s/$oldLimit1/$newLimit1/g;s/$oldLimit2/$newLimit2/g' /System/Library/Extensions/AMDSupport.kext/Contents/MacOS/AMDSupport
sudo touch /System/Library/Extensions
fi