Floris497 / mac-pixel-clock-patch-V2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work on Majavi

buhlaze opened this issue · comments

Can we get a patch for Mojavi 10.14? I tried the current one and it does not work.

Just got it installed, will check it out later this week maybe next week, since I have some holidays now :)

Highly risky

not tested at al, did not even check if my Mac still boots.. but for the sake of it..

EDIT: New file..
CoreDisplay-patcher.command.zip

It does boot.. that's something.. only "SwitchResX" has a bug and can't make custom res.. so maybe it does work maybe it does not.. feel free to share if it worked or not :)
(I'm still not responsible if you system doesn't boot after)

It doesn't seem to be working on my Hackintosh, i.e. unable to use 4K monitor with non-iris integrated graphics.

Did you make custom resolutions?

It's a newly installed Mojave beta so I don't think so.


Hmmm, I disassembled both the patched and unpatched CoreDisplay and it doesn't seem that there is any difference at all.

Oh.. well.. could have been i was tired.. didn't check uh... I'll try again

I made a small mistake with the copy paste, new file attached to the comment :) should patch and boot.. if it works.. idk

Well, I have tested your new file. It does not seem to work.

Have anyone managed to make it work with Mojave?

commented

Any updates on this? Gonna try it myself soon on Mojave.

Tried it on mojave (10.14 Beta, Build 18A371a). Doesn't work.
You forgot adding v5 to the list of commands at

    fi
    case "$2" in
      v1) CoreDisplayPatch 1;;
      v2) CoreDisplayPatch 2;;
	  v3) CoreDisplayPatch 3;;
	  v4) CoreDisplayPatch 4;;

But even after adding and rebooting it doesn't work.
Btw, here's the beta version of SwitchResX that support Mojave, in case somebody is looking for it: https://www.madrau.com/SwitchResXb.zip

I'd love if you could do a patch, here's my version of CoreDisplay: https://mega.nz/#!ATRDBSZB!3gfsvTLVyVJaB0Qx2pSWwFHQqzIcy05V9xzqv_uN4ig

Not much active on the project lately, but I’ll try some stuff somewhere around this week :)

@Floris497 Just curious if any progress has been made on this issue? :D

Not really.. turns out I have no hardware available anymore to test this on.. I have an 2011 MacMini.. but unfortunately it does not run Mojave.. my 2013 MacBook Air does not support 4k at all (some frame buffer problem.. I'll give that a look again actually) right now I'm going to test some stuff to see what I can get working.. but don't expect to much soon.. (a well maybe I have something today, who knows)

Uh.. it looks like the whole code is rewritten.. (maybe in swift.. I don't know enough about what the asm that swift produces looks like..) anyway.. I'm not here the next 2 days.. (just few hours today) if I don't get anything now.. it's gonna take some days.. anyone interested to break their system once I find something that MAYBE works? :D

Yes, if it does not work you can easily restore the old one. but just don't be scared of single user mode :) (I tried to patch 2 things.. both don't seem to work..)

Guys.. maybe I found something.. feel free to test it.. it does not crash my system, so it should be fairly safe.. but the big question.. does it work. please let me know what it does :)
CoreDisplay-patcher.command.zip

@Floris497 WORKS!
qq20180916-000856 2x

You are so quickly to find the new patch and it works perfectly!

Thanks very much!

commented

@Floris497 WORKS!
qq20180916-000856 2x

You are so quickly to find the new patch and it works perfectly!

Thanks very much!
I don't know about you, but mine still does not work.

screen shot 2018-09-15 at 1 53 02 pm

WHAT?!? It works??? Yusss!
Oh I guess I cheered too early.. anyway I’m not home till tomorrow..

commented

I have no idea if it's really work on his machine, but it doesn't work on mine.

I'm using WhateverGreen cdf patch and it appears to work fine for me in macOS (18A389)

CoreDisplay-patcher.command:
Find: 4D 8B 36 4D 85 F6 0F 85 29 FD FF FF 31 DB EB 47 Replace: 4D 8B 36 48 85 C0 0F 84 29 FD FF FF 31 DB EB 47

WhateverGreen cdf:
Find: BB 01 00 00 00 A8 01 0F 85 Replace: 31 DB 90 90 90 90 90 90 E9

Why are the two patches so different?

EDIT: I think gujiangjiang is also using WEG cdf patch so he probably just needed to reboot a few times for it to start working (I have to do this after an update).

@headkaze WEG -cdfon was no use on macOS 10.14 i have tested.

