Jump to content

AppleGraphicsDevicePolicy "on the fly" patching - impossible? (alternate idea, but still does not seem to work)


frankiee
 Share

120 posts in this topic

Recommended Posts

which kind of board-id are you using ?

Mac-F2238BAE which should match imac11,3  which is what I'm using for my SMBIOS config.

 

UPDATE:  So I just deleted a kext from /System/Library/Extensions then rebooted and I was back to getting the dreaded black screen.  I'm assuming the values entered in to fakesmc were never being used and I was in fact using an old kext cache with the modified AGDP.  I can't remember if I regenerated the kext cache after restoring the original AGPD.  I edited AGPD directly and now I'm back to functioning graphics.

post-51840-0-96180100-1474642674_thumb.png

Link to comment
Share on other sites

  • 3 weeks later...

Basically :

- reinstall Apple's version of AppleGraphicsControl.kext and AppleGraphicsDevicePolicy.kext

- just to be sure, repair permissions :

sudo /usr/libexec/repair_packages --verify --standard-pkgs --volume / 

 - mount the EFI partition, locate FakeSMC.kext into it

- add informations to its Info.plist, as this commit does

 

 

It doesn't work for me on 10.11.6...   :(

 

I have 2 monitors, one connected via DVI DP and the other via HDMI.

Edited by pit256
Link to comment
Share on other sites

  • 1 month later...

Hi,

 

Here are binary patch on the fly for clover, will not work during install process because AppleGraphicsDevicePolicy is not in kernelcache.

 

kext check first if config = "none", this patch replace opcode jump equal to unconditional jump.  :)

 

El Capitan 

 

Search 85 C0 74 25 48 8B 03 48 8D 75 A0

Replace 85 C0 EB 25 48 8B 03 48 8D 75 A0

 

Sierra

 

Search 85 C0 74 2C 49 8B 07 48 8D 75 A0

Replace 85 C0 EB 2C 49 8B 07 48 8D 75 A0

 

Fred

  • Like 4
Link to comment
Share on other sites

Hi,

 

Here are binary patch on the fly for clover, will not work during install process because AppleGraphicsDevicePolicy is not in kernelcache.

 

kext check first if config = "none", this patch replace opcode jump equal to unconditional jump.  :)

 

El Capitan 

 

Search 85 C0 74 25 48 8B 03 48 8D 75 A0

Replace 85 C0 EB 25 48 8B 03 48 8D 75 A0

 

Sierra

 

Search 85 C0 74 2C 49 8B 07 48 8D 75 A0

Replace 85 C0 EB 2C 49 8B 07 48 8D 75 A0

 

Fred

Will try this tonight, thanks!

 

EDIT: Confirmed! The following works on Sierra 10.12.1. Thanks for your hard work.

<dict>
	<key>Comment</key>
	<string>[FredWst] NVIDIA Black Screen fix / Sierra</string>
	<key>Disabled</key>
	<false/>
	<key>Find</key>
	<data>
	hcB0LEmLB0iNdaA=
	</data>
	<key>Name</key>
	<string>AppleGraphicsDevicePolicy</string>
	<key>Replace</key>
	<data>
	hcDrLEmLB0iNdaA=
	</data>
</dict>
  • Like 3
Link to comment
Share on other sites

i do not have any nv cards to test so feel free to test or improve the edit the info.plist if needed.

Link to comment
Share on other sites

 

Will try this tonight, thanks!

 

EDIT: Confirmed! The following works on Sierra 10.12.1. Thanks for your hard work.

<dict>
	<key>Comment</key>
	<string>[FredWst] NVIDIA Black Screen fix / Sierra</string>
	<key>Disabled</key>
	<false/>
	<key>Find</key>
	<data>
	hcB0LEmLB0iNdaA=
	</data>
	<key>Name</key>
	<string>AppleGraphicsDevicePolicy</string>
	<key>Replace</key>
	<data>
	hcDrLEmLB0iNdaA=
	</data>
