Jump to content

Lilu — kext and process patcher


vit9696
394 posts in this topic

Recommended Posts

Hi vit9696.

 

First of all. Thanks for your work!

I just want to know how to patch framework/custom kexts via Lilu, like previously AppleALC did through UserPatches.plist, although this may be not reliable in some cases...

 

Thanks in advance

 

Edit: I found something at Shiki.

But I'm curious that what some args mean like 'Skip' 'Section' etc...  :)

Edited by PMheart
Link to comment
Share on other sites

Hi vit9696.

 

First of all. Thanks for your work!

I just want to know how to patch framework/custom kexts via Lilu, like previously AppleALC did through UserPatches.plist, although this may be not reliable in some cases...

 

Thanks in advance

 

Edit: I found something at Shiki.

But I'm curious that what some args mean like 'Skip' 'Section' etc...  :)

Hi, as for kexts best examples are lvs's kexts (IntelGraphicsFixup and friends), they are reasonably simple and offer a good brief example of what one needs.

As for frameworks currently it is only safe to patch frameworks within a certain process, and yes, Shiki is generally a good example for it.

This line is basically all you need: https://github.com/vit9696/Shiki/blob/master/Shiki/kern_start.cpp#L39

  • Like 2
Link to comment
Share on other sites

Hi, as for kexts best examples are lvs's kexts (IntelGraphicsFixup and friends), they are reasonably simple and offer a good brief example of what one needs.

As for frameworks currently it is only safe to patch frameworks within a certain process, and yes, Shiki is generally a good example for it.

This line is basically all you need: https://github.com/vit9696/Shiki/blob/master/Shiki/kern_start.cpp#L39

That's amazing ! But now it's a little late... Time for some sleep. Will check later.

 

 

Sent from my iPhone 7 using Tapatalk

  • Like 1
Link to comment
Share on other sites

That's amazing ! But now it's a little late... Time for some sleep. Will check later.

 

 

Sent from my iPhone 7 using Tapatalk

Alright, I am usually busy and rarely visit insanely, so feel free to pm if you have concrete issues to investigate :).

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Plug-ins by @lvs1974

Don't set Lilu and these plug-ins in SLE or LE, it won't work. Use kexts injection from Clover.

 

IntelGraphicsFixup Superseded by WhateverGreen

Fixes boot logo on all known Intel Graphics.

Fixes PAVP freezes on Intel Azul, Skl, Kbl Graphics.
Fixes display initialization issues for Azul, Skl, Kbl Graphics.
 
NvidiaGraphicsFixup Superseded by WhateverGreen
Fixes an issue in AppleGraphicsDevicePolicy.kext so that we could use any ProductName, without the usual hang with a black screen.

Modifies macOS to recognize NVIDIA's web drivers as platform binaries. This resolves the issue with transparent windows without content, which appear for applications that use Metal and have Library Validation enabled. Common affected applications are iBooks and Little Snitch Network Monitor, though this patch is universal and fixes them all.

Injects IOVARendererID into GPU properties (required for Shiki-based solution for non-freezing Intel and/or any discrete GPU)

NVidiaAudio device to add connector-type, layout-id and other properties for HDMI audio (allows audio for HDMI, DP, Digital DVI ports)

 

Enable 3 & 25 mode hibernation on certain hardware.
Patching of IOPCIFamily to avoid hang & black screen after resume. (Option)
(Use the last FakeSMC.kext from @slice)
 
Supports AirPort_Brcm4360, AirPort_BrcmNIC and AirPort_BrcmNIC_MFG
Implements patch for passing chip id checking, in <=10.12 it's required for successful driver starting
Implements patch for "Third Party Device" (returns vendor name "Apple")
Implements patch for removing of white-list check
 
Edited by Andrey1970
  • Like 4
Link to comment
Share on other sites

  • 5 weeks later...

@vit9696

 

first of all, thank you for great work.

i want to report one. i can't use applelife site and russian lang very well

 

lvs1974's HibernationFixup is good working. i checked all. but i found one bug, after wakeup hibernation mode, i can't control brightness key. in setting, I can change it directly with the mouse.

 

i tried both dsdt patch and ssdt injection methods. but failed. I wonder if this is normal or not.

 

sorry.

 

thanks in advance

Link to comment
Share on other sites

@vit9696

 

first of all, thank you for great work.

i want to report one. i can't use applelife site and russian lang very well

 

lvs1974's HibernationFixup is good working. i checked all. but i found one bug, after wakeup hibernation mode, i can't control brightness key. in setting, I can change it directly with the mouse.

 

i tried both dsdt patch and ssdt injection methods. but failed. I wonder if this is normal or not.

 

sorry.

 

thanks in advance

@Sherlocks

Could you try to perform the following steps:

 

- Remove HibernationFixup.kext

