├── AMFIExemption.xcodeproj └── project.pbxproj ├── AMFIExemption ├── AMFIExemptionList.cpp ├── AMFIExemptionList.h ├── Info.plist └── kern_start.cpp ├── LICENSE └── README.md /AMFIExemption.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CEC5F6FA2455FC5700902EFC /* AMFIExemptionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEC5F6F82455FC5700902EFC /* AMFIExemptionList.cpp */; }; 11 | CEC5F6FB2455FC5700902EFC /* AMFIExemptionList.h in Headers */ = {isa = PBXBuildFile; fileRef = CEC5F6F92455FC5700902EFC /* AMFIExemptionList.h */; }; 12 | CEDE8D7B22984F8F00C73034 /* libkmod.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CEDE8D6E22984F7700C73034 /* libkmod.a */; }; 13 | CEDE8D7C22984FE600C73034 /* plugin_start.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEDE8D7822984F7700C73034 /* plugin_start.cpp */; }; 14 | CEDE8D7E2298501600C73034 /* kern_start.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEDE8D7D2298501600C73034 /* kern_start.cpp */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | CEC5F6F82455FC5700902EFC /* AMFIExemptionList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AMFIExemptionList.cpp; sourceTree = ""; }; 19 | CEC5F6F92455FC5700902EFC /* AMFIExemptionList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AMFIExemptionList.h; sourceTree = ""; }; 20 | CEDE8CE522984C0800C73034 /* AMFIExemption.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AMFIExemption.kext; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | CEDE8CEC22984C0800C73034 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 22 | CEDE8D4D22984F7600C73034 /* kern_config.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_config.hpp; sourceTree = ""; }; 23 | CEDE8D4E22984F7600C73034 /* kern_atomic.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_atomic.hpp; sourceTree = ""; }; 24 | CEDE8D4F22984F7600C73034 /* kern_time.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_time.hpp; sourceTree = ""; }; 25 | CEDE8D5022984F7600C73034 /* kern_nvram.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_nvram.hpp; sourceTree = ""; }; 26 | CEDE8D5122984F7600C73034 /* kern_cpu.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_cpu.hpp; sourceTree = ""; }; 27 | CEDE8D5222984F7600C73034 /* kern_devinfo.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_devinfo.hpp; sourceTree = ""; }; 28 | CEDE8D5322984F7600C73034 /* kern_efi.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_efi.hpp; sourceTree = ""; }; 29 | CEDE8D5422984F7600C73034 /* kern_policy.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_policy.hpp; sourceTree = ""; }; 30 | CEDE8D5522984F7600C73034 /* kern_user.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_user.hpp; sourceTree = ""; }; 31 | CEDE8D5622984F7600C73034 /* plugin_start.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = plugin_start.hpp; sourceTree = ""; }; 32 | CEDE8D5722984F7600C73034 /* kern_iokit.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_iokit.hpp; sourceTree = ""; }; 33 | CEDE8D5822984F7600C73034 /* kern_crypto.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_crypto.hpp; sourceTree = ""; }; 34 | CEDE8D5922984F7600C73034 /* kern_mach.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_mach.hpp; sourceTree = ""; }; 35 | CEDE8D5A22984F7600C73034 /* kern_compression.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_compression.hpp; sourceTree = ""; }; 36 | CEDE8D5B22984F7600C73034 /* kern_file.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_file.hpp; sourceTree = ""; }; 37 | CEDE8D5C22984F7600C73034 /* kern_rtc.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_rtc.hpp; sourceTree = ""; }; 38 | CEDE8D5D22984F7700C73034 /* kern_disasm.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_disasm.hpp; sourceTree = ""; }; 39 | CEDE8D5F22984F7700C73034 /* capstone.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = capstone.h; sourceTree = ""; }; 40 | CEDE8D6022984F7700C73034 /* mips.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mips.h; sourceTree = ""; }; 41 | CEDE8D6122984F7700C73034 /* sparc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sparc.h; sourceTree = ""; }; 42 | CEDE8D6222984F7700C73034 /* systemz.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = systemz.h; sourceTree = ""; }; 43 | CEDE8D6322984F7700C73034 /* arm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = arm.h; sourceTree = ""; }; 44 | CEDE8D6422984F7700C73034 /* x86.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = x86.h; sourceTree = ""; }; 45 | CEDE8D6522984F7700C73034 /* ppc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ppc.h; sourceTree = ""; }; 46 | CEDE8D6622984F7700C73034 /* arm64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = arm64.h; sourceTree = ""; }; 47 | CEDE8D6722984F7700C73034 /* xcore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = xcore.h; sourceTree = ""; }; 48 | CEDE8D6822984F7700C73034 /* platform.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = ""; }; 49 | CEDE8D6922984F7700C73034 /* kern_patcher.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_patcher.hpp; sourceTree = ""; }; 50 | CEDE8D6A22984F7700C73034 /* kern_compat.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_compat.hpp; sourceTree = ""; }; 51 | CEDE8D6B22984F7700C73034 /* kern_api.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_api.hpp; sourceTree = ""; }; 52 | CEDE8D6C22984F7700C73034 /* kern_util.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = kern_util.hpp; sourceTree = ""; }; 53 | CEDE8D6E22984F7700C73034 /* libkmod.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libkmod.a; sourceTree = ""; }; 54 | CEDE8D7022984F7700C73034 /* entry64.S */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = entry64.S; sourceTree = ""; }; 55 | CEDE8D7122984F7700C73034 /* build.tool */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build.tool; sourceTree = ""; }; 56 | CEDE8D7222984F7700C73034 /* entry32.S */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = entry32.S; sourceTree = ""; }; 57 | CEDE8D7322984F7700C73034 /* wrappers.inc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.pascal; path = wrappers.inc; sourceTree = ""; }; 58 | CEDE8D7522984F7700C73034 /* mac_framework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mac_framework.h; sourceTree = ""; }; 59 | CEDE8D7622984F7700C73034 /* mac_policy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mac_policy.h; sourceTree = ""; }; 60 | CEDE8D7722984F7700C73034 /* _label.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _label.h; sourceTree = ""; }; 61 | CEDE8D7822984F7700C73034 /* plugin_start.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = plugin_start.cpp; sourceTree = ""; }; 62 | CEDE8D7922984F7700C73034 /* LegacyIOService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyIOService.h; sourceTree = ""; }; 63 | CEDE8D7D2298501600C73034 /* kern_start.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = kern_start.cpp; sourceTree = ""; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | CEDE8CE222984C0800C73034 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | CEDE8D7B22984F8F00C73034 /* libkmod.a in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | CEDE8CDB22984C0800C73034 = { 79 | isa = PBXGroup; 80 | children = ( 81 | CEDE8D4B22984F5B00C73034 /* SDK */, 82 | CEDE8CE722984C0800C73034 /* AMFIExemption */, 83 | CEDE8CE622984C0800C73034 /* Products */, 84 | ); 85 | sourceTree = ""; 86 | }; 87 | CEDE8CE622984C0800C73034 /* Products */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | CEDE8CE522984C0800C73034 /* AMFIExemption.kext */, 91 | ); 92 | name = Products; 93 | sourceTree = ""; 94 | }; 95 | CEDE8CE722984C0800C73034 /* AMFIExemption */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | CEDE8CEC22984C0800C73034 /* Info.plist */, 99 | CEDE8D7D2298501600C73034 /* kern_start.cpp */, 100 | CEC5F6F82455FC5700902EFC /* AMFIExemptionList.cpp */, 101 | CEC5F6F92455FC5700902EFC /* AMFIExemptionList.h */, 102 | ); 103 | path = AMFIExemption; 104 | sourceTree = ""; 105 | }; 106 | CEDE8D4B22984F5B00C73034 /* SDK */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | CEDE8D4C22984F7600C73034 /* Headers */, 110 | CEDE8D6D22984F7700C73034 /* Library */, 111 | ); 112 | name = SDK; 113 | sourceTree = ""; 114 | }; 115 | CEDE8D4C22984F7600C73034 /* Headers */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | CEDE8D4D22984F7600C73034 /* kern_config.hpp */, 119 | CEDE8D4E22984F7600C73034 /* kern_atomic.hpp */, 120 | CEDE8D4F22984F7600C73034 /* kern_time.hpp */, 121 | CEDE8D5022984F7600C73034 /* kern_nvram.hpp */, 122 | CEDE8D5122984F7600C73034 /* kern_cpu.hpp */, 123 | CEDE8D5222984F7600C73034 /* kern_devinfo.hpp */, 124 | CEDE8D5322984F7600C73034 /* kern_efi.hpp */, 125 | CEDE8D5422984F7600C73034 /* kern_policy.hpp */, 126 | CEDE8D5522984F7600C73034 /* kern_user.hpp */, 127 | CEDE8D5622984F7600C73034 /* plugin_start.hpp */, 128 | CEDE8D5722984F7600C73034 /* kern_iokit.hpp */, 129 | CEDE8D5822984F7600C73034 /* kern_crypto.hpp */, 130 | CEDE8D5922984F7600C73034 /* kern_mach.hpp */, 131 | CEDE8D5A22984F7600C73034 /* kern_compression.hpp */, 132 | CEDE8D5B22984F7600C73034 /* kern_file.hpp */, 133 | CEDE8D5C22984F7600C73034 /* kern_rtc.hpp */, 134 | CEDE8D5D22984F7700C73034 /* kern_disasm.hpp */, 135 | CEDE8D5E22984F7700C73034 /* capstone */, 136 | CEDE8D6922984F7700C73034 /* kern_patcher.hpp */, 137 | CEDE8D6A22984F7700C73034 /* kern_compat.hpp */, 138 | CEDE8D6B22984F7700C73034 /* kern_api.hpp */, 139 | CEDE8D6C22984F7700C73034 /* kern_util.hpp */, 140 | ); 141 | name = Headers; 142 | path = Lilu.kext/Contents/Resources/Headers; 143 | sourceTree = ""; 144 | }; 145 | CEDE8D5E22984F7700C73034 /* capstone */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | CEDE8D5F22984F7700C73034 /* capstone.h */, 149 | CEDE8D6022984F7700C73034 /* mips.h */, 150 | CEDE8D6122984F7700C73034 /* sparc.h */, 151 | CEDE8D6222984F7700C73034 /* systemz.h */, 152 | CEDE8D6322984F7700C73034 /* arm.h */, 153 | CEDE8D6422984F7700C73034 /* x86.h */, 154 | CEDE8D6522984F7700C73034 /* ppc.h */, 155 | CEDE8D6622984F7700C73034 /* arm64.h */, 156 | CEDE8D6722984F7700C73034 /* xcore.h */, 157 | CEDE8D6822984F7700C73034 /* platform.h */, 158 | ); 159 | path = capstone; 160 | sourceTree = ""; 161 | }; 162 | CEDE8D6D22984F7700C73034 /* Library */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | CEDE8D6E22984F7700C73034 /* libkmod.a */, 166 | CEDE8D6F22984F7700C73034 /* wrappers */, 167 | CEDE8D7422984F7700C73034 /* security */, 168 | CEDE8D7822984F7700C73034 /* plugin_start.cpp */, 169 | CEDE8D7922984F7700C73034 /* LegacyIOService.h */, 170 | ); 171 | name = Library; 172 | path = Lilu.kext/Contents/Resources/Library; 173 | sourceTree = ""; 174 | }; 175 | CEDE8D6F22984F7700C73034 /* wrappers */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | CEDE8D7022984F7700C73034 /* entry64.S */, 179 | CEDE8D7122984F7700C73034 /* build.tool */, 180 | CEDE8D7222984F7700C73034 /* entry32.S */, 181 | CEDE8D7322984F7700C73034 /* wrappers.inc */, 182 | ); 183 | path = wrappers; 184 | sourceTree = ""; 185 | }; 186 | CEDE8D7422984F7700C73034 /* security */ = { 187 | isa = PBXGroup; 188 | children = ( 189 | CEDE8D7522984F7700C73034 /* mac_framework.h */, 190 | CEDE8D7622984F7700C73034 /* mac_policy.h */, 191 | CEDE8D7722984F7700C73034 /* _label.h */, 192 | ); 193 | path = security; 194 | sourceTree = ""; 195 | }; 196 | /* End PBXGroup section */ 197 | 198 | /* Begin PBXHeadersBuildPhase section */ 199 | CEDE8CE022984C0800C73034 /* Headers */ = { 200 | isa = PBXHeadersBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | CEC5F6FB2455FC5700902EFC /* AMFIExemptionList.h in Headers */, 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | /* End PBXHeadersBuildPhase section */ 208 | 209 | /* Begin PBXNativeTarget section */ 210 | CEDE8CE422984C0800C73034 /* AMFIExemption */ = { 211 | isa = PBXNativeTarget; 212 | buildConfigurationList = CEDE8CEF22984C0800C73034 /* Build configuration list for PBXNativeTarget "AMFIExemption" */; 213 | buildPhases = ( 214 | CEDE8CE022984C0800C73034 /* Headers */, 215 | CEDE8CE122984C0800C73034 /* Sources */, 216 | CEDE8CE222984C0800C73034 /* Frameworks */, 217 | CEDE8CE322984C0800C73034 /* Resources */, 218 | ); 219 | buildRules = ( 220 | ); 221 | dependencies = ( 222 | ); 223 | name = AMFIExemption; 224 | productName = AMFIExemption; 225 | productReference = CEDE8CE522984C0800C73034 /* AMFIExemption.kext */; 226 | productType = "com.apple.product-type.kernel-extension"; 227 | }; 228 | /* End PBXNativeTarget section */ 229 | 230 | /* Begin PBXProject section */ 231 | CEDE8CDC22984C0800C73034 /* Project object */ = { 232 | isa = PBXProject; 233 | attributes = { 234 | LastUpgradeCheck = 1020; 235 | ORGANIZATIONNAME = osy86; 236 | TargetAttributes = { 237 | CEDE8CE422984C0800C73034 = { 238 | CreatedOnToolsVersion = 10.2.1; 239 | }; 240 | }; 241 | }; 242 | buildConfigurationList = CEDE8CDF22984C0800C73034 /* Build configuration list for PBXProject "AMFIExemption" */; 243 | compatibilityVersion = "Xcode 9.3"; 244 | developmentRegion = en; 245 | hasScannedForEncodings = 0; 246 | knownRegions = ( 247 | en, 248 | ); 249 | mainGroup = CEDE8CDB22984C0800C73034; 250 | productRefGroup = CEDE8CE622984C0800C73034 /* Products */; 251 | projectDirPath = ""; 252 | projectRoot = ""; 253 | targets = ( 254 | CEDE8CE422984C0800C73034 /* AMFIExemption */, 255 | ); 256 | }; 257 | /* End PBXProject section */ 258 | 259 | /* Begin PBXResourcesBuildPhase section */ 260 | CEDE8CE322984C0800C73034 /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | /* End PBXResourcesBuildPhase section */ 268 | 269 | /* Begin PBXSourcesBuildPhase section */ 270 | CEDE8CE122984C0800C73034 /* Sources */ = { 271 | isa = PBXSourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | CEDE8D7C22984FE600C73034 /* plugin_start.cpp in Sources */, 275 | CEC5F6FA2455FC5700902EFC /* AMFIExemptionList.cpp in Sources */, 276 | CEDE8D7E2298501600C73034 /* kern_start.cpp in Sources */, 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | /* End PBXSourcesBuildPhase section */ 281 | 282 | /* Begin XCBuildConfiguration section */ 283 | CEDE8CED22984C0800C73034 /* Debug */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | ALWAYS_SEARCH_USER_PATHS = NO; 287 | CLANG_ANALYZER_NONNULL = YES; 288 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 289 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 290 | CLANG_CXX_LIBRARY = "libc++"; 291 | CLANG_ENABLE_MODULES = YES; 292 | CLANG_ENABLE_OBJC_ARC = YES; 293 | CLANG_ENABLE_OBJC_WEAK = YES; 294 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 295 | CLANG_WARN_BOOL_CONVERSION = YES; 296 | CLANG_WARN_COMMA = YES; 297 | CLANG_WARN_CONSTANT_CONVERSION = YES; 298 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 299 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 300 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 301 | CLANG_WARN_EMPTY_BODY = YES; 302 | CLANG_WARN_ENUM_CONVERSION = YES; 303 | CLANG_WARN_INFINITE_RECURSION = YES; 304 | CLANG_WARN_INT_CONVERSION = YES; 305 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 306 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 307 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 308 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 309 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 310 | CLANG_WARN_STRICT_PROTOTYPES = YES; 311 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 312 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 313 | CLANG_WARN_UNREACHABLE_CODE = YES; 314 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 315 | CODE_SIGN_IDENTITY = "-"; 316 | COPY_PHASE_STRIP = NO; 317 | DEBUG_INFORMATION_FORMAT = dwarf; 318 | ENABLE_STRICT_OBJC_MSGSEND = YES; 319 | ENABLE_TESTABILITY = YES; 320 | GCC_C_LANGUAGE_STANDARD = gnu11; 321 | GCC_DYNAMIC_NO_PIC = NO; 322 | GCC_NO_COMMON_BLOCKS = YES; 323 | GCC_OPTIMIZATION_LEVEL = 0; 324 | GCC_PREPROCESSOR_DEFINITIONS = ( 325 | "DEBUG=1", 326 | "$(inherited)", 327 | ); 328 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 329 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 330 | GCC_WARN_UNDECLARED_SELECTOR = YES; 331 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 332 | GCC_WARN_UNUSED_FUNCTION = YES; 333 | GCC_WARN_UNUSED_VARIABLE = YES; 334 | MACOSX_DEPLOYMENT_TARGET = 10.14; 335 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 336 | MTL_FAST_MATH = YES; 337 | ONLY_ACTIVE_ARCH = YES; 338 | SDKROOT = macosx; 339 | }; 340 | name = Debug; 341 | }; 342 | CEDE8CEE22984C0800C73034 /* Release */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ALWAYS_SEARCH_USER_PATHS = NO; 346 | CLANG_ANALYZER_NONNULL = YES; 347 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 348 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 349 | CLANG_CXX_LIBRARY = "libc++"; 350 | CLANG_ENABLE_MODULES = YES; 351 | CLANG_ENABLE_OBJC_ARC = YES; 352 | CLANG_ENABLE_OBJC_WEAK = YES; 353 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 354 | CLANG_WARN_BOOL_CONVERSION = YES; 355 | CLANG_WARN_COMMA = YES; 356 | CLANG_WARN_CONSTANT_CONVERSION = YES; 357 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 358 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 359 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 360 | CLANG_WARN_EMPTY_BODY = YES; 361 | CLANG_WARN_ENUM_CONVERSION = YES; 362 | CLANG_WARN_INFINITE_RECURSION = YES; 363 | CLANG_WARN_INT_CONVERSION = YES; 364 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 365 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 366 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 367 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 368 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 369 | CLANG_WARN_STRICT_PROTOTYPES = YES; 370 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 371 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 372 | CLANG_WARN_UNREACHABLE_CODE = YES; 373 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 374 | CODE_SIGN_IDENTITY = "-"; 375 | COPY_PHASE_STRIP = NO; 376 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 377 | ENABLE_NS_ASSERTIONS = NO; 378 | ENABLE_STRICT_OBJC_MSGSEND = YES; 379 | GCC_C_LANGUAGE_STANDARD = gnu11; 380 | GCC_NO_COMMON_BLOCKS = YES; 381 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 382 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 383 | GCC_WARN_UNDECLARED_SELECTOR = YES; 384 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 385 | GCC_WARN_UNUSED_FUNCTION = YES; 386 | GCC_WARN_UNUSED_VARIABLE = YES; 387 | MACOSX_DEPLOYMENT_TARGET = 10.14; 388 | MTL_ENABLE_DEBUG_INFO = NO; 389 | MTL_FAST_MATH = YES; 390 | SDKROOT = macosx; 391 | }; 392 | name = Release; 393 | }; 394 | CEDE8CF022984C0800C73034 /* Debug */ = { 395 | isa = XCBuildConfiguration; 396 | buildSettings = { 397 | CODE_SIGN_STYLE = Automatic; 398 | COMBINE_HIDPI_IMAGES = YES; 399 | GCC_PREPROCESSOR_DEFINITIONS = ( 400 | "$(inherited)", 401 | "MODULE_VERSION=$(MODULE_VERSION)", 402 | "PRODUCT_NAME=$(PRODUCT_NAME)", 403 | ); 404 | HEADER_SEARCH_PATHS = "${PROJECT_DIR}/Lilu.kext/Contents/Resources"; 405 | INFOPLIST_FILE = AMFIExemption/Info.plist; 406 | LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/Lilu.kext/Contents/Resources/Library"; 407 | MODULE_NAME = com.osy86.AMFIExemption; 408 | MODULE_START = "$(PRODUCT_NAME)_kern_start"; 409 | MODULE_STOP = "$(PRODUCT_NAME)_kern_stop"; 410 | MODULE_VERSION = 1.1.0; 411 | PRODUCT_BUNDLE_IDENTIFIER = com.osy86.AMFIExemption; 412 | PRODUCT_NAME = "$(TARGET_NAME)"; 413 | WRAPPER_EXTENSION = kext; 414 | }; 415 | name = Debug; 416 | }; 417 | CEDE8CF122984C0800C73034 /* Release */ = { 418 | isa = XCBuildConfiguration; 419 | buildSettings = { 420 | CODE_SIGN_STYLE = Automatic; 421 | COMBINE_HIDPI_IMAGES = YES; 422 | GCC_PREPROCESSOR_DEFINITIONS = ( 423 | "$(inherited)", 424 | "MODULE_VERSION=$(MODULE_VERSION)", 425 | "PRODUCT_NAME=$(PRODUCT_NAME)", 426 | ); 427 | HEADER_SEARCH_PATHS = "${PROJECT_DIR}/Lilu.kext/Contents/Resources"; 428 | INFOPLIST_FILE = AMFIExemption/Info.plist; 429 | LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/Lilu.kext/Contents/Resources/Library"; 430 | MODULE_NAME = com.osy86.AMFIExemption; 431 | MODULE_START = "$(PRODUCT_NAME)_kern_start"; 432 | MODULE_STOP = "$(PRODUCT_NAME)_kern_stop"; 433 | MODULE_VERSION = 1.1.0; 434 | PRODUCT_BUNDLE_IDENTIFIER = com.osy86.AMFIExemption; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | WRAPPER_EXTENSION = kext; 437 | }; 438 | name = Release; 439 | }; 440 | /* End XCBuildConfiguration section */ 441 | 442 | /* Begin XCConfigurationList section */ 443 | CEDE8CDF22984C0800C73034 /* Build configuration list for PBXProject "AMFIExemption" */ = { 444 | isa = XCConfigurationList; 445 | buildConfigurations = ( 446 | CEDE8CED22984C0800C73034 /* Debug */, 447 | CEDE8CEE22984C0800C73034 /* Release */, 448 | ); 449 | defaultConfigurationIsVisible = 0; 450 | defaultConfigurationName = Release; 451 | }; 452 | CEDE8CEF22984C0800C73034 /* Build configuration list for PBXNativeTarget "AMFIExemption" */ = { 453 | isa = XCConfigurationList; 454 | buildConfigurations = ( 455 | CEDE8CF022984C0800C73034 /* Debug */, 456 | CEDE8CF122984C0800C73034 /* Release */, 457 | ); 458 | defaultConfigurationIsVisible = 0; 459 | defaultConfigurationName = Release; 460 | }; 461 | /* End XCConfigurationList section */ 462 | }; 463 | rootObject = CEDE8CDC22984C0800C73034 /* Project object */; 464 | } 465 | -------------------------------------------------------------------------------- /AMFIExemption/AMFIExemptionList.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020 osy86. All rights reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #include "AMFIExemptionList.h" 18 | #include 19 | 20 | #define super IOService 21 | 22 | OSDefineMetaClassAndStructors(AMFIExemptionList, IOService); 23 | 24 | OSArray *exemptionsList = nullptr; 25 | 26 | bool AMFIExemptionList::start(IOService *provider) { 27 | OSObject *obj = this->getProperty("Exemptions"); 28 | OSArray *arr = OSDynamicCast(OSArray, obj); 29 | if (!arr) { 30 | IOLog("cannot find Exemption array, exemptions disabled"); 31 | } else { 32 | IOLog("found %u exemptions", arr->getCount()); 33 | if (exemptionsList) { 34 | exemptionsList->release(); 35 | } 36 | arr->retain(); 37 | exemptionsList = arr; 38 | } 39 | return true; 40 | } 41 | -------------------------------------------------------------------------------- /AMFIExemption/AMFIExemptionList.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020 osy86. All rights reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #ifndef AMFIExemptionList_h 18 | #define AMFIExemptionList_h 19 | 20 | #include 21 | 22 | class AMFIExemptionList : public IOService { 23 | OSDeclareDefaultStructors(AMFIExemptionList); 24 | public: 25 | virtual bool start(IOService *provider) override; 26 | }; 27 | 28 | #endif /* AMFIExemptionList_h */ 29 | -------------------------------------------------------------------------------- /AMFIExemption/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | KEXT 17 | CFBundleShortVersionString 18 | $(MODULE_VERSION) 19 | CFBundleVersion 20 | $(MODULE_VERSION) 21 | IOKitPersonalities 22 | 23 | AMFIExemptionList 24 | 25 | CFBundleIdentifier 26 | $(PRODUCT_BUNDLE_IDENTIFIER) 27 | IOClass 28 | AMFIExemptionList 29 | IOMatchCategory 30 | AMFIExemptionList 31 | IOProviderClass 32 | IOResources 33 | IOResourceMatch 34 | IOKit 35 | Exemptions 36 | 37 | com.apple.private.CoreGraphics.debugging 38 | 39 | 40 | 41 | NSHumanReadableCopyright 42 | Copyright © 2019 osy86. All rights reserved. 43 | OSBundleLibraries 44 | 45 | as.vit9696.Lilu 46 | 1.2.0 47 | com.apple.kpi.bsd 48 | 12.0.0 49 | com.apple.kpi.dsep 50 | 12.0.0 51 | com.apple.kpi.iokit 52 | 12.0.0 53 | com.apple.kpi.libkern 54 | 12.0.0 55 | com.apple.kpi.mach 56 | 12.0.0 57 | com.apple.kpi.unsupported 58 | 12.0.0 59 | 60 | OSBundleRequired 61 | Root 62 | 63 | 64 | -------------------------------------------------------------------------------- /AMFIExemption/kern_start.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020 osy86. All rights reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define MODULE_SHORT "amfiex" 23 | 24 | // All patches for binaries 25 | 26 | static mach_vm_address_t origDictionarySet {}; 27 | 28 | extern OSArray *exemptionsList; 29 | 30 | static bool matchExemption(OSString *exemption, OSString *entitlement) { 31 | int prefix_len = exemption->getLength()-1; 32 | if (exemption->getChar(prefix_len) == '*') { // prefix matching 33 | if (entitlement->getLength() >= prefix_len) { 34 | if (strncmp(exemption->getCStringNoCopy(), entitlement->getCStringNoCopy(), prefix_len) == 0) { 35 | DBGLOG(MODULE_SHORT, "entitlement '%s' matches prefix '%s'", entitlement->getCStringNoCopy(), exemption->getCStringNoCopy()); 36 | return true; 37 | } 38 | } 39 | } else { 40 | if (exemption->isEqualTo(entitlement)) { 41 | DBGLOG(MODULE_SHORT, "entitlement '%s' matches exemption '%s'", entitlement->getCStringNoCopy(), exemption->getCStringNoCopy()); 42 | return true; 43 | } 44 | } 45 | return false; 46 | } 47 | 48 | static bool matchExemptions(OSString *entitlement) { 49 | if (!exemptionsList) { 50 | DBGLOG(MODULE_SHORT, "exemptions list not loaded, no exemptions found"); 51 | return false; 52 | } 53 | for (int i = 0; i < exemptionsList->getCount(); i++) { 54 | OSString *exemption = OSDynamicCast(OSString, exemptionsList->getObject(i)); 55 | if (!exemption) { 56 | DBGLOG(MODULE_SHORT, "invalid exemption not a string at index %u", i); 57 | continue; 58 | } 59 | if (matchExemption(exemption, entitlement)) { 60 | return true; 61 | } 62 | } 63 | return false; 64 | } 65 | 66 | static void applyExemptions(OSDictionary *entitlements) { 67 | if (entitlements == NULL) { 68 | SYSLOG(MODULE_SHORT, "NULL entitlement list"); 69 | } else { 70 | DBGLOG(MODULE_SHORT, "called deriveCSFlagsForEntitlements with %u entitlements", entitlements->getCount()); 71 | OSDictionary *copy = OSDictionary::withDictionary(entitlements); 72 | 73 | if (copy == NULL) { 74 | SYSLOG(MODULE_SHORT, "NULL entitlement copy"); 75 | } else { 76 | OSCollectionIterator *it = OSCollectionIterator::withCollection(copy); 77 | 78 | // clear original entitlement and add back anything not exempt 79 | entitlements->flushCollection(); 80 | OSObject *object = NULL; 81 | while ((object = it->getNextObject()) != NULL) { 82 | OSString *entitlement = OSDynamicCast(OSString, object); 83 | if (!matchExemptions(entitlement)) { 84 | entitlements->setObject(entitlement, copy->getObject(entitlement)); 85 | } 86 | } 87 | copy->release(); // release copy 88 | } 89 | } 90 | } 91 | 92 | static void patched_csblob_entitlements_dictionary_set(void *csblob, void *entitlements) { 93 | applyExemptions((OSDictionary *)entitlements); 94 | FunctionCast(patched_csblob_entitlements_dictionary_set, origDictionarySet)(csblob, entitlements); 95 | } 96 | 97 | // main function 98 | static void pluginStart() { 99 | LiluAPI::Error error; 100 | DBGLOG(MODULE_SHORT, "start"); 101 | error = lilu.onPatcherLoad([](void *user, KernelPatcher &patcher){ 102 | DBGLOG(MODULE_SHORT, "patching csblob_entitlements_dictionary_set"); 103 | mach_vm_address_t kern = patcher.solveSymbol(KernelPatcher::KernelID, "_csblob_entitlements_dictionary_set"); 104 | 105 | if (patcher.getError() == KernelPatcher::Error::NoError) { 106 | origDictionarySet = patcher.routeFunctionLong(kern, reinterpret_cast(patched_csblob_entitlements_dictionary_set), true, true); 107 | 108 | if (patcher.getError() != KernelPatcher::Error::NoError) { 109 | SYSLOG(MODULE_SHORT, "failed to hook _csblob_entitlements_dictionary_set"); 110 | } else { 111 | DBGLOG(MODULE_SHORT, "hooked _csblob_entitlements_dictionary_set"); 112 | } 113 | } else { 114 | SYSLOG(MODULE_SHORT, "failed to find _csblob_entitlements_dictionary_set"); 115 | } 116 | }); 117 | if (error != LiluAPI::Error::NoError) { 118 | SYSLOG(MODULE_SHORT, "failed to register onKextLoad method: %d", error); 119 | } 120 | } 121 | 122 | // Boot args. 123 | static const char *bootargOff[] { 124 | "-amfiexemptoff" 125 | }; 126 | static const char *bootargDebug[] { 127 | "-amfiexemptdbg" 128 | }; 129 | static const char *bootargBeta[] { 130 | "-amfiexemptbeta" 131 | }; 132 | 133 | // Plugin configuration. 134 | PluginConfiguration ADDPR(config) { 135 | xStringify(PRODUCT_NAME), 136 | parseModuleVersion(xStringify(MODULE_VERSION)), 137 | LiluAPI::AllowNormal, 138 | bootargOff, 139 | arrsize(bootargOff), 140 | bootargDebug, 141 | arrsize(bootargDebug), 142 | bootargBeta, 143 | arrsize(bootargBeta), 144 | KernelVersion::Mojave, 145 | KernelVersion::BigSur, 146 | pluginStart 147 | }; 148 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AMFIExemption 2 | 3 | Adds allowed entitlements to non-Apple signed apps when SIP is enabled. 4 | 5 | ## What is this? 6 | 7 | When SIP and AMFI are enabled, applications cannot use some entitlements even if they are root. This is by design and is good for security. If we want to use a special entitlement, there has been traditionally two approaches. 8 | 9 | 1. [Patch AMFI to disable entitlement checks][1] 10 | 2. Add the boot-arg `amfi_get_out_of_my_way=1` and disable SIP 11 | 12 | Neither are great for non-development use because they effectively disable a large security feature. Instead, we wish to "selectively" weaken the security by permitting certain Apple private entitlements to be granted to any app. This is because some entitlement allow great harm (such as accessing keychain data) while other entitlements allow access to Apple private features (such as disabling the transparency of the menu bar). If we give every app the ability to use any entitlement then to use private features we also have live with any app being able to access the keychain (for example). 13 | 14 | Please note that care should be taken with this KEXT because any entitlement you add to the exemptions list can be granted to **any** application. If you add sensitive entitlements, you have no more security than just disabling SIP+AMFI. You should think about granting an entitlement the same way you would think about making a kernel patch: it is your responsibility to make sure you do not introduce security holes. 15 | 16 | ## Usage 17 | 18 | This KEXT requires [Lilu][2]. 19 | 20 | To add an entitlement exemption, open `Info.plist` in your favourite plist editor and under `IOKitPersonalities => AMFIExemptionList => Exemptions`, you can add new strings to the array. There are two kinds of exemptions supported: 21 | 22 | * Prefix matching: the last character of the identifier is `*` and every entitlement whose prefix matches the string before the `*` will be removed from entitlement checks. For example `com.apple.private.*` will allow any app to have any entitlement that begins with `com.apple.private.`. Note this is just an example and is highly discouraged! 23 | * Absolute matching: the full identifier of the entitlement such as `com.apple.private.CoreGraphics.debugging`. 24 | 25 | Note that having an entitlement in the exemption list does *not* mean that entitlement is granted to all apps. Your app must still be code-signed with the requested entitlement. This KEXT only disables the requirement that most entitlements require an Apple CA anchor. You can either self-sign with your own certificate or ad-hoc sign with no certificate and still use the entitlement. 26 | 27 | ## Security 28 | 29 | It is highly recommended that this KEXT is loaded by OpenCore with the vault feature enabled. This would prevent malware from modifying `Info.plist` and granting itself arbitrary entitlements which defeats SIP+AMFI security. 30 | 31 | [1]: https://pvieito.com/2016/12/amfid-patching 32 | [2]: https://github.com/acidanthera/Lilu --------------------------------------------------------------------------------