How you use WEG -cdfon to use cdfpatch?

-cdfon or enable-hdmi20?

Oh.. now I’m confused.. so the old patch is still working on hack? It isn’t on native mac... I kinda lost what is going on with it anyhow..

I use old patch with CDF or WEG are all not work and i dont know how to use it.

Right.. so there is nothing to do? I’m going to have a look at what is going om exactly tomorrow 🙃

now it works fine with your new patch.
but WEG still with no use and i dont know what happend and i tried -cdfon and enable-hdmi20 but both with no use.
Maybe it is Lilu related problem?

@Floris497 check out WhateverGreen (CoreDisplayFixup) patches here.

@headkaze thank you, I’ll check it out :)

@headkaze @Floris497
BIG strange.
I just replaced the CoreDisplay to the original with only [-cdfon] boot-args and it works...

But i have test one day more than 20 times but still cant boot yesterday and now it works with WEG.

strange...

Maybe it was the problem with 'updating'
Maybe fresh install will not be this problem.

Thanks for you to help me with this strange problem and i wll give it more test and feedback later.

Thanks!

@headkaze thank you, I’ll check it out :)

Hey Floris and thanks for all your work!
As soon as Mojave goes public (cant install beta on work machine) i'll test it on 2012 Air
i hope it works as the 21:9 is a lifesaver for me!

I’m don’t have much experience with bash script or pearl script but I have a 4K hackintosh laptop “Asus Vivobook N552VW” which I have fully working on High Sierra and I have been playing with Mojave betas, but I have had no luck on tonymacx86 where they deleted my post on the topic, I guess beta talk is a deathly sin over on their blog. I have everything working except graphic acceleration at 4K resolution on Mojave. I am highly anticipating any updates on this patch for macOS 10.14 Mojave. Especially since it is up for release on the 24th of the month. I am playing around with the source code and trying to understand how it is implemented. Later this week after college work is done I will test the code above to see if it works. What are some helpful sources to look at until release of a working patch to learn how to do these patches my self?

If you want to give the WhateverGreen (CoreDisplayFixup) patch a try using this script you can replace with the following lines (use at your own risk):

10.12.x and 10.13.0-10.13.3
sudo perl -i.bak -pe '$before = qr"\xB8\x01\x00\x00\x00\xF6\xC1\x01\x0F\x85"s;s/$before/\x33\xC0\x90\x90\x90\x90\x90\x90\x90\xE9/g' $CoreDisplayLocation

10.13.4+
sudo perl -i.bak -pe '$before = qr"\xBB\x01\x00\x00\x00\xA8\x01\x0F\x85"s;s/$before/\x31\xDB\x90\x90\x90\x90\x90\x90\xE9/g' $CoreDisplayLocation

I Installed Mojave and tried the script 10.13.4+ and got this message
"-i used with no filenames on the command line, reading from STDIN."
What am I expected to do?

I Installed Mojave and tried the script 10.13.4+ and got this message
"-i used with no filenames on the command line, reading from STDIN."
What am I expected to do?

did you install with -v5 ?

"$CoreDisplayLocation" is not file path :) better run this code by using v3/v4/v5 as described in README

"$CoreDisplayLocation" is not file path :) better run this code by using v3/v4/v5 as described in README

dear Floris did you have time to further test it on Mojave?

Latest patch mot working on my system either. (10.14 directly upgraded from High Sierra)
I have just installed Lilu and WhateverGreen in S/L/E with kext utility and voila! All resolutions working again (Intel HD4600)
Your patch worked like a charm until now, Floris!. I am very grateful for your effort!

Destrozeitor, how to do this?

Update: Lilu + WhateverGreen still works for me on 10.14.1 18B75 (2560 x 1440 @ 60 Hz).

WhateverGreen (old patch) still works for me (10.14 18A391 HD4600), macOS Mojave disables subpixel antialiasing by default, this enables it (run and re-login):

defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO

Trying to get this to work. Not even SwitchResX works. I am running the release version, not beta. Do you need to add the MD5 checksum for Mojave release?

"$CoreDisplayLocation" is not file path :) better run this code by using v3/v4/v5 as described in README

Which README file and which app are you referring to (for v3/v4/v5)? I'm having the same problem, swithresx worked fine but now I can't add my custom resolutions with the new macos mojave release.

That’s exactly what happens to me.

That's what I get too, mac mini late 2012 with an LG 2560x1080 monitor @50Hz

Same here. Had to create a new user, log in, install switchresx, create custom profile, then I copied the contents folder from the displays folder into my old account to flush out all the crap I put in. Works a treat now.