- Set hibernatemode to 29 (you will have to set it manually in /Library/Preferences/com.apple.PowerManagement.[your UUID].plist).

- Put you PC into hibernation

- Turn on your PC and resume from hibernation

- Check whether you can control a brightness using keyboard

  • Like 3
Link to comment
Share on other sites

@Sherlocks

Could you try to perform the following steps:

 

- Remove HibernationFixup.kext

- Set hibernatemode to 29 (you will have to set it manually in /Library/Preferences/com.apple.PowerManagement.[your UUID].plist).

- Put you PC into hibernation

- Turn on your PC and resume from hibernation

- Check whether you can control a brightness using keyboard

 

hello lvs1974. i'm glad to meet you in here.

 

i tested hibernation 29. brightness control is no problem.

 

3/25 can't control brightness with hiberantion mode.

EmuVariableUefi-64.efi + lilu.kext + your hiberantion kext(1.1.4) + rc script + -hbfx-dump-nvram.

Link to comment
Share on other sites

hello lvs1974. i'm glad to meet you in here.

 

i tested hibernation 29. brightness control is no problem.

 

3/25 can't control brightness with hiberantion mode.

EmuVariableUefi-64.efi + lilu.kext + your hiberantion kext(1.1.4) + rc script + -hbfx-dump-nvram.

Hello Sherlocks, thanks for greetings!

 

So, you don't have a hardware NVRAM...

 

There is only one difference when we use HibernationFixup: nvram.plist is saved.

This means that clover will restore all saved nvram variables.

 

Could you do this:

- repeat one hibernation/resume (EmuVariableUefi-64.efi + lilu.kext + your hiberantion kext(1.1.4) + rc script + -hbfx-dump-nvram)

- after resume copy nvram.plist from your boot disc to EFI partition and remove clover rc.shutdown script (or just clear executable attribute for it using chmod -x)

- shutdown your PC

- turn on again

- check whether you can control a brightness using keyboard

 

I just want to be sure that something stored in nvram.plist causes this issue.

Link to comment
Share on other sites

Hello Sherlocks, thanks for greetings!

 

So, you don't have a hardware NVRAM...

 

There is only one difference when we use HibernationFixup: nvram.plist is saved.

This means that clover will restore all saved nvram variables.

 

Could you do this:

- repeat one hibernation/resume (EmuVariableUefi-64.efi + lilu.kext + your hiberantion kext(1.1.4) + rc script + -hbfx-dump-nvram)

- after resume copy nvram.plist from your boot disc to EFI partition and remove clover rc.shutdown script (or just clear executable attribute for it using chmod -x)

- shutdown your PC

- turn on again

- check whether you can control a brightness using keyboard

 

I just want to be sure that something stored in nvram.plist causes this issue.

I dont understand all steps.

I have only nvram file in ESP.

1.implement combination(nvram+lilu+~).

2.remove both nvram file(copy to desktop) and rc script

3.reboot

4.boot osx, go hibernation.

5.enter hibernationed disk

6.test

 

Sorry my english

Right?

 

 

Add. Above steps, no need hibernation mode

Also i cant see debug log with bootarg for debug in kernel log. Is it normal?

 

Okay i understand you want.

First. restore nvram with hibernation mode(cant control brightness)

Two. Remove rcscript(avoid to save new nvram file) and bootarg.

Tree. Reboot.

Four. After login, test brightness with nvram(cant brightness)

 

 

나의 LG-F410S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

Okay i understand you want.

First. restore nvram with hibernation mode(cant control brightness)

Two. Remove rcscript(avoid to save new nvram file) and bootarg.

Tree. Reboot.

Four. After login, test brightness with nvram(cant brightness)

 

 

나의 LG-F410S 의 Tapatalk에서 보냄

Correct!

 

Do you have nvram.plist which causes this issue (step Four)?

Could you attach and post it here?

Can you reproduce this issue after every new restart?

  • Like 1
Link to comment
Share on other sites

Correct!

 

Do you have nvram.plist which causes this issue (step Four)?

Could you attach and post it here?

Can you reproduce this issue after every new restart?

 

 

no more reproduce this issue after reboot(step4)

 

i have only nvram.plist in ESP(nvram file gernerated from rc script. you already know).

 

but i see your hibernationfix makes nvram in Root. i noticed after rcscript remove. because rc script automately remove nvram file in root to avoid dummy or filevault2

 

so i take a nvram from Root. 

 

Since there are two nvram files, something seems to be causing a problem(not sure).
 
In hibernation 29, nvram files are always present on ESP partitions.
 
thanks in advance

nvram.zip

Link to comment
Share on other sites

 

no more reproduce this issue after reboot(step4)

 

i have only nvram.plist in ESP(nvram file gernerated from rc script. you already know).

 

but i see your hibernationfix makes nvram in Root. i noticed after rcscript remove. because rc script automately remove nvram file in root to avoid dummy or filevault2

 

