From 64e9b8d6139bc664dad88cbe39fa4ea5cdea8e0b Mon Sep 17 00:00:00 2001 From: Floris497 Date: Mon, 6 Oct 2014 20:13:25 +0200 Subject: [PATCH 01/23] Added some 10.10 beta's --- macPixelClockPatcher.command | 162 +++++++++++++++++++++++++++++++++-- 1 file changed, 154 insertions(+), 8 deletions(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 5227989..01cbb88 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -10,7 +10,11 @@ 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_9_3=9a86b6708569360f3156b53cc4f205d9 +iokit_md5_10_9_4=6105cc8f503b589f8b3ce2d3917ad150 +iokit_md5_10_10_BETA_8=1fe4ef08632ca0e685beb622330ec027 +iokit_md5_10_10_BETA_4A379a=440d2f2e11286ae1356e30d37cbd56c5 + iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed iokit_md5_10_7_5_patched=b5b15d1ed5a404962bc7de895a0df56a @@ -19,7 +23,10 @@ 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 +iokit_md5_10_9_4_patched=fa60af29f293214caab2b74223f9638d +iokit_md5_10_10_BETA_8_patched=ef33316712e303473c20c6eddf2becf1 +iokit_md5_10_10_BETA_4A379a_patched=b7c1380f8935b4cdd07ab3b2fef11d8c + nvda_md5_10_8_3=6a2d5017b6ddd3d19de2f4039d4c88ec nvda_md5_10_8_4=b553fd25b25d2262317e9de758888d2b @@ -35,6 +42,113 @@ amd_md5_10_9_1=693bffd29de3e5af0f49ae02f9d6a319 amd_md5_10_9_1_patched=874caed6a4abf8e596e43400a624ca79 +# Instructions for how to reproduce the IOKit patch on a newer version of the +# binary: +# +# First, take the md5 hash of IOKit for storing in this file +# md5 -q /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +# +# For OS X 10.9.2, the result is +# 9804392bbe8ba4b589175be56889c6c7 +# +# copy IOKit local and disassemble it +# cp /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit . +# otool -vt IOKit > IOKit.asm +# +# Open up that file and look for the function _CheckTimingWithRange. You can +# tell because the line begins with the function name and ends in a colon: +# _CheckTimingWithRange: +# +# Find the very first jump instruction in the function. In this case it is +# labelled JNE, which means jump if not equal. The instruction before is +# a comparison, and a literal translation to C would be expressed as: +# if(value1 != value2) goto result; +# +# Now we look at the address it's jumping to. In this case it's 0x17341 +# +# Go down to that instruction, and you’ll see that there’s a gap between the +# last jump instruction before it and this block. That block is the cleanup +# section that returns a good response. This function is structured such that +# error cases and success share the same return block, with a success block +# just before the return block. +# +# We want to patch this function so that it always returns a good response, +# which means changing the first instruction to jump to the good block, which is +# the first instruction to follow the very last jump to 0x17341. The address +# of this block is 0x17327 +# +# Jump instructions in this code are relative, se we need to calculate the +# offset being used by the current instruction, and also the address that will +# be used by the replacement instruction. +# +# Relative jump instructions are stored as an offset to the following +# instruction. So, in the case of the following code block: +# Address +# 1 JMP to 3 +# 2 Do Nothing +# 3 Do Something +# +# The jump instruction would be encoded as 'Jump +1', since 2 is the address of +# the next instruction. This is because the processor automatically adds the +# distance to the next instruction with each instruction run, so it will be +# included into the starting calculation. +# +# For the existing code, we have the following information: +# Instruction: JNE 0x17341 +# Address of instruction: 0x16f9e +# Address of next instruction: 0x16fa4 +# Relative difference: 0x39d (925) +# +# Given that we want to jump to 0x17327 instead, which is 26 bytes of address +# closer (0x17341 - 0x17327), you might think that we need to work with +# a relative difference of 0x383 (899) but there's a slight catch. +# +# The instruction that is there, JNE, takes two bytes to express, and the new +# instruction, JMP, is a single byte instruction. That means that if we don't +# want to mess with the rest of the program, we have to pad with an instruction +# that does nothing, NOP, for No OPeration. +# +# Since the next instruction is now the NOP, which is now one byte closer, we +# must recalculate the offset using a relative difference of 0x384 or 900. +# +# The final two things you need to know to patch IOKit are the opcodes for the +# three instructions, and the endianness of the architecture. +# +# JNE is '0x0F 0x85', JMP is '0xE9', and NOP is '0x90'. +# +# Intel x86 is little endian, which means the small byte of a multi-byte number +# comes first (the little end comes first). This means that the four byte +# offset 0x0000039D will be in the instruction stream as 0x9D 0x03 0x00 0x00 +# +# So, finally, the existing instruction is JNE +925, or JNE +0x39D, which is +# encoded as: +# (0F 85) JNE (9D 39 00 00) +925 +# 0F 85 9D 39 00 00 +# +# The instructions we want to replace it with are JMP +900, NOP, or JMP +0x384, +# NOP, which is encoded as: +# (E9) JMP (84 03 00 00) +900 (90) NOP +# E9 84 03 00 00 90 +# +# Converting this into a perl command like below, you'll notice that the before +# and after bytes are exactly the same as in the 10.9.1 version. We test this +# by patching the local copy of IOKit with thw following command +# +# perl -i.bak -pe '$before = qr"\x0F\x85\x9D\x03\x00\x00"s;s/$before/\xE9\x84\x03\x00\x00\x90/g' IOKit +# +# We'll disassemble the newly patched file to make sure it does what we expect: +# otool -vt IOKit > IOKit_new.asm +# +# We compare the two versions: +# diff -u IOKit.asm IOKit_new.asm +# +# Looking at the output shows that the only difference is replacing the JNE +# with the two instructions, JMP (or JMPQ) and NOP. +# +# The final step is taking the md5 hash of the new version and updating this file: +# md5 -q /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +# 45d8fc0e1210f0672297a7716478990e + if [ "$iokit_md5_current" = "$iokit_md5_10_7_4_patched" ]; then echo "Detected patched IOKit on 10.7.4, no action taken." @@ -70,8 +184,17 @@ 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." + +if [ "$iokit_md5_current" = "$iokit_md5_10_9_4_patched" ]; then + echo "Detected patched IOKit on 10.9.4, no action taken." +fi + +if [ "$iokit_md5_current" = "iokit_md5_10_10_BETA_8_patched" ]; then + echo "Detected patched IOKit on 10.10 Beta 8, no action taken." +fi + +if [ "$iokit_md5_current" = "iokit_md5_10_10_BETA_4A379a_patched" ]; then + echo "Detected patched IOKit on 10.10 Beta 4A379a, no action taken." fi if [ "$nvda_md5_current" = "$nvda_md5_10_8_3_patched" ]; then @@ -148,13 +271,37 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_9_2" ]; then 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 +if [ "$iokit_md5_current" = "$iokit_md5_10_9_3" ]; then + echo "Detected unpatched IOKit on 10.9.3, 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_4" ]; then + echo "Detected unpatched IOKit on 10.9.4, 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 + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +fi + +if [ "$iokit_md5_current" = "$iokit_md5_10_10_BETA_8" ]; then + echo "Detected unpatched IOKit on 10.10 Beta 8, 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 + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +fi + +if [ "$iokit_md5_current" = "$iokit_md5_10_10_BETA_4A379a" ]; then + echo "Detected unpatched IOKit on 10.10 Beta 4A379a, 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 + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 @@ -188,4 +335,3 @@ if [ "$amd_md5_current" = "$amd_md5_10_9_1" ]; then 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 - From bc45ac56533cf3ea3919e841d1fc058a24d4a9c1 Mon Sep 17 00:00:00 2001 From: Floris497 Date: Sat, 18 Oct 2014 20:39:29 +0200 Subject: [PATCH 02/23] Added 10.10 Support --- macPixelClockPatcher.command | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 01cbb88..eb84ce4 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -14,6 +14,7 @@ iokit_md5_10_9_3=9a86b6708569360f3156b53cc4f205d9 iokit_md5_10_9_4=6105cc8f503b589f8b3ce2d3917ad150 iokit_md5_10_10_BETA_8=1fe4ef08632ca0e685beb622330ec027 iokit_md5_10_10_BETA_4A379a=440d2f2e11286ae1356e30d37cbd56c5 +iokit_md5_10_10=2a8cbc2f6616d3f7a5e499bd2d5593ab iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed @@ -24,8 +25,7 @@ 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_9_4_patched=fa60af29f293214caab2b74223f9638d -iokit_md5_10_10_BETA_8_patched=ef33316712e303473c20c6eddf2becf1 -iokit_md5_10_10_BETA_4A379a_patched=b7c1380f8935b4cdd07ab3b2fef11d8c +# because the codesigning patched IOKit md5's cant be determend (they will be different for evryone) nvda_md5_10_8_3=6a2d5017b6ddd3d19de2f4039d4c88ec @@ -302,6 +302,14 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_10_BETA_4A379a" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_10" ]; then + echo "Detected unpatched IOKit on 10.10, 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 + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 From 5366c8b2a57c11180c6ce518f65064e95523dced Mon Sep 17 00:00:00 2001 From: jelliot Date: Mon, 22 Dec 2014 12:18:01 -0800 Subject: [PATCH 03/23] Update README example with correct -endianness I believe there is a typo in the first instruction encoding breakdown: 9D 39 instead of 9D 03. The perl is correct. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4516eeb..c9a70b0 100644 --- a/README.md +++ b/README.md @@ -126,8 +126,8 @@ offset 0x0000039D will be in the instruction stream as 0x9D 0x03 0x00 0x00 So, finally, the existing instruction is `JNE +925`, or `JNE +0x39D`, which is encoded as: ``` -(0F 85) JNE (9D 39 00 00) +925 -0F 85 9D 39 00 00 +(0F 85) JNE (9D 03 00 00) +925 +0F 85 9D 03 00 00 ``` The instructions we want to replace it with are `JMP +900`, `NOP`, or `JMP +0x384`, From 80088fb3ad963bf8c07d94540aae63dce19991f8 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Fri, 30 Jan 2015 23:49:41 +0100 Subject: [PATCH 04/23] Added 10.10.2 support Added 10.10.2 Support (I hope) Deleted some unused lines --- macPixelClockPatcher.command | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index eb84ce4..f407edf 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -15,7 +15,7 @@ iokit_md5_10_9_4=6105cc8f503b589f8b3ce2d3917ad150 iokit_md5_10_10_BETA_8=1fe4ef08632ca0e685beb622330ec027 iokit_md5_10_10_BETA_4A379a=440d2f2e11286ae1356e30d37cbd56c5 iokit_md5_10_10=2a8cbc2f6616d3f7a5e499bd2d5593ab - +iokit_md5_10_10_2=a94dc8e1b6bb6491e5f610f0a3caf960 iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed iokit_md5_10_7_5_patched=b5b15d1ed5a404962bc7de895a0df56a @@ -24,8 +24,8 @@ 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_9_4_patched=fa60af29f293214caab2b74223f9638d -# because the codesigning patched IOKit md5's cant be determend (they will be different for evryone) + +# from 10.9.4 patched md5's can not be determined due to codesigning nvda_md5_10_8_3=6a2d5017b6ddd3d19de2f4039d4c88ec @@ -184,18 +184,7 @@ 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_9_4_patched" ]; then - echo "Detected patched IOKit on 10.9.4, no action taken." -fi - -if [ "$iokit_md5_current" = "iokit_md5_10_10_BETA_8_patched" ]; then - echo "Detected patched IOKit on 10.10 Beta 8, no action taken." -fi - -if [ "$iokit_md5_current" = "iokit_md5_10_10_BETA_4A379a_patched" ]; then - echo "Detected patched IOKit on 10.10 Beta 4A379a, no action taken." -fi +# from 10.9.4 the patched md5 cannot be determined due to the codesigning if [ "$nvda_md5_current" = "$nvda_md5_10_8_3_patched" ]; then echo "Detected patched NVIDIA driver on 10.8.3, no action taken." @@ -310,6 +299,14 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_10" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_10_2" ]; then + echo "Detected unpatched IOKit on 10.10.2, 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 + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 From 8f09abbe0d35ebc0426ae47e9bc7c43191487dd0 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Wed, 8 Apr 2015 21:30:05 +0200 Subject: [PATCH 05/23] 10.10.3 support Added IOKit 10.10.3 support --- .gitignore | 2 ++ macPixelClockPatcher.command | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9bea433 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +.DS_Store diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index f407edf..038c66d 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -16,6 +16,8 @@ iokit_md5_10_10_BETA_8=1fe4ef08632ca0e685beb622330ec027 iokit_md5_10_10_BETA_4A379a=440d2f2e11286ae1356e30d37cbd56c5 iokit_md5_10_10=2a8cbc2f6616d3f7a5e499bd2d5593ab iokit_md5_10_10_2=a94dc8e1b6bb6491e5f610f0a3caf960 +iokit_md5_10_10_3=29d7632362b2fa4993156717671a5642 + iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed iokit_md5_10_7_5_patched=b5b15d1ed5a404962bc7de895a0df56a @@ -307,6 +309,14 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_10_2" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_10_3" ]; then + echo "Detected unpatched IOKit on 10.10.3, 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 + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 From 3d260ae154d342ffc96f8ad073e89671a6593c2b Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Wed, 1 Jul 2015 13:39:27 +0200 Subject: [PATCH 06/23] Added 10.10.4, Deleted comments Deleted unnecessary comments as they are duplicate of the readme --- macPixelClockPatcher.command | 111 +---------------------------------- 1 file changed, 1 insertion(+), 110 deletions(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 038c66d..cbb657d 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -18,7 +18,6 @@ iokit_md5_10_10=2a8cbc2f6616d3f7a5e499bd2d5593ab iokit_md5_10_10_2=a94dc8e1b6bb6491e5f610f0a3caf960 iokit_md5_10_10_3=29d7632362b2fa4993156717671a5642 - iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed iokit_md5_10_7_5_patched=b5b15d1ed5a404962bc7de895a0df56a iokit_md5_10_8_3_patched=289039239535c91146518c64aea5907b @@ -29,7 +28,6 @@ iokit_md5_10_9_2_patched=45d8fc0e1210f0672297a7716478990e # from 10.9.4 patched md5's can not be determined due to codesigning - nvda_md5_10_8_3=6a2d5017b6ddd3d19de2f4039d4c88ec nvda_md5_10_8_4=b553fd25b25d2262317e9de758888d2b nvda_md5_10_8_5_12F45=f84d891f1a67aa278453be59a6e1fece @@ -44,113 +42,6 @@ amd_md5_10_9_1=693bffd29de3e5af0f49ae02f9d6a319 amd_md5_10_9_1_patched=874caed6a4abf8e596e43400a624ca79 -# Instructions for how to reproduce the IOKit patch on a newer version of the -# binary: -# -# First, take the md5 hash of IOKit for storing in this file -# md5 -q /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -# -# For OS X 10.9.2, the result is -# 9804392bbe8ba4b589175be56889c6c7 -# -# copy IOKit local and disassemble it -# cp /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit . -# otool -vt IOKit > IOKit.asm -# -# Open up that file and look for the function _CheckTimingWithRange. You can -# tell because the line begins with the function name and ends in a colon: -# _CheckTimingWithRange: -# -# Find the very first jump instruction in the function. In this case it is -# labelled JNE, which means jump if not equal. The instruction before is -# a comparison, and a literal translation to C would be expressed as: -# if(value1 != value2) goto result; -# -# Now we look at the address it's jumping to. In this case it's 0x17341 -# -# Go down to that instruction, and you’ll see that there’s a gap between the -# last jump instruction before it and this block. That block is the cleanup -# section that returns a good response. This function is structured such that -# error cases and success share the same return block, with a success block -# just before the return block. -# -# We want to patch this function so that it always returns a good response, -# which means changing the first instruction to jump to the good block, which is -# the first instruction to follow the very last jump to 0x17341. The address -# of this block is 0x17327 -# -# Jump instructions in this code are relative, se we need to calculate the -# offset being used by the current instruction, and also the address that will -# be used by the replacement instruction. -# -# Relative jump instructions are stored as an offset to the following -# instruction. So, in the case of the following code block: -# Address -# 1 JMP to 3 -# 2 Do Nothing -# 3 Do Something -# -# The jump instruction would be encoded as 'Jump +1', since 2 is the address of -# the next instruction. This is because the processor automatically adds the -# distance to the next instruction with each instruction run, so it will be -# included into the starting calculation. -# -# For the existing code, we have the following information: -# Instruction: JNE 0x17341 -# Address of instruction: 0x16f9e -# Address of next instruction: 0x16fa4 -# Relative difference: 0x39d (925) -# -# Given that we want to jump to 0x17327 instead, which is 26 bytes of address -# closer (0x17341 - 0x17327), you might think that we need to work with -# a relative difference of 0x383 (899) but there's a slight catch. -# -# The instruction that is there, JNE, takes two bytes to express, and the new -# instruction, JMP, is a single byte instruction. That means that if we don't -# want to mess with the rest of the program, we have to pad with an instruction -# that does nothing, NOP, for No OPeration. -# -# Since the next instruction is now the NOP, which is now one byte closer, we -# must recalculate the offset using a relative difference of 0x384 or 900. -# -# The final two things you need to know to patch IOKit are the opcodes for the -# three instructions, and the endianness of the architecture. -# -# JNE is '0x0F 0x85', JMP is '0xE9', and NOP is '0x90'. -# -# Intel x86 is little endian, which means the small byte of a multi-byte number -# comes first (the little end comes first). This means that the four byte -# offset 0x0000039D will be in the instruction stream as 0x9D 0x03 0x00 0x00 -# -# So, finally, the existing instruction is JNE +925, or JNE +0x39D, which is -# encoded as: -# (0F 85) JNE (9D 39 00 00) +925 -# 0F 85 9D 39 00 00 -# -# The instructions we want to replace it with are JMP +900, NOP, or JMP +0x384, -# NOP, which is encoded as: -# (E9) JMP (84 03 00 00) +900 (90) NOP -# E9 84 03 00 00 90 -# -# Converting this into a perl command like below, you'll notice that the before -# and after bytes are exactly the same as in the 10.9.1 version. We test this -# by patching the local copy of IOKit with thw following command -# -# perl -i.bak -pe '$before = qr"\x0F\x85\x9D\x03\x00\x00"s;s/$before/\xE9\x84\x03\x00\x00\x90/g' IOKit -# -# We'll disassemble the newly patched file to make sure it does what we expect: -# otool -vt IOKit > IOKit_new.asm -# -# We compare the two versions: -# diff -u IOKit.asm IOKit_new.asm -# -# Looking at the output shows that the only difference is replacing the JNE -# with the two instructions, JMP (or JMPQ) and NOP. -# -# The final step is taking the md5 hash of the new version and updating this file: -# md5 -q /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -# 45d8fc0e1210f0672297a7716478990e - if [ "$iokit_md5_current" = "$iokit_md5_10_7_4_patched" ]; then echo "Detected patched IOKit on 10.7.4, no action taken." @@ -310,7 +201,7 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_10_2" ]; then fi if [ "$iokit_md5_current" = "$iokit_md5_10_10_3" ]; then - echo "Detected unpatched IOKit on 10.10.3, patching." + echo "Detected unpatched IOKit on 10.10.3 or 10.10.4, 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 # Now appears to require re-signing, despite not being in CodeResources From 25c0eef5a8bc679a3c3f7878c3b0721cfc84ca77 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Fri, 7 Aug 2015 19:46:28 +0200 Subject: [PATCH 07/23] Added 10.11 Beta 1,2,3,5,6 Support Added new calculations for 10.11 beta 1-5 (missing beta 4 md5) --- macPixelClockPatcher.command | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index cbb657d..3b9c75e 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -18,6 +18,14 @@ iokit_md5_10_10=2a8cbc2f6616d3f7a5e499bd2d5593ab iokit_md5_10_10_2=a94dc8e1b6bb6491e5f610f0a3caf960 iokit_md5_10_10_3=29d7632362b2fa4993156717671a5642 +iokit_md5_10_11_B1=2e32fac0525c7d93ddd38f1202515d99 +iokit_md5_10_11_B2=516bea2790cd6bfcb41959aa66122623 +iokit_md5_10_11_B3=15f9046ff25c807b7c76db8cdaf6ae4c +iokit_md5_10_11_B4=798a8e362e89e38e8f9cf6e59fda5184 +#iokit_md5_10_11_B4=?? +iokit_md5_10_11_B6=fd1d5161af223a95452ee90f294eb8ba + + iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed iokit_md5_10_7_5_patched=b5b15d1ed5a404962bc7de895a0df56a iokit_md5_10_8_3_patched=289039239535c91146518c64aea5907b @@ -208,6 +216,46 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_10_3" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_11_B1" ]; then + echo "Detected unpatched IOKit on 10.11 BETA 1, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +fi + +if [ "$iokit_md5_current" = "$iokit_md5_10_11_B2" ]; then + echo "Detected unpatched IOKit on 10.11 BETA 2, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +fi + +if [ "$iokit_md5_current" = "$iokit_md5_10_11_B3" ]; then + echo "Detected unpatched IOKit on 10.11 BETA 3, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +fi + +if [ "$iokit_md5_current" = "$iokit_md5_10_11_B5" ]; then + echo "Detected unpatched IOKit on 10.11 BETA 5, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +fi + +if [ "$iokit_md5_current" = "$iokit_md5_10_11_B6" ]; then + echo "Detected unpatched IOKit on 10.11 BETA 6, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 From 1bafb667e44279f84a0bff443e61f4cf8eb3b245 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Sat, 8 Aug 2015 08:30:07 +0200 Subject: [PATCH 08/23] Corrected little mistake --- macPixelClockPatcher.command | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 3b9c75e..15253d5 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -21,8 +21,8 @@ iokit_md5_10_10_3=29d7632362b2fa4993156717671a5642 iokit_md5_10_11_B1=2e32fac0525c7d93ddd38f1202515d99 iokit_md5_10_11_B2=516bea2790cd6bfcb41959aa66122623 iokit_md5_10_11_B3=15f9046ff25c807b7c76db8cdaf6ae4c -iokit_md5_10_11_B4=798a8e362e89e38e8f9cf6e59fda5184 #iokit_md5_10_11_B4=?? +iokit_md5_10_11_B5=798a8e362e89e38e8f9cf6e59fda5184 iokit_md5_10_11_B6=fd1d5161af223a95452ee90f294eb8ba From acd80d4e01f918b68a08fb559e3327c2cf4f1124 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Wed, 26 Aug 2015 15:39:42 +0200 Subject: [PATCH 09/23] Added support for 10.11 Beta 7 --- macPixelClockPatcher.command | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 15253d5..0a95b37 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -24,6 +24,7 @@ iokit_md5_10_11_B3=15f9046ff25c807b7c76db8cdaf6ae4c #iokit_md5_10_11_B4=?? iokit_md5_10_11_B5=798a8e362e89e38e8f9cf6e59fda5184 iokit_md5_10_11_B6=fd1d5161af223a95452ee90f294eb8ba +iokit_md5_10_11_B7=c8b8830d495a2ba76e99f50e17b9f9ef iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed @@ -256,6 +257,14 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_11_B6" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_11_B7" ]; then + echo "Detected unpatched IOKit on 10.11 BETA 7, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 From 5492027c652d686d0f4a5a2967db7f320339a66c Mon Sep 17 00:00:00 2001 From: masakistan Date: Wed, 9 Sep 2015 01:55:10 -0600 Subject: [PATCH 10/23] added el capitan beta 8 --- macPixelClockPatcher.command | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 0a95b37..4da9097 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -25,6 +25,7 @@ iokit_md5_10_11_B3=15f9046ff25c807b7c76db8cdaf6ae4c iokit_md5_10_11_B5=798a8e362e89e38e8f9cf6e59fda5184 iokit_md5_10_11_B6=fd1d5161af223a95452ee90f294eb8ba iokit_md5_10_11_B7=c8b8830d495a2ba76e99f50e17b9f9ef +iokit_md5_10_11_B8=3b91046e15867c7db44b8d699db8a5cf iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed @@ -265,6 +266,14 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_11_B7" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_11_B8" ]; then + echo "Detected unpatched IOKit on 10.11 BETA 8, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 From a1035b1b6ad9e23b454619ca3a0b484bc7c9b1ff Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Thu, 10 Sep 2015 17:02:00 +0200 Subject: [PATCH 11/23] Added 10.11 support --- macPixelClockPatcher.command | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 4da9097..ff653e3 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -26,6 +26,7 @@ iokit_md5_10_11_B5=798a8e362e89e38e8f9cf6e59fda5184 iokit_md5_10_11_B6=fd1d5161af223a95452ee90f294eb8ba iokit_md5_10_11_B7=c8b8830d495a2ba76e99f50e17b9f9ef iokit_md5_10_11_B8=3b91046e15867c7db44b8d699db8a5cf +iokit_md5_10_11=cd40217cd8d2ed8f16fa4ca513253109 iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed @@ -274,6 +275,14 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_11_B8" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_11" ]; then + echo "Detected unpatched IOKit on 10.11 (GM Candidate), patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 From f5137cdbb910898ffa29a31f6d943cbbfbc9d733 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 17 Sep 2015 20:08:56 +1000 Subject: [PATCH 12/23] Updated to reflect that this works on El Capitan --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c9a70b0..f347e77 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Mac Pixel Clock Patcher ===== -Updated with Yosemite Beta support! +Updated with El Capitan support! This will remove the 165 pixel clock limiter on your display driver to support 4k @ 30Hz over HDMI. An [Active DisplayPort to HDMI adapter](http://www.amazon.com/gp/product/B00DOZHLAA/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B00DOZHLAA&linkCode=as2&tag=makeramencom-20&linkId=TR5RNZEM24Z7KP7N) is often needed for this to work. From a150b8174156f3e56e86f294ec1e2cad5fb1840c Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Wed, 30 Sep 2015 22:00:01 +0200 Subject: [PATCH 13/23] Support for newer Nvidia kext Added Nvidia 10.10.5 Added Nvidia 10.11 --- macPixelClockPatcher.command | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index ff653e3..27de893 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -43,11 +43,16 @@ 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_10_5=9b584e820da1b7a0a32416d4c6e34886 +nvda_md5_10_11=1ecb016bc5b4ed7b7949d87e4f3f234a + 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 +nvda_md5_10_10_5_patched=8cc9299149c3ab99fe6def45366ecb40 +nvda_md5_10_11_patched=b6babc8ca4f03bdb2552bb01c51770b1 amd_md5_10_9_1=693bffd29de3e5af0f49ae02f9d6a319 @@ -109,6 +114,14 @@ 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 [ "$nvda_md5_current" = "$nvda_md5_10_10_5_patched" ]; then + echo "Detected patched NVIDIA driver on 10.10.5, no action taken." +fi + +if [ "$nvda_md5_current" = "$nvda_md5_10_11_patched" ]; then + echo "Detected patched NVIDIA driver on 10.11, 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." @@ -310,6 +323,17 @@ if [ "$nvda_md5_current" = "$nvda_md5_10_9_1" ]; then sudo touch /System/Library/Extensions fi +if [ "$nvda_md5_current" = "$nvda_md5_10_10_5" ]; then + echo "Detected unpatched NVIDIA driver on 10.10.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_11" ]; then + echo "Detected unpatched NVIDIA driver on 10.11, 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." From 39d9d42ef913787cbc586321c5344b399e3bd339 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Thu, 1 Oct 2015 10:28:32 +0200 Subject: [PATCH 14/23] Fixed support for 10.11 Added 10.11 release version --- macPixelClockPatcher.command | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 27de893..469c13d 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -26,7 +26,8 @@ iokit_md5_10_11_B5=798a8e362e89e38e8f9cf6e59fda5184 iokit_md5_10_11_B6=fd1d5161af223a95452ee90f294eb8ba iokit_md5_10_11_B7=c8b8830d495a2ba76e99f50e17b9f9ef iokit_md5_10_11_B8=3b91046e15867c7db44b8d699db8a5cf -iokit_md5_10_11=cd40217cd8d2ed8f16fa4ca513253109 +iokit_md5_10_11_GM=cd40217cd8d2ed8f16fa4ca513253109 +iokit_md5_10_11=131978134faf623c7803458c2a204d60 iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed @@ -44,8 +45,7 @@ nvda_md5_10_8_4=b553fd25b25d2262317e9de758888d2b nvda_md5_10_8_5_12F45=f84d891f1a67aa278453be59a6e1fece nvda_md5_10_9_1=6de28959ec948513c239b1bf31205465 nvda_md5_10_10_5=9b584e820da1b7a0a32416d4c6e34886 -nvda_md5_10_11=1ecb016bc5b4ed7b7949d87e4f3f234a - +nvda_md5_10_11_GM=1ecb016bc5b4ed7b7949d87e4f3f234a nvda_md5_10_8_3_patched=7e8372fca35c5e7db90a229e70709d58 nvda_md5_10_8_4_patched=3c552ba24fa89b2ea892dd711088e8d5 @@ -288,7 +288,7 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_11_B8" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi -if [ "$iokit_md5_current" = "$iokit_md5_10_11" ]; then +if [ "$iokit_md5_current" = "$iokit_md5_10_11_GM" ]; then echo "Detected unpatched IOKit on 10.11 (GM Candidate), patching." sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit sudo touch /System/Library/Extensions @@ -296,6 +296,14 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_11" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_11" ]; then + echo "Detected unpatched IOKit on 10.11, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 From c08cf43fdf91e335254f2bbb50e7e966c85b3a33 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Thu, 1 Oct 2015 10:38:53 +0200 Subject: [PATCH 15/23] Added 10.11.1 support Renamed 10.11 suport to 10.11.1 Added real 10.11 support --- macPixelClockPatcher.command | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 469c13d..58ca4dd 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -21,14 +21,12 @@ iokit_md5_10_10_3=29d7632362b2fa4993156717671a5642 iokit_md5_10_11_B1=2e32fac0525c7d93ddd38f1202515d99 iokit_md5_10_11_B2=516bea2790cd6bfcb41959aa66122623 iokit_md5_10_11_B3=15f9046ff25c807b7c76db8cdaf6ae4c -#iokit_md5_10_11_B4=?? iokit_md5_10_11_B5=798a8e362e89e38e8f9cf6e59fda5184 iokit_md5_10_11_B6=fd1d5161af223a95452ee90f294eb8ba iokit_md5_10_11_B7=c8b8830d495a2ba76e99f50e17b9f9ef iokit_md5_10_11_B8=3b91046e15867c7db44b8d699db8a5cf -iokit_md5_10_11_GM=cd40217cd8d2ed8f16fa4ca513253109 iokit_md5_10_11=131978134faf623c7803458c2a204d60 - +iokit_md5_10_11_1=cd40217cd8d2ed8f16fa4ca513253109 iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed iokit_md5_10_7_5_patched=b5b15d1ed5a404962bc7de895a0df56a @@ -45,14 +43,14 @@ nvda_md5_10_8_4=b553fd25b25d2262317e9de758888d2b nvda_md5_10_8_5_12F45=f84d891f1a67aa278453be59a6e1fece nvda_md5_10_9_1=6de28959ec948513c239b1bf31205465 nvda_md5_10_10_5=9b584e820da1b7a0a32416d4c6e34886 -nvda_md5_10_11_GM=1ecb016bc5b4ed7b7949d87e4f3f234a +nvda_md5_10_11_1=1ecb016bc5b4ed7b7949d87e4f3f234a 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 nvda_md5_10_10_5_patched=8cc9299149c3ab99fe6def45366ecb40 -nvda_md5_10_11_patched=b6babc8ca4f03bdb2552bb01c51770b1 +nvda_md5_10_11_1_patched=b6babc8ca4f03bdb2552bb01c51770b1 amd_md5_10_9_1=693bffd29de3e5af0f49ae02f9d6a319 @@ -118,7 +116,7 @@ if [ "$nvda_md5_current" = "$nvda_md5_10_10_5_patched" ]; then echo "Detected patched NVIDIA driver on 10.10.5, no action taken." fi -if [ "$nvda_md5_current" = "$nvda_md5_10_11_patched" ]; then +if [ "$nvda_md5_current" = "$nvda_md5_10_11_1_patched" ]; then echo "Detected patched NVIDIA driver on 10.11, no action taken." fi @@ -288,16 +286,16 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_11_B8" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi -if [ "$iokit_md5_current" = "$iokit_md5_10_11_GM" ]; then - echo "Detected unpatched IOKit on 10.11 (GM Candidate), patching." +if [ "$iokit_md5_current" = "$iokit_md5_10_11" ]; then + echo "Detected unpatched IOKit on 10.11, patching." sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit sudo touch /System/Library/Extensions # Now appears to require re-signing, despite not being in CodeResources sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi -if [ "$iokit_md5_current" = "$iokit_md5_10_11" ]; then - echo "Detected unpatched IOKit on 10.11, patching." +if [ "$iokit_md5_current" = "$iokit_md5_10_11_1" ]; then + echo "Detected unpatched IOKit on 10.11.1, patching." sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit sudo touch /System/Library/Extensions # Now appears to require re-signing, despite not being in CodeResources @@ -337,8 +335,8 @@ if [ "$nvda_md5_current" = "$nvda_md5_10_10_5" ]; then sudo touch /System/Library/Extensions fi -if [ "$nvda_md5_current" = "$nvda_md5_10_11" ]; then - echo "Detected unpatched NVIDIA driver on 10.11, patching." +if [ "$nvda_md5_current" = "$nvda_md5_10_11_1" ]; then + echo "Detected unpatched NVIDIA driver on 10.11.1, 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 From a344a236b68f122f60bdf4350a44dc0a41bf4ff0 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Thu, 1 Oct 2015 12:12:47 +0200 Subject: [PATCH 16/23] Added 10.11 support for nvidia --- macPixelClockPatcher.command | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 58ca4dd..7eb1264 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -43,6 +43,7 @@ nvda_md5_10_8_4=b553fd25b25d2262317e9de758888d2b nvda_md5_10_8_5_12F45=f84d891f1a67aa278453be59a6e1fece nvda_md5_10_9_1=6de28959ec948513c239b1bf31205465 nvda_md5_10_10_5=9b584e820da1b7a0a32416d4c6e34886 +nvda_md5_10_11=77ad2ec58403088bbe026dd2ada737c0 nvda_md5_10_11_1=1ecb016bc5b4ed7b7949d87e4f3f234a nvda_md5_10_8_3_patched=7e8372fca35c5e7db90a229e70709d58 @@ -50,6 +51,7 @@ nvda_md5_10_8_4_patched=3c552ba24fa89b2ea892dd711088e8d5 nvda_md5_10_8_5_12F45_patched=5e65da83006468e8a69ef60a180ea08d nvda_md5_10_9_1_patched=bbb0885323ea3221150839782fbd553f nvda_md5_10_10_5_patched=8cc9299149c3ab99fe6def45366ecb40 +nvda_md5_10_11_patched=334875e37ab36a1a9d6a4bde4dce78f5 nvda_md5_10_11_1_patched=b6babc8ca4f03bdb2552bb01c51770b1 amd_md5_10_9_1=693bffd29de3e5af0f49ae02f9d6a319 @@ -116,10 +118,14 @@ if [ "$nvda_md5_current" = "$nvda_md5_10_10_5_patched" ]; then echo "Detected patched NVIDIA driver on 10.10.5, no action taken." fi -if [ "$nvda_md5_current" = "$nvda_md5_10_11_1_patched" ]; then +if [ "$nvda_md5_current" = "$nvda_md5_10_11_patched" ]; then echo "Detected patched NVIDIA driver on 10.11, no action taken." fi +if [ "$nvda_md5_current" = "$nvda_md5_10_11_1_patched" ]; then + echo "Detected patched NVIDIA driver on 10.11.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." @@ -341,6 +347,12 @@ if [ "$nvda_md5_current" = "$nvda_md5_10_11_1" ]; then sudo touch /System/Library/Extensions fi +if [ "$nvda_md5_current" = "$nvda_md5_10_11" ]; then + echo "Detected unpatched NVIDIA driver on 10.11, 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 From 6497fead26d8f7d47ebcd2b4d92521cb0f67a222 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Thu, 22 Oct 2015 11:27:45 +0200 Subject: [PATCH 17/23] Support for 10.11.1 (non beta) --- macPixelClockPatcher.command | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 7eb1264..a562ed2 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -26,7 +26,8 @@ iokit_md5_10_11_B6=fd1d5161af223a95452ee90f294eb8ba iokit_md5_10_11_B7=c8b8830d495a2ba76e99f50e17b9f9ef iokit_md5_10_11_B8=3b91046e15867c7db44b8d699db8a5cf iokit_md5_10_11=131978134faf623c7803458c2a204d60 -iokit_md5_10_11_1=cd40217cd8d2ed8f16fa4ca513253109 +iokit_md5_10_11_1B=cd40217cd8d2ed8f16fa4ca513253109 +iokit_md5_10_11_1=7359b413a4dca7a189b80da750ce43dd iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed iokit_md5_10_7_5_patched=b5b15d1ed5a404962bc7de895a0df56a @@ -300,6 +301,14 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_11" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_11_1B" ]; then + echo "Detected unpatched IOKit on 10.11.1 BETA, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +fi + if [ "$iokit_md5_current" = "$iokit_md5_10_11_1" ]; then echo "Detected unpatched IOKit on 10.11.1, patching." sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit From 5dff97db3dd63a1b85a7c95517a439717cb8f6d2 Mon Sep 17 00:00:00 2001 From: Rasmi Date: Wed, 9 Dec 2015 01:01:27 -0500 Subject: [PATCH 18/23] Added IOKit patch for OS X 10.11.2. --- macPixelClockPatcher.command | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index a562ed2..2199805 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -28,6 +28,7 @@ iokit_md5_10_11_B8=3b91046e15867c7db44b8d699db8a5cf iokit_md5_10_11=131978134faf623c7803458c2a204d60 iokit_md5_10_11_1B=cd40217cd8d2ed8f16fa4ca513253109 iokit_md5_10_11_1=7359b413a4dca7a189b80da750ce43dd +iokit_md5_10_11_2=a7afb2dd9df1e4c48f12b4b52f7da212 iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed iokit_md5_10_7_5_patched=b5b15d1ed5a404962bc7de895a0df56a @@ -317,6 +318,14 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_11_1" ]; then sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_11_2" ]; then + echo "Detected unpatched IOKit on 10.11.2, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 From f7c28317f245b9838a826022b77334aebee4b1b9 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Wed, 20 Jan 2016 23:48:37 +0100 Subject: [PATCH 19/23] Updated 10.11.3 string no chance to script. --- macPixelClockPatcher.command | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 2199805..4c384f7 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -319,7 +319,7 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_11_1" ]; then fi if [ "$iokit_md5_current" = "$iokit_md5_10_11_2" ]; then - echo "Detected unpatched IOKit on 10.11.2, patching." + echo "Detected unpatched IOKit on 10.11.2 or 10.11.3, patching." sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit sudo touch /System/Library/Extensions # Now appears to require re-signing, despite not being in CodeResources From f19d4d4fd94109ec4e03c052729304e06a12c26c Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Sun, 24 Jan 2016 16:33:54 +0100 Subject: [PATCH 20/23] 10.11.3 support and 10.11.4 Beta support --- macPixelClockPatcher.command | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/macPixelClockPatcher.command b/macPixelClockPatcher.command index 4c384f7..56173ea 100755 --- a/macPixelClockPatcher.command +++ b/macPixelClockPatcher.command @@ -30,6 +30,10 @@ iokit_md5_10_11_1B=cd40217cd8d2ed8f16fa4ca513253109 iokit_md5_10_11_1=7359b413a4dca7a189b80da750ce43dd iokit_md5_10_11_2=a7afb2dd9df1e4c48f12b4b52f7da212 +iokit_md5_10_11_3=3cec8ae287ee52a3622082bfc049bb86 +iokit_md5_10_11_4B_15E27e=af00c155d23f24d5058f06bdfedf1066 + + iokit_md5_10_7_4_patched=92eb38917f6ec4f341bff6fd1b6076ed iokit_md5_10_7_5_patched=b5b15d1ed5a404962bc7de895a0df56a iokit_md5_10_8_3_patched=289039239535c91146518c64aea5907b @@ -319,13 +323,30 @@ if [ "$iokit_md5_current" = "$iokit_md5_10_11_1" ]; then fi if [ "$iokit_md5_current" = "$iokit_md5_10_11_2" ]; then - echo "Detected unpatched IOKit on 10.11.2 or 10.11.3, patching." + echo "Detected unpatched IOKit on 10.11.2, patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +fi + +if [ "$iokit_md5_current" = "$iokit_md5_10_11_3" ]; then + echo "Detected unpatched IOKit on 10.11.3, patching." sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit sudo touch /System/Library/Extensions # Now appears to require re-signing, despite not being in CodeResources sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit fi +if [ "$iokit_md5_current" = "$iokit_md5_10_11_4B_15E27e" ]; then + echo "Detected unpatched IOKit on 10.11.4 Beta (15E27e), patching." + sudo perl -i.bak -pe '$before = qr"\x0f\x85\x92\x03\x00\x00"s;s/$before/\xe9\x7a\x03\x00\x00\x90/g' /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + sudo touch /System/Library/Extensions + # Now appears to require re-signing, despite not being in CodeResources + sudo codesign -f -s - /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +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 From ac1a3b25581530a0e233ef572c15ad3e02739834 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Sun, 24 Jan 2016 17:48:11 +0100 Subject: [PATCH 21/23] Added some SIP instructions to the readme --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f347e77..761747b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Mac Pixel Clock Patcher Updated with El Capitan support! This will remove the 165 pixel clock limiter on your display driver to support 4k @ 30Hz over HDMI. -An [Active DisplayPort to HDMI adapter](http://www.amazon.com/gp/product/B00DOZHLAA/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B00DOZHLAA&linkCode=as2&tag=makeramencom-20&linkId=TR5RNZEM24Z7KP7N) is often needed for this to work. +An [Active DisplayPort to HDMI adapter](http://www.amazon.com/gp/product/B00DOZHLAA/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B00DOZHLAA&linkCode=as2&tag=makeramencom-20&linkId=TR5RNZEM24Z7KP7N) is sometimes needed for this to work. Original forum thread [here](https://github.com/vinc3m1/mac-pixel-clock-patch). @@ -16,6 +16,17 @@ Based on the [original](https://code.google.com/p/mac-pixel-clock-patch/wiki/Doc How to install this patch ===== +#####MAKE SURE TO DISABLE SIP on 10.11 and newer. + +First make sure SIP (System Integrity Protection) is turned off for this to work. +You can disable/enable this only when you boot into the recovery partition. +If you booted into the recovery partition and open the terminal you use ```csrutil disable``` to disable, ```csrutil enable``` to enable and ```csrutil status``` to check the status of SIP you can also check the status on your normal system. +the changes to SIP are only visible in the terminal after a reboot, so it will still notify you that SIP is on when you disable it and run ```csrutil status``` right after it. + +SIP can safely be enabled after the patch of the IOKit, if you also want to use an Nvidia/AMD driver that has been patched you need to keep SIP disabled. this is because SIP will not allow you to run drivers which have a broken or no codesignature. by patching the driver we obviously break the codesignature. +kernal extensions are not signable by anyone but apple and trusted parties. so SIP needs to be off for them to load. +IOKit is not a kernel extension and therefore must be codesigned to run, this is done with the wildcard certificat, unique to everyone. even with SIP disabled the IOKit will not run without this new codesignature. the script takes care of the codesigning of the IOKit. + Download the `.command` file Download it into your Downloads folder. Open Terminal and run: @@ -35,7 +46,7 @@ Pay attention to the output - it should say it detected unpatched IOKit and NVID Reboot your system. -After reboot, you should be able to get custom resolutions with over 165 MHz pixel clock to work using SwitchResX (not required after 10.9). +After reboot, you should be able to get custom resolutions with over 165 MHz pixel clock to work using SwitchResX. Instructions for updating the command for newer versions of IOKit From 81747953be98426d9b29311c37786f395150ad23 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Mon, 25 Jan 2016 00:05:10 +0100 Subject: [PATCH 22/23] Added link to version 2 to read me --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 761747b..9034046 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +### This patch has a version 2 in development, the VERSION 2 patch has a few advantages over this one. mainly the ability to patch yet unsopported versions and it regained the ability to detect patched IOKit files. found here [VERSION 2](https://github.com/Floris497/mac-pixel-clock-patch-V2) + +This patch will be maintained in parallel with [VERSION 2](https://github.com/Floris497/mac-pixel-clock-patch-V2) until the new script has been proven worthy. + Mac Pixel Clock Patcher ===== From 32264c20d9f7c3365557510186fcbdfe56857633 Mon Sep 17 00:00:00 2001 From: Floris Fredrikze Date: Sat, 26 Mar 2016 17:24:51 +0100 Subject: [PATCH 23/23] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9034046..80f43c7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -### This patch has a version 2 in development, the VERSION 2 patch has a few advantages over this one. mainly the ability to patch yet unsopported versions and it regained the ability to detect patched IOKit files. found here [VERSION 2](https://github.com/Floris497/mac-pixel-clock-patch-V2) +### There is a [Version 2](https://github.com/Floris497/mac-pixel-clock-patch-V2) of this patch availible that is made to replace this script in its intirety.. therefore this script is not being maintained anymore. -This patch will be maintained in parallel with [VERSION 2](https://github.com/Floris497/mac-pixel-clock-patch-V2) until the new script has been proven worthy. +### for 10.11.4 support and up use Version 2 of this script. Mac Pixel Clock Patcher =====