Index: branches/ErmaC/Enoch/i386/libsaio/bootstruct.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/bootstruct.c (revision 2882) +++ branches/ErmaC/Enoch/i386/libsaio/bootstruct.c (revision 2883) @@ -134,7 +134,7 @@ } else { - // for 10.7 10.8 10.9 10.10 10.11 10.12 + // for 10.7 10.8 10.9 10.10 10.11 10.12 10.13 void *oldAddr = bootArgs; bootArgs = (boot_args *)AllocateKernelMemory(sizeof(boot_args)); bcopy(oldAddr, bootArgs, sizeof(boot_args)); Index: branches/ErmaC/Enoch/i386/libsaio/disk.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/disk.c (revision 2882) +++ branches/ErmaC/Enoch/i386/libsaio/disk.c (revision 2883) @@ -1711,6 +1711,7 @@ char *YosPattern = "Install%20OS%20X%20Yosemite"; char *ECPattern = "Install%20OS%20X%20El%20Capitan"; char *SierraPattern = "Install%20macOS%20Sierra"; + char *HSierraPattern = "Install%20macOS%20High%20Sierra"; /* * Only look for OS Version on HFS+ @@ -1810,6 +1811,12 @@ fakeOSVersionInt = 12; valid = true; } + else if(strstr(val, HSierraPattern)) + { + fakeOSVersion = "10.13"; + fakeOSVersionInt = 13; + valid = true; + } else { valid = false; @@ -1870,8 +1877,11 @@ case 12: fakeOSVersion = "10.12"; break; + case 13: + fakeOSVersion = "10.13"; + break; default: - fakeOSVersion = "10.12"; + fakeOSVersion = "10.13"; break; } Index: branches/ErmaC/Enoch/i386/libsaio/smbios_decode.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/smbios_decode.c (revision 2882) +++ branches/ErmaC/Enoch/i386/libsaio/smbios_decode.c (revision 2883) @@ -574,13 +574,13 @@ //------------------------------------------------------------------------------------------------------------------------- // Apple Specific (Type 133) //------------------------------------------------------------------------------------------------------------------------- -//void decodeOemPlatformFeature(SMBStructHeader *structHeader) -//{ -// printHeader(structHeader); -// DBG("Apple specific Platform Feature\n"); -// DBG("\t%s\n", ((SMBOemPlatformFeature *)structHeader)->PlatformFeature); -// DBG("\n"); -//} +void decodeOemPlatformFeature(SMBStructHeader *structHeader) +{ + printHeader(structHeader); + DBG("Apple specific Platform Feature\n"); + DBG("\t%s\n", ((SMBOemPlatformFeature *)structHeader)->PlatformFeature); + DBG("\n"); +} //------------------------------------------------------------------------------------------------------------------------- // Specific (Type 134) Index: branches/ErmaC/Enoch/i386/libsaio/smbios.h =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/smbios.h (revision 2882) +++ branches/ErmaC/Enoch/i386/libsaio/smbios.h (revision 2883) @@ -134,8 +134,8 @@ kSMBTypeMemorySPD = 130, // MemorySPD (TYPE 130) kSMBTypeOemProcessorType = 131, // Processor Type (Type 131) kSMBTypeOemProcessorBusSpeed = 132, // Processor Bus Speed (Type 132) - kSMBTypeOemPlatformFeature = 133 // Platform Feature (Type 133) -// kSMBTypeOemSMCVersion = 134 // SMC Version (Type 134) + kSMBTypeOemPlatformFeature = 133, // Platform Feature (Type 133) + kSMBTypeOemSMCVersion = 134 // SMC Version (Type 134) }; //---------------------------------------------------------------------------------------------------------- Index: branches/ErmaC/Enoch/i386/libsaio/stringTable.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/stringTable.c (revision 2882) +++ branches/ErmaC/Enoch/i386/libsaio/stringTable.c (revision 2883) @@ -681,8 +681,8 @@ // Micky1979, the order is important char *dirspec[] = { "/com.apple.recovery.boot/com.apple.Boot.plist", // OS X Recovery + "/macOS Install Data/Locked Files/Boot Files/com.apple.Boot.plist", // macOS Upgrade (10.12)+ "/macOS Install Data/com.apple.Boot.plist", // macOS Upgrade (10.12) - "/macOS Install Data/Locked Files/Boot Files/com.apple.Boot.plist", // macOS Upgrade (10.12) "/OS X Install Data/com.apple.Boot.plist", // OS X Upgrade (10.8+) "/Mac OS X Install Data/com.apple.Boot.plist", // OS X Upgrade (Lion 10.7) "/.IABootFiles/com.apple.Boot.plist", // OS X Installer Index: branches/ErmaC/Enoch/i386/boot2/drivers.c =================================================================== --- branches/ErmaC/Enoch/i386/boot2/drivers.c (revision 2882) +++ branches/ErmaC/Enoch/i386/boot2/drivers.c (revision 2883) @@ -1532,13 +1532,14 @@ case 4: kernelOSVer = 0xA0C0300; break; case 5: kernelOSVer = 0xA0C0400; break; case 6: kernelOSVer = 0xA0C0500; break; -// case 7: kernelOSVer = 0xA0C0600; break; - default:kernelOSVer = 0xA0C0500; break; //Last known kernel (add here updates) + case 7: kernelOSVer = 0xA0C0600; break; +// case 8: kernelOSVer = 0xA0C0700; break; + default:kernelOSVer = 0xA0C0600; break; //Last known kernel (add here updates) } break; default: - kernelOSVer = 0xA0C0500; - break; //Last known kernel is Sierra 10.12.5 + kernelOSVer = 0xA0C0600; + break; //Last known kernel is Sierra 10.12.6 } } else @@ -1598,9 +1599,12 @@ case 0xA0C0300: gDarwinMajor = 16; gDarwinMinor = 4; gDarwinRev = 0; break; // 10.12.3 case 0xA0C0400: gDarwinMajor = 16; gDarwinMinor = 5; gDarwinRev = 0; break; // 10.12.4 case 0xA0C0500: gDarwinMajor = 16; gDarwinMinor = 6; gDarwinRev = 0; break; // 10.12.5 -// case 0xA0C0600: gDarwinMajor = 16; gDarwinMinor = x; gDarwinRev = x; break; // 10.12.6 + case 0xA0C0600: gDarwinMajor = 16; gDarwinMinor = 7; gDarwinRev = 0; break; // 10.12.6 +// case 0xA0C0700: gDarwinMajor = 16; gDarwinMinor = x; gDarwinRev = x; break; // 10.12.7 + // High Sierra + // default = last known kernel - default: gDarwinMajor = 16; gDarwinMinor = 6; gDarwinRev = 0; break; // 10.12.5; + default: gDarwinMajor = 16; gDarwinMinor = 7; gDarwinRev = 0; break; // 10.12.6; } } Index: branches/ErmaC/Enoch/i386/boot2/boot.c =================================================================== --- branches/ErmaC/Enoch/i386/boot2/boot.c (revision 2882) +++ branches/ErmaC/Enoch/i386/boot2/boot.c (revision 2883) @@ -1302,7 +1302,7 @@ } // OS X El Capitan 10.11 - if ( MacOSVerCurrent >= MacOSVer2Int("10.11") ) // El Capitan and Sierra! + if ( MacOSVerCurrent >= MacOSVer2Int("10.11") ) // El Capitan, Sierra and High Sierra! { // ErmaC verbose("\n"); @@ -1317,7 +1317,7 @@ if (isRecoveryHD || isInstaller || isOSXUpgrade || isMacOSXUpgrade) { // SIP can be controlled with or without FileNVRAM.kext (Pike R. Alpha) - bootArgs->flags |= (kBootArgsFlagCSRActiveConfig + kBootArgsFlagCSRConfigMode + kBootArgsFlagCSRBoot); + bootArgs->flags |= (kBootArgsFlagCSRActiveConfig + kBootArgsFlagCSRConfigMode + kBootArgsFlagCSRBoot + kBootArgsFlagInstallUI); } else { Index: branches/ErmaC/Enoch/i386/boot2/boot.h =================================================================== --- branches/ErmaC/Enoch/i386/boot2/boot.h (revision 2882) +++ branches/ErmaC/Enoch/i386/boot2/boot.h (revision 2883) @@ -30,6 +30,7 @@ #include "libsaio.h" // OS X Versions +#define HSIERRA checkOSVersion("10.13") // High Sierra #define SIERRA checkOSVersion("10.12") // Sierra #define ELCAPITAN checkOSVersion("10.11") // El Capitan #define YOSEMITE checkOSVersion("10.10") // Yosemite Index: branches/ErmaC/Enoch/i386/boot2/kernel_patcher_internal.c =================================================================== --- branches/ErmaC/Enoch/i386/boot2/kernel_patcher_internal.c (revision 2882) +++ branches/ErmaC/Enoch/i386/boot2/kernel_patcher_internal.c (revision 2883) @@ -644,8 +644,15 @@ { (*((UInt64 *)Ptr)) = 0x0000000000000000ULL; verbose("\tKernel power management patch 10.12 DP1 found and patched\n"); - return TRUE; + return true; } + // PMheart: change for 10.13 DP1 17A264c + else if (0x00004000000000E2ULL == (*((UInt64 *)Ptr))) + { + (*((UInt64 *)Ptr)) = 0x0000000000000000ULL; + verbose("\tKernel power management patch 10.13 DP1 found and patched\n"); + return true; + } Ptr += 16; } verbose("\tKernel power management patch region not found!\n"); @@ -905,27 +912,50 @@ } // sherlocks: 10.12.DP1 else if (KernelLapicError - && (bytes[i+0] == 0x65 - && bytes[i+1] == 0x8B - && bytes[i+2] == 0x0C - && bytes[i+3] == 0x25 - && bytes[i+4] == 0x1C - && bytes[i+5] == 0x00 - && bytes[i+6] == 0x00 - && bytes[i+7] == 0x00 - && bytes[i+1409] == 0x65 - && bytes[i+1410] == 0x8B - && bytes[i+1411] == 0x0C - && bytes[i+1412] == 0x25 - && bytes[i+1413] == 0x1C - && bytes[i+1414] == 0x00 - && bytes[i+1415] == 0x00 - && bytes[i+1416] == 0x00)) + && (bytes[i+0] == 0x65 + && bytes[i+1] == 0x8B + && bytes[i+2] == 0x0C + && bytes[i+3] == 0x25 + && bytes[i+4] == 0x1C + && bytes[i+5] == 0x00 + && bytes[i+6] == 0x00 + && bytes[i+7] == 0x00 + && bytes[i+1409] == 0x65 + && bytes[i+1410] == 0x8B + && bytes[i+1411] == 0x0C + && bytes[i+1412] == 0x25 + && bytes[i+1413] == 0x1C + && bytes[i+1414] == 0x00 + && bytes[i+1415] == 0x00 + && bytes[i+1416] == 0x00)) { patchLocation = i+1398; DBG("\tFound Sierra Lapic panic at 0x%08X\n", (unsigned int)patchLocation); break; } + // sherlocks: 10.13.DP1 + else if (KernelLapicError + && (bytes[i+0] == 0x65 + && bytes[i+1] == 0x8B + && bytes[i+2] == 0x0C + && bytes[i+3] == 0x25 + && bytes[i+4] == 0x1C + && bytes[i+5] == 0x00 + && bytes[i+6] == 0x00 + && bytes[i+7] == 0x00 + && bytes[i+1407] == 0x65 + && bytes[i+1408] == 0x8B + && bytes[i+1409] == 0x0C + && bytes[i+1410] == 0x25 + && bytes[i+1411] == 0x1C + && bytes[i+1412] == 0x00 + && bytes[i+1413] == 0x00 + && bytes[i+1414] == 0x00)) + { + patchLocation = i+1396; + DBG("\tFound High Sierra Lapic panic at 0x%08X\n", (unsigned int)patchLocation); + break; + } } if (!patchLocation) @@ -1312,6 +1342,35 @@ Bytes = (UInt8 *)kernelData; PatchApplied = false; + // High Sierra onward, need to use 10.12 instead of 10.13. kernel bug? + if (kernelOSVer >= MacOSVer2Int("10.12")) + { + for (Index = 0; Index < 0x1000000; ++Index) + { + if (Bytes[Index] == 0xE8 + && Bytes[Index + 1] == 0x25 + && Bytes[Index + 2] == 0x00 + && Bytes[Index + 3] == 0x00 + && Bytes[Index + 4] == 0x00 + && Bytes[Index + 5] == 0xEB + && Bytes[Index + 6] == 0x05 + && Bytes[Index + 7] == 0xE8 + && Bytes[Index + 8] == 0x7E + && Bytes[Index + 9] == 0x05 + && Bytes[Index + 10] == 0x00 + && Bytes[Index + 11] == 0x00) + { + Bytes[Index + 5] = 0x90; + Bytes[Index + 6] = 0x90; + count++; + + verbose("\tFound High Sierra EXT pattern: patched!\n"); + PatchApplied = true; + break; + } + } + } + // Sierra onward if (kernelOSVer >= MacOSVer2Int("10.12")) { @@ -1343,6 +1402,33 @@ PatchApplied = true; break; } + // High Sierra onward, need to use 10.12 instead of 10.13. kernel bug? + if ((kernelOSVer >= MacOSVer2Int("10.12")) + && (Bytes[Index] == 0xC3 + && Bytes[Index + 1] == 0x48 + && Bytes[Index + 2] == 0x85 + && Bytes[Index + 3] == 0xDB + && Bytes[Index + 4] == 0x74 + && Bytes[Index + 5] == 0x69 + && Bytes[Index + 6] == 0x48 + && Bytes[Index + 7] == 0x8B + && Bytes[Index + 8] == 0x03 + && Bytes[Index + 9] == 0x48 + && Bytes[Index + 10] == 0x89 + && Bytes[Index + 11] == 0xDF + && Bytes[Index + 12] == 0xFF + && Bytes[Index + 13] == 0x50 + && Bytes[Index + 14] == 0x28 + && Bytes[Index + 15] == 0x48)) + { + Bytes[Index + 4] = 0xEB; + Bytes[Index + 5] = 0x12; + count++; + + verbose("\tFound High Sierra SIP pattern: patched!\n"); + PatchApplied = true; + break; + } } } Index: branches/ErmaC/Enoch/i386/boot2/gui.c =================================================================== --- branches/ErmaC/Enoch/i386/boot2/gui.c (revision 2882) +++ branches/ErmaC/Enoch/i386/boot2/gui.c (revision 2883) @@ -51,6 +51,8 @@ iDeviceGeneric_o, iDeviceHFS, iDeviceHFS_o, + iDeviceHFS_hsi, + iDeviceHFS_hsi_o, iDeviceHFS_sie, iDeviceHFS_sie_o, iDeviceHFS_cap, @@ -72,6 +74,8 @@ iDeviceHFSRAID, iDeviceHFSRAID_o, + iDeviceHFSRAID_hsi, + iDeviceHFSRAID_hsi_o, iDeviceHFSRAID_sie, iDeviceHFSRAID_sie_o, iDeviceHFSRAID_cap, @@ -96,6 +100,8 @@ iDeviceHFSFUSION, iDeviceHFSFUSION_o, + iDeviceHFSFUSION_hsi, + iDeviceHFSFUSION_hsi_o, iDeviceHFSFUSION_sie, iDeviceHFSFUSION_sie_o, iDeviceHFSFUSION_cap, @@ -162,6 +168,8 @@ {.name = "device_generic_o", .image = NULL}, {.name = "device_hfsplus", .image = NULL}, {.name = "device_hfsplus_o", .image = NULL}, + {.name = "device_hfsplus_hsi", .image = NULL}, + {.name = "device_hfsplus_hsi_o", .image = NULL}, {.name = "device_hfsplus_sie", .image = NULL}, {.name = "device_hfsplus_sie_o", .image = NULL}, {.name = "device_hfsplus_cap", .image = NULL}, @@ -183,6 +191,8 @@ {.name = "device_hfsraid", .image = NULL}, {.name = "device_hfsraid_o", .image = NULL}, + {.name = "device_hfsraid_hsi", .image = NULL}, + {.name = "device_hfsraid_hsi_o", .image = NULL}, {.name = "device_hfsraid_sie", .image = NULL}, {.name = "device_hfsraid_sie_o", .image = NULL}, {.name = "device_hfsraid_cap", .image = NULL}, @@ -207,6 +217,8 @@ {.name = "device_hfsfusion", .image = NULL}, {.name = "device_hfsfusion_o", .image = NULL}, + {.name = "device_hfsfusion_hsi", .image = NULL}, + {.name = "device_hfsfusion_hsi_o", .image = NULL}, {.name = "device_hfsfusion_sie", .image = NULL}, {.name = "device_hfsfusion_sie_o", .image = NULL}, {.name = "device_hfsfusion_cap", .image = NULL}, @@ -426,6 +438,8 @@ LOADPNG(device_hfsplus, iDeviceGeneric); LOADPNG(device_hfsplus_o, iDeviceHFS); + LOADPNG(device_hfsplus_hsi, iDeviceHFS); + LOADPNG(device_hfsplus_hsi_o, iDeviceHFS_hsi); LOADPNG(device_hfsplus_sie, iDeviceHFS); LOADPNG(device_hfsplus_sie_o, iDeviceHFS_sie); LOADPNG(device_hfsplus_cap, iDeviceHFS); @@ -447,6 +461,8 @@ LOADPNG(device_hfsraid, iDeviceHFS); LOADPNG(device_hfsraid_o, iDeviceHFSRAID); + LOADPNG(device_hfsraid_hsi, iDeviceHFSRAID); + LOADPNG(device_hfsraid_hsi_o, iDeviceHFSRAID_hsi); LOADPNG(device_hfsraid_sie, iDeviceHFSRAID); LOADPNG(device_hfsraid_sie_o, iDeviceHFSRAID_sie); LOADPNG(device_hfsraid_cap, iDeviceHFSRAID); @@ -471,6 +487,8 @@ LOADPNG(device_hfsfusion, iDeviceHFS); LOADPNG(device_hfsfusion_o, iDeviceHFSFUSION); + LOADPNG(device_hfsfusion_hsi, iDeviceHFSFUSION); + LOADPNG(device_hfsfusion_hsi_o, iDeviceHFSFUSION_hsi); LOADPNG(device_hfsfusion_sie, iDeviceHFSFUSION); LOADPNG(device_hfsfusion_sie_o, iDeviceHFSFUSION_sie); LOADPNG(device_hfsfusion_cap, iDeviceHFSFUSION); @@ -1138,6 +1156,10 @@ devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_sie : iDeviceHFS_sie); // Sierra break; } + if (device->OSVersion[4] == '3') { // 10.13 + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_hsi : iDeviceHFS_hsi); // Sierra + break; + } default: devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID : iDeviceHFS); break;