Guys.. I'm sorry, I am unavailable to do anything till 24th.. I hardly have time to sleep :)

Really looking forward for 10.14 Mojave support. Not having 60HZ available on my Macbook Pro 2017 over HDMI is really frustrating after it was working in High Sierra. @Floris497 Thanks for the good work. I have happy to test any patches to assist.

@aquadat0r Have you tried Lilu + WhateverGreen? It works for me without new patch (10.14 18A391, Intel HD4600, 2560*1440 60Hz).

For some reason 2560 X 1440 is not a problem. 2560 X 1080 is.

When I try the Lilu/WhateverGreen and the patch, I get the message:
"-i used with no filenames on the command line, reading from STDIN."

A couple people said install with -v5, but I can't figure out what that means. Do they mean use KCPM Utility Pro version 5?

Highly risky

not tested at al, did not even check if my Mac still boots.. but for the sake of it..

EDIT: New file..
CoreDisplay-patcher.command.zip

You are the man! Running perfectly in everyway on my setup.. I took precautions if not so anyone considering it just make sure you can recover. But I didn't have a single problem . Ran just like the normal releases. Thank you!!

screen shot 2018-10-07 at 10 15 22 pm

screen shot 2018-10-07 at 10 14 56 pm

Highly risky

not tested at al, did not even check if my Mac still boots.. but for the sake of it..
EDIT: New file..
CoreDisplay-patcher.command.zip

You are the man! Running perfectly in everyway on my setup.. I took precautions if not so anyone considering it just make sure you can recover. But I didn't have a single problem . Ran just like the normal releases. Thank you!!

screen shot 2018-10-07 at 10 15 22 pm

screen shot 2018-10-07 at 10 14 56 pm

Then we should expect it to work with 2560 x 1080 too, right?

WhateverGreen (old patch) still works for me (10.14 18A391 HD4600), macOS Mojave disables subpixel antialiasing by default, this enables it (run and re-login):

defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO

Would you mind pointing me in the right direction? Which old patch? and does it enable 4K 60Hz over HDMI 2.0? Thanks

@aquadat0r I'm using a 2K monitor, it enables 2560 x 1440 @ 60 Hz, just put the latest version of WhateverGreen.kext and Lilu.kext to CLOVER/kexts/other and reboot then it works.

@aquadat0r I'm using a 2K monitor, it enables 2560 x 1440 @ 60 Hz, just put the latest version of WhateverGreen.kext and Lilu.kext to CLOVER/kexts/other and reboot then it works.

Thanks, where do I get these files and what is CLOVER/kexts/other? I cannot find it on my system. I'm on a Macbook Pro 2017 and not a Hackintosh.

@aquadat0r You can download Lilu and WhateverGreen binary on their release page.

I'm using hackintosh with clover as bootloader. You may want to install the kexts with kext utility.

Highly risky

not tested at al, did not even check if my Mac still boots.. but for the sake of it..
EDIT: New file..
CoreDisplay-patcher.command.zip

You are the man! Running perfectly in everyway on my setup.. I took precautions if not so anyone considering it just make sure you can recover. But I didn't have a single problem . Ran just like the normal releases. Thank you!!

screen shot 2018-10-07 at 10 15 22 pm

screen shot 2018-10-07 at 10 14 56 pm

Did you install is with specific parameters? I cannot get it to work

@aquadat0r You can download Lilu and WhateverGreen binary on their release page.

I'm using hackintosh with clover as bootloader. You may want to install the kexts with kext utility.

Thanks, kext installed, rebooted, but still no 60Hz.

Highly risky

not tested at al, did not even check if my Mac still boots.. but for the sake of it..

EDIT: New file..
CoreDisplay-patcher.command.zip

