Chameleon

Chameleon Commit Details

Date:2018-10-14 19:48:01 (5 years 6 months ago)
Author:ErmaC
Commit:2911
Parents: 2910
Message:kernel patchers updated to boot Mojave (credits to: CrazyBirdy)
Changes:
M/branches/ErmaC/Enoch/i386/boot2/kernel_patcher_internal.c

File differences

branches/ErmaC/Enoch/i386/boot2/kernel_patcher_internal.c
759759
760760
761761
762
762
763763
764
765
766
767
764768
765769
766770
......
950954
951955
952956
953
957
954958
955959
956960
......
973977
974978
975979
976
980
977981
978982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
9791006
9801007
9811008
......
13621389
13631390
13641391
1365
1392
13661393
13671394
13681395
......
13901417
13911418
13921419
1393
1420
13941421
13951422
13961423
......
14071434
14081435
14091436
1410
1437
14111438
14121439
14131440
......
14871514
14881515
14891516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
14901549
14911550
14921551
{
patchLocation = i + 40;
if (kernelOSVer >= MacOSVer2Int("10.13") && kernelOSVer < MacOSVer2Int("10.14"))
if (kernelOSVer >= MacOSVer2Int("10.14") && kernelOSVer < MacOSVer2Int("10.15"))
{
verbose("\tFound Mojave Lapic Version panic at 0x%08X\n", (unsigned int)patchLocation);
}
else if (kernelOSVer >= MacOSVer2Int("10.13") && kernelOSVer < MacOSVer2Int("10.14"))
{
verbose("\tFound High Sierra Lapic Version panic at 0x%08X\n", (unsigned int)patchLocation);
}
else if (kernelOSVer >= MacOSVer2Int("10.12") && kernelOSVer < MacOSVer2Int("10.13"))
&& bytes[i+1416] == 0x00))
{
patchLocation = i+1398;
DBG("\tFound Sierra Lapic panic at 0x%08X\n", (unsigned int)patchLocation);
verbose("\tFound Sierra Lapic panic at 0x%08X\n", (unsigned int)patchLocation);
break;
}
// PMheart: 10.13.DP1
&& bytes[i+1414] == 0x00))
{
patchLocation = i+1396;
DBG("\tFound High Sierra Lapic panic at 0x%08X\n", (unsigned int)patchLocation);
verbose("\tFound High Sierra Lapic panic at 0x%08X\n", (unsigned int)patchLocation);
break;
}
// PMheart: 10.14.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+1396] == 0x65
&& bytes[i+1397] == 0x8B
&& bytes[i+1398] == 0x0C
&& bytes[i+1399] == 0x25
&& bytes[i+1400] == 0x1C
&& bytes[i+1401] == 0x00
&& bytes[i+1402] == 0x00
&& bytes[i+1403] == 0x00))
{
patchLocation = i+1385;
verbose("\tFound Mojave Lapic panic at 0x%08X\n", (unsigned int)patchLocation);
break;
}
}
if (!patchLocation)
Bytes = (UInt8 *)kernelData;
PatchApplied = false;
// High Sierra onward, need to use 10.12 instead of 10.13. kernel bug?
// High Sierra, Mojave onward, need to use 10.12 instead of 10.13. kernel bug?
// if (kernelOSVer >= MacOSVer2Int("10.13") && kernelOSVer < MacOSVer2Int("10.14"))
if (kernelOSVer >= MacOSVer2Int("10.12"))
{
Bytes[Index + 5] = 0x12;
count++;
verbose("\tFound High Sierra SIP pattern: patched!\n");
verbose("\tFound High Sierra, Mojave SIP pattern: patched!\n");
if (PatchApplied)
{
{
for (Index = 0; Index < 0x1000000; ++Index)
{
// High Sierra
// Sierra
if (Bytes[Index] == 0xC3
&& Bytes[Index + 1] == 0x48
&& Bytes[Index + 2] == 0x85
}
}
// Mojave, need to use 10.12 instead of 10.14. kernel bug?
// if (kernelOSVer >= MacOSVer2Int("10.10") && kernelOSVer < MacOSVer2Int("10.14"))
if (kernelOSVer >= MacOSVer2Int("10.12"))
{
for (Index = 0; Index < 0x1000000; ++Index)
{
if (Bytes[Index] == 0xE8
&& Bytes[Index + 1] == 0xAF
&& 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 + 5] = 0x90;
Bytes[Index + 6] = 0x90;
count++;
verbose("\tFound Mojave EXT pattern: patched!\n");
if (PatchApplied)
{
break;
}
PatchApplied = true;
}
}
}
// Yosemite onward.
// Yosemite/EL Capitan/Sierra/High Sierra
// if (kernelOSVer >= MacOSVer2Int("10.10") && kernelOSVer < MacOSVer2Int("10.14"))

Archive Download the corresponding diff file

Revision: 2911