Jump to content
InsanelyMac Forum
jj_9

KextsToPatch how-to (?)

Recommended Posts

Hi all,

 

I'm very sorry for my dummy question but did you manage to master the syntax ?

 

If I want to add this to config.plist :

 

sudo perl -pi -e '$c+=s/\xE2\x00\x00\x00\x0F\x30/\xE2\x00\x00\x00\x90\x90/; END { printf "%s: %d substitution%s made.\n",($c==1 ? "Success" : "Error"),$c,(!$c || $c>1 ? "s" : ""); $?=($c!=1); }' /System/Library/Extensions/AppleIntelCPUPowerManagement.kext/Contents/MacOS/AppleIntelCPUPowerManagement

 

 

How-to translate from \xE2\x00\x00\x00\x0F\x30 to the correct format for clover ??

(same question for \xE2\x00\x00\x00\x90\x90 ;)

 

Also don't hesitate to reply to this post with you patches in case they could help others :)

 

Regards

JJ

Share this post


Link to post
Share on other sites
Advertisement

:thumbsup_anim:

 

Thank you so much ...

 

I must admit I didn't understand the original sample with "headphones" as "48 65 61 64 70 68 6F 6E 65 73 00" and the actual search for the string <data>SGVhZHBob25lcwA=</data>

:)

 

A+

JJ

 

Edit : one more question :

Could it be possible with clover to replace a whole kext

ie: put my applehda.kext in the kext folder and have it to replace the original one ?

(or is it only a folder to load non existent kext)

Share this post


Link to post
Share on other sites

iam noob in clover, i wish to install maverick into AMD machine, but the problem is the installation required custom kernel. how to config custom kernel into clover config.
i can't customize the mavericks setup installer, because i use this command to restore mavericks dmg file into my usb flashdrive :

 

sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia –volume /Volumes/Cloverboot/ –applicationpath /Applications/Install\ OS\ X\ Mavericks.app –nointeraction

 

Share this post


Link to post
Share on other sites

boot-args="Kernel=mach_kernel.amd"

Thanks before.. :D

and where should i place the AMD/another custom kernel?

thanks for the answer.

Share this post


Link to post
Share on other sites

put on root or .../kexts/10.x  and don't forget boot without caches

if still get a problem with that method (createinstallmedia) .. so you must restore with basesystem method

Share this post


Link to post
Share on other sites

put on root or .../kexts/10.x  and don't forget boot without caches

if still get a problem with that method (createinstallmedia) .. so you must restore with basesystem method

Thanks for guide..

