sys_patch_detect: Revise AMFI logic

Currently the AMFI level requirement will be determined by the GPU needed.
- Intel iGPUs: Only Library Validation patch (`_cs_require_lv`)
- Nvidia Kepler and GCN: Full AMFI needs to be disabled (`amfi=0x80`)

If you have a mixed GPU system, the highest patch requirement will be chosen (ie. `amfi=0x80` on iMac15,1)
This commit is contained in:
Mykola Grymalyuk
2022-09-14 07:57:41 -06:00
parent 7fc2d478f2
commit 012a629100
3 changed files with 42 additions and 16 deletions

View File

@@ -95,13 +95,16 @@ class amfi_configuration_detection:
# Levels:
# - 1. Library Validation (Monterey and Older)
# - 2. Library Validation and Signature Checks (Ventura and Newer)
# - 3. Disable all AMFI checks
if level > 2 or level < 1:
raise ValueError("Invalid AMFI Configuration Level")
if level == 0:
return True
if level == 1:
return self.SKIP_LIBRARY_VALIDATION
if level == 2:
return bool(self.SKIP_LIBRARY_VALIDATION and self.AMFI_ALLOW_INVALID_SIGNATURE)
if level == 3:
return self.AMFI_ALLOW_EVERYTHING
return False