├── .gitattributes ├── .gitignore ├── DiskArbitrationFixup.xcodeproj └── project.pbxproj ├── DiskArbitrationFixup ├── Info.plist └── kern_start.cpp ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | DerivedData 3 | Lilu.kext 4 | xcuserdata 5 | project.xcworkspace 6 | build -------------------------------------------------------------------------------- /DiskArbitrationFixup.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4120B1C62198DCF000888F5A /* libkmod.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4120B1C32198DCF000888F5A /* libkmod.a */; }; 11 | 4120B1C72198DCF000888F5A /* plugin_start.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4120B1C42198DCF000888F5A /* plugin_start.cpp */; }; 12 | 4120B1C82198DCF000888F5A /* LegacyIOService.h in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1C52198DCF000888F5A /* LegacyIOService.h */; }; 13 | 4120B1DE2198DD1200888F5A /* kern_rtc.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1CA2198DD1100888F5A /* kern_rtc.hpp */; }; 14 | 4120B1DF2198DD1200888F5A /* kern_compression.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1CB2198DD1100888F5A /* kern_compression.hpp */; }; 15 | 4120B1E02198DD1200888F5A /* kern_cpu.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1CC2198DD1100888F5A /* kern_cpu.hpp */; }; 16 | 4120B1E12198DD1200888F5A /* kern_devinfo.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1CD2198DD1200888F5A /* kern_devinfo.hpp */; }; 17 | 4120B1E22198DD1200888F5A /* kern_nvram.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1CE2198DD1200888F5A /* kern_nvram.hpp */; }; 18 | 4120B1E32198DD1200888F5A /* kern_mach.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1CF2198DD1200888F5A /* kern_mach.hpp */; }; 19 | 4120B1E42198DD1200888F5A /* kern_user.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1D02198DD1200888F5A /* kern_user.hpp */; }; 20 | 4120B1E52198DD1200888F5A /* plugin_start.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1D12198DD1200888F5A /* plugin_start.hpp */; }; 21 | 4120B1E62198DD1200888F5A /* kern_file.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1D22198DD1200888F5A /* kern_file.hpp */; }; 22 | 4120B1E72198DD1200888F5A /* kern_efi.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1D32198DD1200888F5A /* kern_efi.hpp */; }; 23 | 4120B1E82198DD1200888F5A /* kern_compat.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1D42198DD1200888F5A /* kern_compat.hpp */; }; 24 | 4120B1E92198DD1200888F5A /* kern_config.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1D52198DD1200888F5A /* kern_config.hpp */; }; 25 | 4120B1EA2198DD1200888F5A /* kern_api.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1D62198DD1200888F5A /* kern_api.hpp */; }; 26 | 4120B1EB2198DD1200888F5A /* kern_time.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1D72198DD1200888F5A /* kern_time.hpp */; }; 27 | 4120B1EC2198DD1200888F5A /* kern_crypto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1D82198DD1200888F5A /* kern_crypto.hpp */; }; 28 | 4120B1ED2198DD1200888F5A /* kern_disasm.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1D92198DD1200888F5A /* kern_disasm.hpp */; }; 29 | 4120B1EE2198DD1200888F5A /* kern_iokit.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1DA2198DD1200888F5A /* kern_iokit.hpp */; }; 30 | 4120B1EF2198DD1200888F5A /* kern_patcher.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1DB2198DD1200888F5A /* kern_patcher.hpp */; }; 31 | 4120B1F02198DD1200888F5A /* kern_policy.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1DC2198DD1200888F5A /* kern_policy.hpp */; }; 32 | 4120B1F12198DD1200888F5A /* kern_util.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4120B1DD2198DD1200888F5A /* kern_util.hpp */; }; 33 | 4120B1F32198DE3F00888F5A /* kern_start.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4120B1F22198DE3F00888F5A /* kern_start.cpp */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | 4120B1B62198DC9B00888F5A /* DiskArbitrationFixup.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DiskArbitrationFixup.kext; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 4120B1BB2198DC9B00888F5A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | 4120B1C32198DCF000888F5A /* libkmod.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libkmod.a; path = Lilu.kext/Contents/Resources/Library/libkmod.a; sourceTree = SOURCE_ROOT; }; 40 | 4120B1C42198DCF000888F5A /* plugin_start.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = plugin_start.cpp; path = Lilu.kext/Contents/Resources/Library/plugin_start.cpp; sourceTree = SOURCE_ROOT; }; 41 | 4120B1C52198DCF000888F5A /* LegacyIOService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LegacyIOService.h; path = Lilu.kext/Contents/Resources/Library/LegacyIOService.h; sourceTree = SOURCE_ROOT; }; 42 | 4120B1CA2198DD1100888F5A /* kern_rtc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_rtc.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_rtc.hpp; sourceTree = SOURCE_ROOT; }; 43 | 4120B1CB2198DD1100888F5A /* kern_compression.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_compression.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_compression.hpp; sourceTree = SOURCE_ROOT; }; 44 | 4120B1CC2198DD1100888F5A /* kern_cpu.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_cpu.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_cpu.hpp; sourceTree = SOURCE_ROOT; }; 45 | 4120B1CD2198DD1200888F5A /* kern_devinfo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_devinfo.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_devinfo.hpp; sourceTree = SOURCE_ROOT; }; 46 | 4120B1CE2198DD1200888F5A /* kern_nvram.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_nvram.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_nvram.hpp; sourceTree = SOURCE_ROOT; }; 47 | 4120B1CF2198DD1200888F5A /* kern_mach.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_mach.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_mach.hpp; sourceTree = SOURCE_ROOT; }; 48 | 4120B1D02198DD1200888F5A /* kern_user.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_user.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_user.hpp; sourceTree = SOURCE_ROOT; }; 49 | 4120B1D12198DD1200888F5A /* plugin_start.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = plugin_start.hpp; path = Lilu.kext/Contents/Resources/Headers/plugin_start.hpp; sourceTree = SOURCE_ROOT; }; 50 | 4120B1D22198DD1200888F5A /* kern_file.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_file.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_file.hpp; sourceTree = SOURCE_ROOT; }; 51 | 4120B1D32198DD1200888F5A /* kern_efi.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_efi.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_efi.hpp; sourceTree = SOURCE_ROOT; }; 52 | 4120B1D42198DD1200888F5A /* kern_compat.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_compat.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_compat.hpp; sourceTree = SOURCE_ROOT; }; 53 | 4120B1D52198DD1200888F5A /* kern_config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_config.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_config.hpp; sourceTree = SOURCE_ROOT; }; 54 | 4120B1D62198DD1200888F5A /* kern_api.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_api.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_api.hpp; sourceTree = SOURCE_ROOT; }; 55 | 4120B1D72198DD1200888F5A /* kern_time.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_time.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_time.hpp; sourceTree = SOURCE_ROOT; }; 56 | 4120B1D82198DD1200888F5A /* kern_crypto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_crypto.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_crypto.hpp; sourceTree = SOURCE_ROOT; }; 57 | 4120B1D92198DD1200888F5A /* kern_disasm.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_disasm.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_disasm.hpp; sourceTree = SOURCE_ROOT; }; 58 | 4120B1DA2198DD1200888F5A /* kern_iokit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_iokit.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_iokit.hpp; sourceTree = SOURCE_ROOT; }; 59 | 4120B1DB2198DD1200888F5A /* kern_patcher.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_patcher.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_patcher.hpp; sourceTree = SOURCE_ROOT; }; 60 | 4120B1DC2198DD1200888F5A /* kern_policy.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_policy.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_policy.hpp; sourceTree = SOURCE_ROOT; }; 61 | 4120B1DD2198DD1200888F5A /* kern_util.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kern_util.hpp; path = Lilu.kext/Contents/Resources/Headers/kern_util.hpp; sourceTree = SOURCE_ROOT; }; 62 | 4120B1F22198DE3F00888F5A /* kern_start.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = kern_start.cpp; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 4120B1B32198DC9B00888F5A /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | 4120B1C62198DCF000888F5A /* libkmod.a in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 4120B1AC2198DC9A00888F5A = { 78 | isa = PBXGroup; 79 | children = ( 80 | 4120B1C12198DCD200888F5A /* SDK */, 81 | 4120B1B82198DC9B00888F5A /* DiskArbitrationFixup */, 82 | 4120B1B72198DC9B00888F5A /* Products */, 83 | ); 84 | sourceTree = ""; 85 | }; 86 | 4120B1B72198DC9B00888F5A /* Products */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 4120B1B62198DC9B00888F5A /* DiskArbitrationFixup.kext */, 90 | ); 91 | name = Products; 92 | sourceTree = ""; 93 | }; 94 | 4120B1B82198DC9B00888F5A /* DiskArbitrationFixup */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 4120B1BB2198DC9B00888F5A /* Info.plist */, 98 | 4120B1F22198DE3F00888F5A /* kern_start.cpp */, 99 | ); 100 | path = DiskArbitrationFixup; 101 | sourceTree = ""; 102 | }; 103 | 4120B1C12198DCD200888F5A /* SDK */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 4120B1C92198DCF500888F5A /* Headers */, 107 | 4120B1C22198DCDB00888F5A /* Library */, 108 | ); 109 | name = SDK; 110 | sourceTree = ""; 111 | }; 112 | 4120B1C22198DCDB00888F5A /* Library */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 4120B1C52198DCF000888F5A /* LegacyIOService.h */, 116 | 4120B1C32198DCF000888F5A /* libkmod.a */, 117 | 4120B1C42198DCF000888F5A /* plugin_start.cpp */, 118 | ); 119 | path = Library; 120 | sourceTree = ""; 121 | }; 122 | 4120B1C92198DCF500888F5A /* Headers */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 4120B1D62198DD1200888F5A /* kern_api.hpp */, 126 | 4120B1D42198DD1200888F5A /* kern_compat.hpp */, 127 | 4120B1CB2198DD1100888F5A /* kern_compression.hpp */, 128 | 4120B1D52198DD1200888F5A /* kern_config.hpp */, 129 | 4120B1CC2198DD1100888F5A /* kern_cpu.hpp */, 130 | 4120B1D82198DD1200888F5A /* kern_crypto.hpp */, 131 | 4120B1CD2198DD1200888F5A /* kern_devinfo.hpp */, 132 | 4120B1D92198DD1200888F5A /* kern_disasm.hpp */, 133 | 4120B1D32198DD1200888F5A /* kern_efi.hpp */, 134 | 4120B1D22198DD1200888F5A /* kern_file.hpp */, 135 | 4120B1DA2198DD1200888F5A /* kern_iokit.hpp */, 136 | 4120B1CF2198DD1200888F5A /* kern_mach.hpp */, 137 | 4120B1CE2198DD1200888F5A /* kern_nvram.hpp */, 138 | 4120B1DB2198DD1200888F5A /* kern_patcher.hpp */, 139 | 4120B1DC2198DD1200888F5A /* kern_policy.hpp */, 140 | 4120B1CA2198DD1100888F5A /* kern_rtc.hpp */, 141 | 4120B1D72198DD1200888F5A /* kern_time.hpp */, 142 | 4120B1D02198DD1200888F5A /* kern_user.hpp */, 143 | 4120B1DD2198DD1200888F5A /* kern_util.hpp */, 144 | 4120B1D12198DD1200888F5A /* plugin_start.hpp */, 145 | ); 146 | path = Headers; 147 | sourceTree = ""; 148 | }; 149 | /* End PBXGroup section */ 150 | 151 | /* Begin PBXHeadersBuildPhase section */ 152 | 4120B1B12198DC9B00888F5A /* Headers */ = { 153 | isa = PBXHeadersBuildPhase; 154 | buildActionMask = 2147483647; 155 | files = ( 156 | 4120B1E52198DD1200888F5A /* plugin_start.hpp in Headers */, 157 | 4120B1DE2198DD1200888F5A /* kern_rtc.hpp in Headers */, 158 | 4120B1E42198DD1200888F5A /* kern_user.hpp in Headers */, 159 | 4120B1EE2198DD1200888F5A /* kern_iokit.hpp in Headers */, 160 | 4120B1E32198DD1200888F5A /* kern_mach.hpp in Headers */, 161 | 4120B1EB2198DD1200888F5A /* kern_time.hpp in Headers */, 162 | 4120B1EC2198DD1200888F5A /* kern_crypto.hpp in Headers */, 163 | 4120B1E22198DD1200888F5A /* kern_nvram.hpp in Headers */, 164 | 4120B1E92198DD1200888F5A /* kern_config.hpp in Headers */, 165 | 4120B1E02198DD1200888F5A /* kern_cpu.hpp in Headers */, 166 | 4120B1F12198DD1200888F5A /* kern_util.hpp in Headers */, 167 | 4120B1EA2198DD1200888F5A /* kern_api.hpp in Headers */, 168 | 4120B1ED2198DD1200888F5A /* kern_disasm.hpp in Headers */, 169 | 4120B1F02198DD1200888F5A /* kern_policy.hpp in Headers */, 170 | 4120B1E62198DD1200888F5A /* kern_file.hpp in Headers */, 171 | 4120B1C82198DCF000888F5A /* LegacyIOService.h in Headers */, 172 | 4120B1E82198DD1200888F5A /* kern_compat.hpp in Headers */, 173 | 4120B1DF2198DD1200888F5A /* kern_compression.hpp in Headers */, 174 | 4120B1EF2198DD1200888F5A /* kern_patcher.hpp in Headers */, 175 | 4120B1E12198DD1200888F5A /* kern_devinfo.hpp in Headers */, 176 | 4120B1E72198DD1200888F5A /* kern_efi.hpp in Headers */, 177 | ); 178 | runOnlyForDeploymentPostprocessing = 0; 179 | }; 180 | /* End PBXHeadersBuildPhase section */ 181 | 182 | /* Begin PBXNativeTarget section */ 183 | 4120B1B52198DC9B00888F5A /* DiskArbitrationFixup */ = { 184 | isa = PBXNativeTarget; 185 | buildConfigurationList = 4120B1BE2198DC9B00888F5A /* Build configuration list for PBXNativeTarget "DiskArbitrationFixup" */; 186 | buildPhases = ( 187 | 4120B1B12198DC9B00888F5A /* Headers */, 188 | 4120B1B22198DC9B00888F5A /* Sources */, 189 | 4120B1B32198DC9B00888F5A /* Frameworks */, 190 | 4120B1B42198DC9B00888F5A /* Resources */, 191 | ); 192 | buildRules = ( 193 | ); 194 | dependencies = ( 195 | ); 196 | name = DiskArbitrationFixup; 197 | productName = DiskArbitrationFixup; 198 | productReference = 4120B1B62198DC9B00888F5A /* DiskArbitrationFixup.kext */; 199 | productType = "com.apple.product-type.kernel-extension"; 200 | }; 201 | /* End PBXNativeTarget section */ 202 | 203 | /* Begin PBXProject section */ 204 | 4120B1AD2198DC9A00888F5A /* Project object */ = { 205 | isa = PBXProject; 206 | attributes = { 207 | LastUpgradeCheck = 1010; 208 | ORGANIZATIONNAME = Goldfish64; 209 | TargetAttributes = { 210 | 4120B1B52198DC9B00888F5A = { 211 | CreatedOnToolsVersion = 10.1; 212 | ProvisioningStyle = Automatic; 213 | }; 214 | }; 215 | }; 216 | buildConfigurationList = 4120B1B02198DC9A00888F5A /* Build configuration list for PBXProject "DiskArbitrationFixup" */; 217 | compatibilityVersion = "Xcode 3.2"; 218 | developmentRegion = en; 219 | hasScannedForEncodings = 0; 220 | knownRegions = ( 221 | en, 222 | ); 223 | mainGroup = 4120B1AC2198DC9A00888F5A; 224 | productRefGroup = 4120B1B72198DC9B00888F5A /* Products */; 225 | projectDirPath = ""; 226 | projectRoot = ""; 227 | targets = ( 228 | 4120B1B52198DC9B00888F5A /* DiskArbitrationFixup */, 229 | ); 230 | }; 231 | /* End PBXProject section */ 232 | 233 | /* Begin PBXResourcesBuildPhase section */ 234 | 4120B1B42198DC9B00888F5A /* Resources */ = { 235 | isa = PBXResourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | /* End PBXResourcesBuildPhase section */ 242 | 243 | /* Begin PBXSourcesBuildPhase section */ 244 | 4120B1B22198DC9B00888F5A /* Sources */ = { 245 | isa = PBXSourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | 4120B1F32198DE3F00888F5A /* kern_start.cpp in Sources */, 249 | 4120B1C72198DCF000888F5A /* plugin_start.cpp in Sources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | /* End PBXSourcesBuildPhase section */ 254 | 255 | /* Begin XCBuildConfiguration section */ 256 | 4120B1BC2198DC9B00888F5A /* Debug */ = { 257 | isa = XCBuildConfiguration; 258 | buildSettings = { 259 | ALWAYS_SEARCH_USER_PATHS = NO; 260 | CLANG_ANALYZER_NONNULL = YES; 261 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 262 | CLANG_CXX_LANGUAGE_STANDARD = "c++14"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_ENABLE_OBJC_WEAK = YES; 267 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 268 | CLANG_WARN_BOOL_CONVERSION = YES; 269 | CLANG_WARN_COMMA = YES; 270 | CLANG_WARN_CONSTANT_CONVERSION = YES; 271 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 272 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 273 | CLANG_WARN_DOCUMENTATION_COMMENTS = NO; 274 | CLANG_WARN_EMPTY_BODY = YES; 275 | CLANG_WARN_ENUM_CONVERSION = YES; 276 | CLANG_WARN_INFINITE_RECURSION = YES; 277 | CLANG_WARN_INT_CONVERSION = YES; 278 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 279 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 286 | CLANG_WARN_UNREACHABLE_CODE = YES; 287 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 288 | CODE_SIGN_IDENTITY = "-"; 289 | COPY_PHASE_STRIP = NO; 290 | DEBUG_INFORMATION_FORMAT = dwarf; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | ENABLE_TESTABILITY = YES; 293 | GCC_C_LANGUAGE_STANDARD = c11; 294 | GCC_DYNAMIC_NO_PIC = NO; 295 | GCC_NO_COMMON_BLOCKS = YES; 296 | GCC_OPTIMIZATION_LEVEL = 0; 297 | GCC_PREPROCESSOR_DEFINITIONS = ( 298 | "DEBUG=1", 299 | "$(inherited)", 300 | ); 301 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 302 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 303 | GCC_WARN_UNDECLARED_SELECTOR = YES; 304 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 305 | GCC_WARN_UNUSED_FUNCTION = YES; 306 | GCC_WARN_UNUSED_VARIABLE = YES; 307 | MACOSX_DEPLOYMENT_TARGET = 10.8; 308 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 309 | MTL_FAST_MATH = YES; 310 | ONLY_ACTIVE_ARCH = YES; 311 | SDKROOT = macosx; 312 | }; 313 | name = Debug; 314 | }; 315 | 4120B1BD2198DC9B00888F5A /* Release */ = { 316 | isa = XCBuildConfiguration; 317 | buildSettings = { 318 | ALWAYS_SEARCH_USER_PATHS = NO; 319 | CLANG_ANALYZER_NONNULL = YES; 320 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 321 | CLANG_CXX_LANGUAGE_STANDARD = "c++14"; 322 | CLANG_CXX_LIBRARY = "libc++"; 323 | CLANG_ENABLE_MODULES = YES; 324 | CLANG_ENABLE_OBJC_ARC = YES; 325 | CLANG_ENABLE_OBJC_WEAK = YES; 326 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 327 | CLANG_WARN_BOOL_CONVERSION = YES; 328 | CLANG_WARN_COMMA = YES; 329 | CLANG_WARN_CONSTANT_CONVERSION = YES; 330 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 331 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 332 | CLANG_WARN_DOCUMENTATION_COMMENTS = NO; 333 | CLANG_WARN_EMPTY_BODY = YES; 334 | CLANG_WARN_ENUM_CONVERSION = YES; 335 | CLANG_WARN_INFINITE_RECURSION = YES; 336 | CLANG_WARN_INT_CONVERSION = YES; 337 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 338 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 339 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 340 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 341 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 342 | CLANG_WARN_STRICT_PROTOTYPES = YES; 343 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 344 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | CODE_SIGN_IDENTITY = "-"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 350 | ENABLE_NS_ASSERTIONS = NO; 351 | ENABLE_STRICT_OBJC_MSGSEND = YES; 352 | GCC_C_LANGUAGE_STANDARD = c11; 353 | GCC_NO_COMMON_BLOCKS = YES; 354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 356 | GCC_WARN_UNDECLARED_SELECTOR = YES; 357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 358 | GCC_WARN_UNUSED_FUNCTION = YES; 359 | GCC_WARN_UNUSED_VARIABLE = YES; 360 | MACOSX_DEPLOYMENT_TARGET = 10.8; 361 | MTL_ENABLE_DEBUG_INFO = NO; 362 | MTL_FAST_MATH = YES; 363 | SDKROOT = macosx; 364 | }; 365 | name = Release; 366 | }; 367 | 4120B1BF2198DC9B00888F5A /* Debug */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | CODE_SIGN_STYLE = Automatic; 371 | GCC_PREPROCESSOR_DEFINITIONS = ( 372 | "MODULE_VERSION=$(MODULE_VERSION)", 373 | "PRODUCT_NAME=$(PRODUCT_NAME)", 374 | "$(inherited)", 375 | ); 376 | HEADER_SEARCH_PATHS = "${PROJECT_DIR}/Lilu.kext/Contents/Resources"; 377 | INFOPLIST_FILE = DiskArbitrationFixup/Info.plist; 378 | LIBRARY_SEARCH_PATHS = ( 379 | "$(inherited)", 380 | "$(PROJECT_DIR)/Lilu.kext/Contents/Resources/Library", 381 | ); 382 | MODULE_NAME = fish.goldfish64.DiskArbitrationFixup; 383 | MODULE_START = "$(PRODUCT_NAME)_kern_start"; 384 | MODULE_STOP = "$(PRODUCT_NAME)_kern_stop"; 385 | MODULE_VERSION = 1.0.0; 386 | PRODUCT_BUNDLE_IDENTIFIER = fish.goldfish64.DiskArbitrationFixup; 387 | PRODUCT_NAME = "$(TARGET_NAME)"; 388 | WRAPPER_EXTENSION = kext; 389 | }; 390 | name = Debug; 391 | }; 392 | 4120B1C02198DC9B00888F5A /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | CODE_SIGN_STYLE = Automatic; 396 | GCC_PREPROCESSOR_DEFINITIONS = ( 397 | "MODULE_VERSION=$(MODULE_VERSION)", 398 | "PRODUCT_NAME=$(PRODUCT_NAME)", 399 | "$(inherited)", 400 | ); 401 | HEADER_SEARCH_PATHS = "${PROJECT_DIR}/Lilu.kext/Contents/Resources"; 402 | INFOPLIST_FILE = DiskArbitrationFixup/Info.plist; 403 | LIBRARY_SEARCH_PATHS = ( 404 | "$(inherited)", 405 | "$(PROJECT_DIR)/Lilu.kext/Contents/Resources/Library", 406 | ); 407 | MODULE_NAME = fish.goldfish64.DiskArbitrationFixup; 408 | MODULE_START = "$(PRODUCT_NAME)_kern_start"; 409 | MODULE_STOP = "$(PRODUCT_NAME)_kern_stop"; 410 | MODULE_VERSION = 1.0.0; 411 | PRODUCT_BUNDLE_IDENTIFIER = fish.goldfish64.DiskArbitrationFixup; 412 | PRODUCT_NAME = "$(TARGET_NAME)"; 413 | WRAPPER_EXTENSION = kext; 414 | }; 415 | name = Release; 416 | }; 417 | /* End XCBuildConfiguration section */ 418 | 419 | /* Begin XCConfigurationList section */ 420 | 4120B1B02198DC9A00888F5A /* Build configuration list for PBXProject "DiskArbitrationFixup" */ = { 421 | isa = XCConfigurationList; 422 | buildConfigurations = ( 423 | 4120B1BC2198DC9B00888F5A /* Debug */, 424 | 4120B1BD2198DC9B00888F5A /* Release */, 425 | ); 426 | defaultConfigurationIsVisible = 0; 427 | defaultConfigurationName = Release; 428 | }; 429 | 4120B1BE2198DC9B00888F5A /* Build configuration list for PBXNativeTarget "DiskArbitrationFixup" */ = { 430 | isa = XCConfigurationList; 431 | buildConfigurations = ( 432 | 4120B1BF2198DC9B00888F5A /* Debug */, 433 | 4120B1C02198DC9B00888F5A /* Release */, 434 | ); 435 | defaultConfigurationIsVisible = 0; 436 | defaultConfigurationName = Release; 437 | }; 438 | /* End XCConfigurationList section */ 439 | }; 440 | rootObject = 4120B1AD2198DC9A00888F5A /* Project object */; 441 | } 442 | -------------------------------------------------------------------------------- /DiskArbitrationFixup/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 | SystemProfilerMemoryFixup 24 | 25 | CFBundleIdentifier 26 | $(PRODUCT_BUNDLE_IDENTIFIER) 27 | IOClass 28 | $(PRODUCT_NAME:rfc1034identifier) 29 | IOMatchCategory 30 | $(PRODUCT_NAME:rfc1034identifier) 31 | IOProviderClass 32 | IOResources 33 | IOResourceMatch 34 | IOKit 35 | 36 | 37 | OSBundleCompatibleVersion 38 | 1.0 39 | NSHumanReadableCopyright 40 | Copyright © 2019 Goldfish64. All rights reserved. 41 | OSBundleLibraries 42 | 43 | as.vit9696.Lilu 44 | 1.2.0 45 | com.apple.kpi.bsd 46 | 12.0.0 47 | com.apple.kpi.dsep 48 | 12.0.0 49 | com.apple.kpi.iokit 50 | 12.0.0 51 | com.apple.kpi.libkern 52 | 12.0.0 53 | com.apple.kpi.mach 54 | 12.0.0 55 | com.apple.kpi.unsupported 56 | 12.0.0 57 | 58 | OSBundleRequired 59 | Root 60 | 61 | 62 | -------------------------------------------------------------------------------- /DiskArbitrationFixup/kern_start.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 John Davis 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | // DiskArbitrationAgent binary path. 28 | static const char *binPathDiskArbitrationAgent = "/System/Library/Frameworks/DiskArbitration.framework/Versions/Current/Support/DiskArbitrationAgent"; 29 | 30 | static const uint32_t SectionActive = 1; 31 | 32 | // Find: 83 F8 03 74 XX 83 F8 02 33 | // Replace: 83 F8 03 74 XX 83 F8 0F 34 | static uint8_t findBytes[] = { 0x83, 0xF8, 0x03, 0x74, 0xFF, 0x83, 0xF8, 0x02 }; 35 | static uint8_t replaceBytes[] = { 0x83, 0xF8, 0x03, 0x74, 0xFF, 0x83, 0xF8, 0x0F }; 36 | 37 | // Patching info for DiskArbitrationAgent binary. 38 | static UserPatcher::BinaryModPatch patchBytesDiskArbitrationAgent { 39 | CPU_TYPE_X86_64, 40 | 0, 41 | findBytes, 42 | replaceBytes, 43 | arrsize(findBytes), 44 | 0, 45 | 1, 46 | UserPatcher::FileSegment::SegmentTextText, 47 | SectionActive 48 | }; 49 | 50 | // BinaryModInfo array containing all patches required. 51 | static UserPatcher::BinaryModInfo binaryPatches[] { 52 | { binPathDiskArbitrationAgent, &patchBytesDiskArbitrationAgent, 1} 53 | }; 54 | 55 | // DiskArbitrationAgent process info. 56 | static UserPatcher::ProcInfo procInfo = { binPathDiskArbitrationAgent, static_cast(strlen(binPathDiskArbitrationAgent)), 1 }; 57 | 58 | static void buildPatch(void *user, KernelPatcher &patcher) { 59 | DBGLOG("DiskArbitrationFixup", "buildPatches() start"); 60 | 61 | // Get contents of binary. 62 | size_t outSize; 63 | uint8_t *buffer = FileIO::readFileToBuffer(binPathDiskArbitrationAgent, outSize); 64 | if (buffer == NULL) { 65 | DBGLOG("DiskArbitrationFixup", "Failed to read binary: %s\n", binPathDiskArbitrationAgent); 66 | procInfo.section = procInfo.SectionDisabled; 67 | return; 68 | } 69 | 70 | // Find where case 0x2 is located. This is where the dialog for unreadable disk would be shown. 71 | off_t index = 0; 72 | for (off_t i = 0; i < outSize; i++) { 73 | // Check if all bytes but byte 4 match. 74 | bool found = true; 75 | for (off_t b = 0; b < arrsize(findBytes); b++) { 76 | // Skip byte 4. 77 | if (b == 4) 78 | continue; 79 | 80 | // Check bytes. If mismatch, keep looking. 81 | if (buffer[i + b] != findBytes[b]) { 82 | found = false; 83 | break; 84 | } 85 | } 86 | 87 | // If we found a match, we are done. 88 | if (found) { 89 | index = i; 90 | break; 91 | } 92 | } 93 | 94 | // If we found no match, we can't go on. 95 | if (index == 0) { 96 | DBGLOG("DiskArbitrationFixup", "Failed to get index into binary: %s\n", binPathDiskArbitrationAgent); 97 | procInfo.section = procInfo.SectionDisabled; 98 | return; 99 | } 100 | 101 | // Get byte 4. 102 | uint8_t *bufferOffset = buffer + index; 103 | findBytes[4] = replaceBytes[4] = bufferOffset[4]; 104 | 105 | // Free buffer. 106 | Buffer::deleter(buffer); 107 | } 108 | 109 | // Main function. 110 | static void dafxStart() { 111 | DBGLOG("DiskArbitrationFixup", "start"); 112 | 113 | // Load callback. 114 | lilu.onPatcherLoadForce(buildPatch); 115 | 116 | // Load patches. 117 | lilu.onProcLoadForce(&procInfo, 1, nullptr, nullptr, binaryPatches, arrsize(binaryPatches)); 118 | } 119 | 120 | // Boot args. 121 | static const char *bootargOff[] { 122 | "-dafxoff" 123 | }; 124 | static const char *bootargDebug[] { 125 | "-dafxdbg" 126 | }; 127 | static const char *bootargBeta[] { 128 | "-dafxbeta" 129 | }; 130 | 131 | // Plugin configuration. 132 | PluginConfiguration ADDPR(config) { 133 | xStringify(PRODUCT_NAME), 134 | parseModuleVersion(xStringify(MODULE_VERSION)), 135 | LiluAPI::AllowNormal, 136 | bootargOff, 137 | arrsize(bootargOff), 138 | bootargDebug, 139 | arrsize(bootargDebug), 140 | bootargBeta, 141 | arrsize(bootargBeta), 142 | KernelVersion::Mavericks, 143 | KernelVersion::Catalina, 144 | []() { 145 | dafxStart(); 146 | } 147 | }; 148 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 John Davis (Goldfish64) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DiskArbitrationFixup 2 | [Lilu](https://github.com/acidanthera/Lilu) plugin for disabling the "The disk you inserted was not readable by this computer" message at boot on 10.9 or later. Useful if you have other disks with filesystems unknown to macOS. 3 | --------------------------------------------------------------------------------