so i take a nvram from Root. 

 

Since there are two nvram files, something seems to be causing a problem(not sure).
 
In hibernation 29, nvram files are always present on ESP partitions.
 
thanks in advance

 

Yes, HibernationFixup creates nvram.plist in the root folder of boot disk.

There's no any problem with two nvram.plist, because Clover chooses the newest one (checks modification time).

So, you need to get nvram.plist from the root folder and post it here.

Link to comment
Share on other sites

Yes, HibernationFixup creates nvram.plist in the root folder of boot disk.

There's no any problem with two nvram.plist, because Clover chooses the newest one (checks modification time).

So, you need to get nvram.plist from the root folder and post it here.

 

okay

i attached file on reply above.

both nvram file in ESP and Root

Link to comment
Share on other sites

I don't see a big difference...

 

Could you try to remove SMCHelper.efi and repeat the same actions?

 

And after that could you try attached FakeSMC & CPUSensors instead of installed on your system? 

 

strange issue resolved now.

 

hmm..

 

both SMCHelper.efi and FakeSMC & CPUSensors cases, no luck. still can't control brightness except volume up & down.

 

 

1:999  0:000  Use origin smbios table type 1 guid.

1:999  0:000  PrepareHibernation:
1:999  0:000      read prefs \Library\Preferences\com.apple.PowerManagement.plist status=Success
1:999  0:000      using default sleep image name = \private\var\vm\sleepimage
1:999  0:000      returning previously calculated offset: 2A76255000
1:999  0:000   SleepImageOffset: 2A76255000
2:000  0:000  02 01 0C 00 D0 41 03 0A 00 00 00 00 01 01 06 00 | .....A..........
2:000  0:000  00 17 03 12 0A 00 01 00 00 00 00 00 04 04 1A 00 | ................
2:000  0:000  32 00 41 00 37 00 36 00 32 00 35 00 35 00 30 00 | 2.A.7.6.2.5.5.0.
2:000  0:000  30 00 30 00 00 00 7F FF 04 00                   | 0.0.......
2:000  0:000  boot-image before: PciRoot(0x0)\Pci(0x17,0x0)\Sata(0x1,0x0,0x0)\2A76255000
2:000  0:000  DeleteBootOption: Boot0082
2:000  0:000   Boot0082 deleted
2:000  0:000  DeleteFromBootOrder: 0082
2:000  0:000  BootOrder: 7: Boot0007, Boot000C, Boot0006, Boot0005, Boot0008, Boot0009, Boot000B
2:000  0:000  Not found
2:000  0:000  Options 0082 was not deleted: Not Found
2:000  0:000   IOHibernateRTCVariables found - will be used as boot-switch-vars
2:002  0:002  Custom boot is disabled
2:002  0:000  Closing events for wake
Link to comment
Share on other sites

strange issue resolved now.

 

hmm..

 

both SMCHelper.efi and FakeSMC & CPUSensors cases, no luck. still can't control brightness except volume up & down.

Don't quite understand: what is the issue has been resolved?

What do you mean?

Link to comment
Share on other sites

Don't quite understand: what is the issue has been resolved?

What do you mean?

Q.what do you mean?

A.i can't suddenly use hibernation mode 3 and 25. Only hold black screen. I dont know exactly why happen. I just return my vanilla setting. And try your hibernation setting(kext, bootarg, rcscript) again. Then i got hibernation mode.

 

 

Brigtness control is still no luck on any setting(remove SMCHelper. Use your FakeSMC)

 

Between 29 and 3, can i check something? Example. Debug log or others.

 

나의 LG-F410S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

Q.what do you mean?

A.i can't suddenly use hibernation mode 3 and 25. Only hold black screen. I dont know exactly why happen. I just return my vanilla setting. And try your hibernation setting(kext, bootarg, rcscript) again. Then i got hibernation mode.

 

 

Brigtness control is still no luck on any setting(remove SMCHelper. Use your FakeSMC)

 

Between 29 and 3, can i check something? Example. Debug log or others.

 

나의 LG-F410S 의 Tapatalk에서 보냄

You can also try hibernate mode 59.

Debug logs are useless here.

Also you can try to set standby and autopoweroff to 0 in pmset.

 

No more ideas.

Probably you have some dedicated ACPI method in DSDT to control a brightness.

Probably it has something common with embedded controller.

  • Like 1
Link to comment
Share on other sites

You can also try hibernate mode 59.

Debug logs are useless here.

Also you can try to set standby and autopoweroff to 0 in pmset.

 

No more ideas.

Probably you have some dedicated ACPI method in DSDT to control a brightness.

Probably it has something common with embedded controller.

Thanks.

I dont know exactly why happen this problem. So just found and report it you.

Because i like debug and report.

 

Thank you for your help

Have a great day.

 

 

나의 LG-F410S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

×
×
  • Create New...