THANK YOU!!!
Worked perfectly after upgrade from High Sierra to Mojave with Intel UHD630.
Called with arguments patch v4
Hint: First I had some color issues (looked like inverted, these were fixed by https://www.tonymacx86.com/threads/screen-changing-colors-after-update-10-12-4.217994/page-2#post-1486065)

I had the same problem in MacBook Pro 2012 with Mojave. Clean install is the solution.

Highly Risky Patch (with a small ninja edit to make 'patch v5' work clearly) worked fine on my Late 2012 Mac Mini.

Danke.

Highly Risky Patch (with a small ninja edit to make 'patch v5' work clearly) worked fine on my Late 2012 Mac Mini.

Danke.

can you elaborate? what small ninja edit?

i'm interested in 21:9 LG resolution, not 4k. i hope it works but it's a work machine and i don't want to risk it..

commented

It's not working for me either.
Ran it with v4 and v5 (with the linked fix to make v5 install work).

Got 2560x1440@60Hz on a Late 2013 iMac (Intel Iris Pro 5200 • Mojave • DP to HDMI adapter) by manually installing Lilu + WhateverGreen and adding "-cdfon" to the boot args.
(Note: I'd take this as a temporary fix, waiting for an update by Floris497)

Also tried on a Late 2012 rMBP with Intel HD Graphics 4000 (Both DP to HDMI and HDMI only), but it didn't work.

Highly Risky Patch (with a small ninja edit to make 'patch v5' work clearly) worked fine on my Late 2012 Mac Mini.
Danke.

can you elaborate? what small ninja edit?

i'm interested in 21:9 LG resolution, not 4k. i hope it works but it's a work machine and i don't want to risk it..

patch v5 worked for me, Macbook Air with 21:9 LG monitor. Small edit is adding v5) CoreDisplayPatch 5;; after the line 259

Highly Risky Patch (with a small ninja edit to make 'patch v5' work clearly) worked fine on my Late 2012 Mac Mini.
Danke.

can you elaborate? what small ninja edit?
i'm interested in 21:9 LG resolution, not 4k. i hope it works but it's a work machine and i don't want to risk it..

patch v5 worked for me, Macbook Air with 21:9 LG monitor. Small edit is adding v5) CoreDisplayPatch 5;; after the line 259

i'm really bad at this, can you please tell me where should i add this? wasn't v5 being added when installing it thru terminal?
what macbook air do you have? 2012?

I've added that line for you: CoreDisplay-patcher.command.zip

Run as usual ./CoreDisplay-patcher.command patch v5

PS: I have MacBookAir6,2; mid 2013 IIRC.

I've added that line for you: CoreDisplay-patcher.command.zip

Run as usual ./CoreDisplay-patcher.command patch v5

PS: I have MacBookAir6,2; mid 2013 IIRC.

thank you very much! mine is hd 4000, yours is hd 5000. i hope it works.. i have a time machine backup so it shouldn't be long to restore everything if needed

I've added that line for you: CoreDisplay-patcher.command.zip

Run as usual ./CoreDisplay-patcher.command patch v5

PS: I have MacBookAir6,2; mid 2013 IIRC.

unfortunately, it didn't work :(

Macbook Air 2013 has never worked.. unfortunately..

I hope to find some time later this week to check it out.. :)

Macbook Air 2013 has never worked.. unfortunately..

mine is 2012, hd4000 .. i really hope you can fix it! i'm willing to pay even!

I don’t really need money :) i need time ☺️
It could in theory work on hd4000

I don’t really need money :) i need time ☺️
It could in theory work on hd4000

i tried v4 and v5, reinstalling switchresx and everything. nada. on high sierra i just installed switchresx, patch v4 and the resolution autoadded to switchresx and works 2560x1080@60hz zero problems...

I hope to find some time later this week to check it out.. :)

That sounds wonderful, Floris 👍🏻
Here Mac mini Late 2012 so Intel HD 4000

I'm also on MacMini w/ HD4000 and LG 21:9

I tried the v5 patch. No luck, but at least it didn't break anything.

@Andrew-Morozko Does it work on 10.14.1? I am getting "Unknown CoreDisplay Found".

Hi! Working on a Mac Mini Late 2014
image
with LG Ultra HD (4K) monitor

The last update mentioned here (by @Andrew-Morozko) didn't work.
How could I accomplish the desired 4K@60fps working? :)

I don’t really need money :) i need time ☺️
It could in theory work on hd4000

do you think you'll be able to work on this?

Hm, actually, I think i can :) but interestingly enough.. the Hackintosh community doesn’t have any problems with the old patch.. so I’m going to check that out as well.. see if we can also use it still.

@Floris497 Not only the Hackintosh community would need it. Would be great to have 4k@60hz on old MacBook Pro... is it possible to get it on MacBook Pro late 2013 13-inch?

I know, It initially wasn’t even meant for Hackintosh :) always used it for my 2011 Mac Mini.. but it cannot update to Mojave on it.. so also it became difficult to test the patch.

@Floris497 I cant seem to get this to work on my MBP Mid 2015.