</dict>

Hi, is it working even when you rebuild kext cache?

why not patch in fakesmc seems cleaner to me like the sample

I try patching via fakesmc week later, but it never work for me.

Link to comment
Share on other sites

Hi, it it working even when you rebuild kext cache?

I try patching via fakesmc week later, but it never work for me.

Yes it does. I restored the original kext, cleaned kext caches, applied patch and reboot. All fine.

Link to comment
Share on other sites

inject vendor/device id aka vesa mode then no need for nv_disable=1 flag

  • Like 1
Link to comment
Share on other sites

You can't think of a way to have this working on macOS Installer without nv_disable=1, right? That would be the holy grail.

 

Maybe you can try to Force AppleGraphicsDevicePolicy.kext to load, I'll try tomorrow.

 

<key>ForceKextsToLoad</key>

<array>

<string>/System/Library/Extensions/AppleGraphicsControl.kext/Contents/Plugins/AppleGraphicsDevicePolicy.kext</string>

</array>

 

Fred

 

​Edit : it doesn't not work: recovery and install

Link to comment
Share on other sites

  • 2 weeks later...

 

Will try this tonight, thanks!

 

EDIT: Confirmed! The following works on Sierra 10.12.1. Thanks for your hard work.

<dict>
	<key>Comment</key>
	<string>[FredWst] NVIDIA Black Screen fix / Sierra</string>
	<key>Disabled</key>
	<false/>
	<key>Find</key>
	<data>
	hcB0LEmLB0iNdaA=
	</data>
	<key>Name</key>
	<string>AppleGraphicsDevicePolicy</string>
	<key>Replace</key>
	<data>
	hcDrLEmLB0iNdaA=
	</data>
</dict>

 

Thanks, this finally fixed the nvidia black screen issue without having to modify the Info.plist directly. I'm running with SIP enabled again :)

  • Like 2
Link to comment
Share on other sites

Hi,

 

 

Here is the patch using AppleALC : AGPM-AppleALC-patchs.zip

 

Best than clover because works in recover and boot mode. (Clover patch kernelcache, AppleALC on the fly looking at what is loading ...)

 

Maybe you need to change Device or and vendor according to your hardware.

Vit9696 told me to try with HDEF, it works for me.

 

 

Fred

Link to comment
Share on other sites

Hi,

 

 

Here is the patch using AppleALC : attachicon.gifAGPM-AppleALC-patchs.zip

 

Best than clover because works in recover and boot mode. (Clover patch kernelcache, AppleALC on the fly looking at what is loading ...)

 

Maybe you need to change Device or and vendor according to your hardware.

Vit9696 told me to try with HDEF, it works for me.

 

 

Fred

Fred, I am sure this is another great work of yours. Personally I don't know how to use this, is there an online guide, or care to explain a bit?

Link to comment
Share on other sites

Hi,

 

There is a little tweak you must do to make it works and you need to build.

You need to replace HDEF device 0x8ca0 with your.

 

AppleALC has not been done for this king of patch, so if you want it to work, you'll need to build with patch I provided and replace with your HDEF device id.

 

Fred

Link to comment
Share on other sites

Even though AppleALC does have a generic kext patcher, it is not designed to be used with anything aside audio-specific patches for various reasons.

The main intent is relatively simple: AppleALC is a kext used for audio stuff, it is not a generic replacement for a bootloader patcher feature.

Each patch performed by AppleALC is not as fast as the one possibly made by a bootloader, and in recovery/installer it even increases the memory footprint. While in AppleHDA it is not so noticeable, if every kext is patched with AppleALC, it will sure be.

 

If you badly need to perform hacky stuff with AppleALC… you could always do it by adding the patch to your audio codec/controller, so that it gets applied. After all I myself sometimes do it to test stuff.

However, it is definitely not something I would encourage trying. If Clover cannot patch kexts outside of kextcache… it is just a Clover issue and for sure it is not a reason to rape AppleALC.

  • Like 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...