i'll try it tonight. :yes:  :thumbsup_anim:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.



  • Similar Content

    • By bu11etpr00f
      I decided to write up an Article on Understanding how Clover's KextsToPatch feature works. There doesn't seem to be a whole lot of documentation explaining how to use this feature correctly (not that I have been able to find anyway). There is a lot of information out there about what to use, and what to put into your config.plist, but not much as to how to find out why the values used are used, and how the "data" was obtained. This guide hopes to address that. I tried to update this information on the Wiki, but the authentication between Github and Google appears to be nonfunctional... or no longer open to the public.
      "Authentication failed Provider did not validate your credentials (invalid_credentials) - please retry or choose another login service" This Guide will hopefully help those of you (like me) who would like to know how (and why) to use a tool, and not just use it a certain way because you were told to. For now, this Guide will just be an expansion of the part of the Wiki page found here.
       
       
       
      KextsToPatch   <key>KextsToPatch</key> <array>   Aside from the patches already built-in to Clover, you also have the ability to create your own by using the following obtainable values: the Binary File Name, the Data to Find, and the Data to Replace. Both Data Values will need to be in the same format; either in hexadecimal (Property List Editor/Clover Configurator), or in base64 (plain text editor). The Data Value lengths MUST also be equal. A smaller replacement Data Value may be filled with zeroes.   Fresco FL1009 USB 3.0 Device ID Patch (BTW: This patch is great for people who have a Gigabyte X79-UD5 Motherboard and want to resolve their USB issues with El Capitan 10.11. It enables the Fresco FL1009 USB 3.0 Controller as a Fresco FL1100 USB 3.0 Controller. Works Great! ) The following example shows a patch for AppleUSBXHCIPCI replacing the data <string>0x11001b73</string> with <string>0x10091b73</string>:           <key>KextsToPatch</key>         <array>             <dict>                 <key>Comment</key>                 <string>Fresco FL1009 USB 3.0 Device ID Patch</string>                 <key>Name</key>                 <string>AppleUSBXHCIPCI</string>                 <key>Find</key>                 <data>PHN0cmluZz4weDExMDAxYjczPC9zdHJpbmc+</data>                 <key>Replace</key>                 <data>PHN0cmluZz4weDEwMDkxYjczPC9zdHJpbmc+</data>                 <key>InfoPlistPatch</key>                 <true/>             </dict>         </array> Note: the patch data is encoded in base64 due to the data type of the field.   Unfortunately, Tables don't seem to be supported on this Forum, so I've put images of them in this post. I will also leave the text data below them if you wish to copy/paste it somewhere.     Find Value (base64) PHN0cmluZz4weDExMDAxYjczPC9zdHJpbmc+ Find Converted to (UTF-8): <string>0x11001b73</string> Find Converted to (HEX):
      3C737472696E673E307831313030316237333C2F737472696E673E   Replace Value (base64) PHN0cmluZz4weDEwMDkxYjczPC9zdHJpbmc+ Replace Converted to (UTF-8): <string>0x10091b73</string> Replace Converted to (HEX): 3C737472696E673E307831303039316237333C2F737472696E673E     For help converting base64: https://www.base64decode.org/ http://tomeko.net/online_tools/base64.php?lang=en       Viewed in Property List Editor:   Note: The config.plist uses a base64 value, while Property List Editor shows you the HEX value.       Viewed in Clover Configurator:   Note: The config.plist uses a base64 value, while Clover Configurator shows you the TEXT (UTF-8) or HEX value.         It is sometimes necessary to use a patch to modify a kext's Info.plist. In this case, the following Boolean Key needs to be added to the Patch's Dictionary Item:               <dict>                 <key>InfoPlistPatch</key>                 <true/>             </dict> Side note: Patches are applied in the kext cache. If you patch an Info.plist in order to enable the loading of a specific kext, which is not currently present in your cache, you will need to reboot twice: Once with the option NoCaches to allow FSInject to load the specific kext into the cache, and Then again for the cache to be patched successfully.       Other Examples:   TRIM Function for non-Apple SSDs The following example shows a patch for IOAHCIBlockStorage replacing the data APPLE SSD with an empty value:               <dict>                 <key>Comment</key>                 <string>TRIM Function for non-Apple SSDs</string>                 <key>Name</key>                 <string>IOAHCIBlockStorage</string>                 <key>Find</key>                 <data>QVBQTEUgU1NEAA==</data>                 <key>Replace</key>                 <data>AAAAAAAAAAAAAA==</data>             </dict> Note: the patch data is encoded in base64 due to the data type of the field.     Find Value (base64) QVBQTEUgU1NEAA== Find Converted to (UTF-8): APPLE SSD Find Converted to (HEX):
      4150504C452053534400   Replace Value (base64) AAAAAAAAAAAAAA== Replace Converted to (UTF-8) (yes, it's blank): Replace Converted to (HEX): 00000000000000000000       Define External Drives as Internal to fix Orange Icons The following example shows a patch for AppleAHCIPort replacing the data External with Internal:               <dict>                 <key>Comment</key>                 <string>Define External Drives as Internal to fix Orange Icons</string>                 <key>Name</key>                 <string>AppleAHCIPort</string>                 <key>Find</key>                 <data>RXh0ZXJuYWw=</data>                 <key>Replace</key>                 <data>SW50ZXJuYWw=</data>             </dict>   Note: the patch data is encoded in base64 due to the data type of the field.     Find Value (base64) RXh0ZXJuYWw= Find Converted to (UTF-8): External Find Converted to (HEX):
      45787465726E616C Replace Value (base64) SW50ZXJuYWw= Replace Converted to (UTF-8): Internal Replace Converted to (HEX): 496E7465726E616C     Allow booting with a MacPro4,1 or MacPro5,1 SMBIOS definition without ECC Memory The following example shows a patch for AppleTyMCEDriver replacing the data r
      MacPro4,1MacPro5,1Xr  with r
      X             <dict>                 <key>Comment</key>                 <string>Allow booting with a MacPro4,1 or MacPro5,1 SMBIOS definition without ECC Memory</string>                 <key>Name</key>                 <string>AppleTyMCEDriver</string>                 <key>Find</key>                 <data>cgoATWFjUHJvNCwxAE1hY1BybzUsMQBY</data>                 <key>Replace</key>                 <data>cgoAAAAAAAAAAAAAAAAAAAAAAAAAAABY</data>             </dict> Note: the patch data is encoded in base64 due to the data type of the field.     Find Value (base64) cgoATWFjUHJvNCwxAE1hY1BybzUsMQBY Find Converted to (UTF-8): r MacPro4,1MacPro5,1X Find Converted to (HEX):
      720A004D616350726F342C31004D616350726F352C310058   Replace Value (base64) cgoAAAAAAAAAAAAAAAAAAAAAAAAAAABY Replace Converted to (UTF-8): r X Replace Converted to (HEX): 720A00000000000000000000000000000000000000000058
    • By slemblod
      Hello!
       
      I am making an automation script for installing Clover onto a drive's EFI partition.
      For editing the stock config.plist i use PlistBuddy (located in /usr/libexec/PlistBuddy), and the following command causes issues:
      /usr/libexec/PlistBuddy -c "Add :KernelAndKextPatches:KextsToPatch:0:Find data ixnUEQ==" $config I tried replacing
      ixnUEQ== with other bases, e.g. 
      8b19d411  or
      10001011 00011001 11010100 00010001 but none yields the desired result, which is:
      <data> ixnEUQ== </data>  
      Do you have any suggestion as to what I could do instead?
       
      Any help would be appreciated.
      Thank you!
       
      EDIT: Solved it. See post 3.
×