---- BEGINNING MD5 HASH SUMS ---- version: 10.14.1 build:18B75

     otool CoreDisplay: 6c76846ea2b77e2a5f933c260ae95471
 otool CoreDisplay.bak: 6c76846ea2b77e2a5f933c260ae95471
           CoreDisplay: 4a1d76ffd17e603e03c49e4712e448bd
       CoreDisplay.bak: aa9f53c7d3a85eda7dd221232a7011f0

---- ENDING MD5 HASH SUMS -------

Is this the right version

@headkaze: Yes! Your patch for 10.13.4+ works for me on 10.14.1 on a Late 2012 Mac mini with HD4000. Thank you very much.

Note that I seemed to have got my system into a confused state by trying previous patches, so I ended up doing a clean install just so that the CoreDisplay binary was clean, ready for patching. I presumably could have avoided this by being a bit more thorough at unpatching every failed patch, but some of us have to learn things the hard way.

screenshot 2018-11-20 at 10 02 45

If you want to give the WhateverGreen (CoreDisplayFixup) patch a try using this script you can replace with the following lines (use at your own risk):

10.12.x and 10.13.0-10.13.3
sudo perl -i.bak -pe '$before = qr"\xB8\x01\x00\x00\x00\xF6\xC1\x01\x0F\x85"s;s/$before/\x33\xC0\x90\x90\x90\x90\x90\x90\x90\xE9/g' $CoreDisplayLocation

10.13.4+
sudo perl -i.bak -pe '$before = qr"\xBB\x01\x00\x00\x00\xA8\x01\x0F\x85"s;s/$before/\x31\xDB\x90\x90\x90\x90\x90\x90\xE9/g' $CoreDisplayLocation

Thank you @push108 and @headkaze.
It worked perfectly on Mac Mini Late 2012 with HD4000 and LG UltraWide Monitor.

image

Worked for me also on Late 2012 Mac mini with HD4000.

Thanks guys!

     otool CoreDisplay: a7dec10f974decfad067d410560b850c
 otool CoreDisplay.bak: 6c76846ea2b77e2a5f933c260ae95471
           CoreDisplay: 1e51a5cc74be530c1265d3a97996035e
       CoreDisplay.bak: 7a46a80605f6d794e9e60612964ee5bf

@push108
Hey, could you please describe what you did step by step for noobs like me?:)
Thank you very much in advance!
In high Sierra it has always worked with -v4 patch and switchresx

Interesting! Will perform a clean install on another drive to see if this works.
Like devianter said, could you tell in full detail what you guys did? I spend hours with no reveil before.

@willstorm Are you working with 2 of these monitors then? 2560x1080 does not need the patch to my knowledge. I have 2 2560x1440 monitors and before Mojave in Mavericks I had this working (so HDMI also on 2560x1440 instead of the standard max of the blurry scaled 1980x1080).

@jeffjacobsen and @headkaze Similar question, please share your monitor setups. Not that I do not believe that it works at your setups but to learn how far you could push your pixel clocks after the patch.

commented

I just took the line of code that @headkaze suggested and put it in place of the original sudo perl line in CoreDisplay-patcher.command for case 5:

 5)  printf "Patching CoreDisplay with patch version 5\n"
        sudo perl -i.bak -pe '$before = qr"\xBB\x01\x00\x00\x00\xA8\x01\x0F\x85"s;s/$before/\x31\xDB\x90\x90\x90\x90\x90\x90\xE9/g' $CoreDisplayLocation
        sudo touch /System/Library/Extensions
  	printf "Re-signing $CoreDisplayLocation\n"
  	sudo codesign -f -s - $CoreDisplayLocation
	sudo update_dyld_shared_cache
        ;;

Then I ran ./CoreDisplay-patcher.command patch v5 to run the modified patch.

@jeffjacobsen Does it require WEG?

@jeffjacobsen Does it require WEG?

No, it just uses the same patch as WEG. I just converted for use in this script. Actual patch credit goes to Floris497 and PMheart (jmpq address optimizations)

I just took the line of code that @headkaze suggested and put it in place of the original sudo perl line in CoreDisplay-patcher.command for case 5:

 5)  printf "Patching CoreDisplay with patch version 5\n"
        sudo perl -i.bak -pe '$before = qr"\xBB\x01\x00\x00\x00\xA8\x01\x0F\x85"s;s/$before/\x31\xDB\x90\x90\x90\x90\x90\x90\xE9/g' $CoreDisplayLocation
        sudo touch /System/Library/Extensions
  	printf "Re-signing $CoreDisplayLocation\n"
  	sudo codesign -f -s - $CoreDisplayLocation
	sudo update_dyld_shared_cache
        ;;

Then I ran ./CoreDisplay-patcher.command patch v5 to run the modified patch.

Update: the system is able to boot after removing the file mentioned in this issue. #219 But still no 4k@60hz. Not sure if it is the problem of my DP-to-mDP adapter. DP works at 60hz on another Windows machine. The cable should work at 60hz as mentioned by some comments on Amazon.

---- BEGINNING MD5 HASH SUMS ---- version: 10.14.1 build:18B75

     otool CoreDisplay: a7dec10f974decfad067d410560b850c
 otool CoreDisplay.bak: 6c76846ea2b77e2a5f933c260ae95471
           CoreDisplay: 1fc96ba4caf17189a49b0c65af2f4bc5
       CoreDisplay.bak: 7a46a80605f6d794e9e60612964ee5bf

---- ENDING MD5 HASH SUMS -------

Didn't work on 10.14.1 (18B75), MacBook Pro (Retina, 13-inch, Late 2013). It just stuck at the boot progress bar and shows a spin.

Re-signing /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay
/System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay: replacing existing signature
/System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay: code object is not signed at all
In subcomponent: /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay.tbd
update_dyld_shared_cache: warning: x86_64h skipping because of bad install name /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/Resources/fcl-fc-1.dat
update_dyld_shared_cache: warning: x86_64h skipping because of bad install name /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/Resources/fcl-fc-2.dat
update_dyld_shared_cache: warning: x86_64h skipping because of bad install name /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/Resources/fcl-fc-3.dat
update_dyld_shared_cache: warning: i386 skipping because of bad install name /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/Resources/fcl-fc-1.dat
update_dyld_shared_cache: warning: i386 skipping because of bad install name /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/Resources/fcl-fc-2.dat
update_dyld_shared_cache: warning: i386 skipping because of bad install name /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/Resources/fcl-fc-3.dat
update_dyld_shared_cache: i386 incorporating 630 OS dylibs, tracking 457 others, building closures for 250 executables
update_dyld_shared_cache: warning: x86_64h rejected from cached dylibs: /System/Library/PrivateFrameworks/CreateML.framework/Versions/A/CreateML (("Could not find dependency '/System/Library/PrivateFrameworks/TuriCore.framework/Versions/A/TuriCore'"))
update_dyld_shared_cache: x86_64h incorporating 1360 OS dylibs, tracking 1002 others, building closures for 2126 executables
./CoreDisplay-patcher-2.command: line 107:   873 Killed: 9               sudo update_dyld_shared_cache
The code of CoreDisplay changed, the patch was probbably succesfull

My original MD5 matches the one here: #293

But it doesn't match with @jeffjacobsen 's:

---- BEGINNING MD5 HASH SUMS ---- version: 10.14.1 build:18B75

     otool CoreDisplay: a7dec10f974decfad067d410560b850c
 otool CoreDisplay.bak: 6c76846ea2b77e2a5f933c260ae95471
           CoreDisplay: f0e093b1b619d0280308d4dd12017720
       CoreDisplay.bak: 7a46a80605f6d794e9e60612964ee5bf

---- ENDING MD5 HASH SUMS -------

So in the previous update, I was able to boot with the patch without problems, but it doesn't seem to give me 4k@60hz. When I connect to a 4k monitor, macOS tries to connect with 4k@60 but the monitor shows a blank screen. I can tell because the desktop gets extended, as if I have a separate screen, and System Info shows that I am running 4k@60. SwitchResX also shows that I was running at 4k@60.

I have to select 4k@30 manually in SwitchResX in order to get the monitor to display anything.

I just took the line of code that @headkaze suggested and put it in place of the original sudo perl line in CoreDisplay-patcher.command for case 5:

 5)  printf "Patching CoreDisplay with patch version 5\n"
        sudo perl -i.bak -pe '$before = qr"\xBB\x01\x00\x00\x00\xA8\x01\x0F\x85"s;s/$before/\x31\xDB\x90\x90\x90\x90\x90\x90\xE9/g' $CoreDisplayLocation
        sudo touch /System/Library/Extensions
  	printf "Re-signing $CoreDisplayLocation\n"
  	sudo codesign -f -s - $CoreDisplayLocation
	sudo update_dyld_shared_cache
        ;;

Then I ran ./CoreDisplay-patcher.command patch v5 to run the modified patch.

THANK YOU!
MBA 2012 HD4000 + LG ultrawide 21:9 works at 2560x1080@60HZ

FINALLY :)