Chameleon

Chameleon Commit Details

Date:2017-06-18 23:31:17 (6 years 10 months ago)
Author:ErmaC
Commit:2885
Parents: 2884
Message:device IDs update, kernel patch review by CrazyBirdy
Changes:
M/branches/ErmaC/Enoch/i386/libsaio/ati.c
M/branches/ErmaC/Enoch/i386/libsaio/pci_root.c
M/branches/ErmaC/Enoch/i386/libsaio/ati.h
M/branches/ErmaC/Enoch/i386/boot2/kernel_patcher_internal.c
M/branches/ErmaC/Enoch/i386/libsaio/nvidia.c
M/branches/ErmaC/Enoch/i386/boot2/modules.c

File differences

branches/ErmaC/Enoch/i386/libsaio/pci_root.c
88
99
1010
11
11
1212
13
13
1414
1515
1616
#include "bootstruct.h"
#if DEBUG_PCIROOT
#define DBG(x...) printf(x)
#define DBG(x...) printf(x)
#else
#define DBG(x...)
#define DBG(x...)
#endif
static int rootuid = 10; //value means function wasnt ran yet
branches/ErmaC/Enoch/i386/libsaio/nvidia.c
12521252
12531253
12541254
1255
1255
12561256
12571257
12581258
......
13231323
13241324
13251325
1326
13261327
13271328
13281329
......
13451346
13461347
13471348
1349
1350
13481351
13491352
13501353
......
13761379
13771380
13781381
1382
13791383
13801384
13811385
......
14251429
14261430
14271431
1432
1433
1434
14281435
14291436
14301437
14311438
14321439
14331440
1441
14341442
14351443
14361444
......
14381446
14391447
14401448
1449
1450
1451
14411452
14421453
14431454
......
16101621
16111622
16121623
1624
1625
16131626
16141627
16151628
//{ 0x10DE11E7,"GeForce " }, // GK106M
// 11F0 - 11FF
{ 0x10DE11FA,"Quadro K4000" },
{ 0x10DE11FC,"Quadro 2100M" },
{ 0x10DE11FC,"Quadro K2100M" },
{ 0x10DE11FF,"NB1Q" }, //
// 1200 - 120F
{ 0x10DE1200,"GeForce GTX 560 Ti" },
{ 0x10DE134E,"GeForce 930MX" }, // GM108M
{ 0x10DE134F,"GeForce 920MX" }, // GM108M
{ 0x10DE137A,"Quadro K620M/M500M" }, // GM108GLM
{ 0x10DE137B,"Quadro M520" },
{ 0x10DE137D,"GeForce 940A" }, // GM108M
{ 0x10DE1380,"GeForce GTX 750 Ti" },
{ 0x10DE1381,"GeForce GTX 750" },
{ 0x10DE13B1,"Quadro M1000M" }, // GM107GLM
{ 0x10DE13B2,"Quadro M600M" }, // GM107GLM
{ 0x10DE13B3,"Quadro K2200M" }, // GM107GLM
{ 0x10DE13B4,"Quadro M620" },
{ 0x10DE13B6,"Quadro M1200" },
{ 0x10DE13B9,"NVS 810" }, // GM107GL
{ 0x10DE13BA,"Quadro K2200" },
{ 0x10DE13BB,"Quadro K620" },
{ 0x10DE1427,"GeForce GTX 965M" }, // GM206M
{ 0x10DE1430,"Quadro M2000" }, //
{ 0x10DE1431,"Tesla M4" }, // GM206GL
{ 0x10DE1436,"Quadro M2200" },
//{ 0x10DE143F,"Graphics Device" }, //
//{ 0x10DE1600,"Graphics Device" }, //
//{ 0x10DE1601,"Graphics Device" }, //
{ 0x10DE1BB0,"Quadro P5000" }, // GP104GL
//{ 0x10DE1BB1,"Graphics Device" }, // GP104GL
//{ 0x10DE1BB4,"Graphics Device" }, // GP104GL
{ 0x10DE1BB6,"Quadro P5000" },
{ 0x10DE1BB7,"Quadro P4000" },
{ 0x10DE1BB8,"Quadro P3000" },
{ 0x10DE1BE0,"GeForce GTX 1080" }, //GP104M
{ 0x10DE1BE1,"GeForce GTX 1070" }, //GP104M
//{ 0x10DE1C00,"Graphics Device" }, // GP106
//{ 0x10DE1C01,"Graphics Device" }, // GP106
{ 0x10DE1C02, "GeForce GTX 1060"}, // GP106
{ 0x10DE1C03, "GeForce GTX 1060"}, // GP106
//{ 0x10DE1C07, "NVIDIA CMP6-1"}, //
{ 0x10DE1c20,"GeForce GTX 1060" }, //GP106M
//{ 0x10DE1C30,"Graphics Device" }, // GP106GL
{ 0x10DE1C60,"GeForce GTX 1060" }, // GP106M
//{ 0x10DE1C80,"Graphics Device" }, // GP107
//{ 0x10DE1C81,"Graphics Device" }, // GP107
{ 0x10DE1C82,"GeForce GTX 1050 Ti"}, // GP107
// 1D00 - 1EFFF
{ 0x10DE1D10,"GeForce MX150"},
};
static nvidia_card_info_t nvidia_card_exceptions[] = {
{ 0x10DE1140,0x10280565,"Dell GeForce GT 630M" },
{ 0x10DE1140,0x10280568,"Dell GeForce GT 630M" },
{ 0x10DE1140,0x144DC0D5,"Samsung GeForce GT 630M" },
{ 0x10DE1140,0x17AA2200,"NVS 5200M" },
{ 0x10DE1140,0x17AA2213,"GeForce GT 720M" },
{ 0x10DE1140,0x17AA500D,"Lenovo GeForce GT 620M" },
{ 0x10DE1140,0x1B0A20DD,"Pegatron GeForce GT 620M" },
{ 0x10DE1140,0x1B0A20FD,"Pegatron GeForce GT 620M" },
branches/ErmaC/Enoch/i386/libsaio/ati.c
104104
105105
106106
107
107108
108109
109
110110
111111
112112
......
114114
115115
116116
117
118
117119
118
119120
121
122
123
124
125
120126
127
128
129
130
131
121132
122
123
124
133
125134
126135
127136
......
259268
260269
261270
271
262272
263273
264274
......
325335
326336
327337
338
328339
329340
341
342
343
344
345
346
347
348
349
350
351
330352
331353
332354
......
916938
917939
918940
941
942
943
919944
920945
921946
{"Maguro",1},
{"MaguroS",6},
/* AMD8000Controller */
{"Exmoor",6},
{"Baladi", 6},
/* AMD9000Controller */
{"Exmoor",6},
{"MalteseS",1},
{"Lagotto",4},
{"GreyhoundS",1},
{"Basset",4},
{"Greyhound",6},
{"Labrador",6},
/* AMD9300Controller */
{"FlueveSWIP",4},
/* AMD9500Controller */
{"Elqui",5},
{"Acre",3},
{"Dayman",6},
{"Guariba",6},
{"Huallaga", 3},
{"Orinoco", 5},
/* AMD9510Controller */
{"Berbice",5},
/* AMD9515Controller */
{"Mazaruni", 5},
{"Longavi", 5},
/* AMD9520Controller */
{"Elqui",5},
{"Caroni",5},
{"Florin",6},
{"Dayman",6},
{"Guariba",6}
{"Florin",6}
};
static radeon_card_info_t radeon_cards[] = {
{ 0x6763,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon E6460 Series",kHydrilla},
{ 0x6768,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400M Series",kHydrilla},
{ 0x6770,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400 Series",kBulrushes},
{ 0x6771,0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8490",kBulrushes},
{ 0x6772,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7400A Series",kBulrushes},
{ 0x6778,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7000 Series",kBulrushes},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450/7450/8450/R5 230",kBulrushes},
{ 0x6985, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6986, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6987, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6995, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x699F, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
// Vega 10
{ 0x6860,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6861,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6862,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6863,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6864,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6867,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x6868,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x686C,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
{ 0x687F,0x00000000, CHIP_FAMILY_VEGA10,"AMD Radeon Vega 10", kNull },
// PITCAIRN
{ 0x6800,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7970M",kBuri}, // Mobile
{ 0x6801,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 8970M Series",kFutomaki}, // Mobile
"Ellesmere",
"Baffin",
"Greenland",
"Vega10",
//"Vega11",
//"Navi",
""
};
branches/ErmaC/Enoch/i386/libsaio/ati.h
9292
9393
9494
95
9596
9697
9798
9899
99100
100
101101
102
102103
103104
104105
......
108109
109110
110111
112
111113
112114
113115
......
199201
200202
201203
204
202205
203206
204
205207
206208
207209
......
209211
210212
211213
214
215
212216
213
214217
218
219
220
221
222
215223
224
225
226
227
228
216229
217230
218
219
220231
221232
222233
CHIP_FAMILY_PITCAIRN,
CHIP_FAMILY_VERDE,
CHIP_FAMILY_OLAND,
/* Sea Islands */
CHIP_FAMILY_HAINAN,
CHIP_FAMILY_BONAIRE,
CHIP_FAMILY_KAVERI,
CHIP_FAMILY_KABINI,
CHIP_FAMILY_HAWAII,
/* ... */
CHIP_FAMILY_MULLINS,
/* Volcanic Islands */
CHIP_FAMILY_TOPAZ,
CHIP_FAMILY_AMETHYST,
CHIP_FAMILY_TONGA,
CHIP_FAMILY_ELLESMERE, /* Polaris 10 */
CHIP_FAMILY_BAFFIN, /* Polaris 11 */
CHIP_FAMILY_GREENLAND, /* Polaris 12 */
CHIP_FAMILY_VEGA10, /* Vega 10 */
CHIP_FAMILY_LAST
} ati_chip_family_t;
kMaguro,
kMaguroS,
/* AMD8000Controller */
kExmoor,
kBaladi,
/* AMD9000Controller */
kExmoor,
kMalteseS,
kLagotto,
kGreyhoundS,
kBasset,
kGreyhound,
kLabrador,
/* AMD9300Controller */
kFleuveSWIP,
/* AMD9500Controller */
kElqui,
kAcre,
kDayman,
kGuariba,
kHuallaga,
kOrinoco,
/* AMD9510Controller*/
kBerbice,
/* AMD9515Controller */
kMazaruni,
kLongavi,
/* AMD9520Controller */
kElqui,
kCaroni,
kFlorin,
kDayman,
kGuariba,
kCfgEnd
} config_name_t;
branches/ErmaC/Enoch/i386/boot2/modules.c
1616
1717
1818
19
20
19
20
2121
22
23
22
23
2424
2525
2626
#ifdef CONFIG_MODULES
#if CONFIG_MODULE_DEBUG
#define DBG(x...)printf(x)
#define DBGPAUSE()getchar()
#define DBG(x...)printf(x)
#define DBGPAUSE()getchar()
#else
#define DBG(x...)
#define DBGPAUSE()
#define DBG(x...)
#define DBGPAUSE()
#endif
static inline voidrebase_location(UInt32 *location, char *base, int type);
branches/ErmaC/Enoch/i386/boot2/kernel_patcher_internal.c
743743
744744
745745
746
746
747747
748748
749749
750750
751751
752752
753
754
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
755768
756769
757770
......
13431356
13441357
13451358
1359
13461360
13471361
13481362
13491363
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1364
1365
13811366
13821367
13831368
13841369
1385
1370
13861371
13871372
13881373
......
13921377
13931378
13941379
1395
1380
13961381
13971382
13981383
13991384
14001385
1401
1386
1387
1388
1389
1390
1391
1392
14021393
1403
14041394
1405
1406
1407
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
14081405
14091406
14101407
14111408
1412
1409
14131410
14141411
14151412
......
14191416
14201417
14211418
1422
1419
14231420
14241421
14251422
14261423
14271424
1428
1429
1430
1431
1432
1433
1425
14341426
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1427
1428
1429
1430
14551431
1456
14571432
1458
14591433
14601434
14611435
14621436
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1437
15201438
15211439
15221440
15231441
15241442
1525
1443
15261444
15271445
15281446
......
15591477
15601478
15611479
1562
1563
1564
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
15651492
15661493
15671494
15681495
15691496
15701497
1571
1572
1573
1574
1575
1498
15761499
15771500
15781501
15791502
1580
1581
1582
1503
1504
1505
1506
15831507
1584
1508
15851509
1510
1511
1512
1513
15861514
15871515
1516
1517
1518
1519
15881520
15891521
15901522
......
16021534
16031535
16041536
1605
1537
16061538
16071539
16081540
......
16471579
16481580
16491581
1650
1582
16511583
16521584
16531585
verbose("\tFound Yosemite Lapic Version panic at 0x%08X\n", (unsigned int)patchLocation);
break;
}
// Bronya: El Capitan 10.11 Lapic Version
// Bronya: El Capitan 10.11 Lapic Version/10.12/10.13
else if (bytes[i + 0] == 0xff
&& bytes[i + 1] == 0x50
&& bytes[i + 2] == 0x08
&& bytes[i + 38] == 0x31
&& bytes[i + 39] == 0xc0)
{
patchLocation = i + 40;
verbose("\tFound El Capitan Lapic Version panic at 0x%08X\n", (unsigned int)patchLocation);
patchLocation = i + 40;
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"))
{
verbose("\tFound Sierra Lapic Version panic at 0x%08X\n", (unsigned int)patchLocation);
}
else
{
verbose("\tFound El Capitan Lapic Version panic at 0x%08X\n", (unsigned int)patchLocation);
}
break;
}
}
PatchApplied = false;
// High Sierra 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"))
{
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"))
{
for (Index = 0; Index < 0x1000000; ++Index)
{
if ((kernelOSVer >= MacOSVer2Int("10.12"))
&& (Bytes[Index] == 0xC3
// High Sierra
if (Bytes[Index] == 0xC3
&& Bytes[Index + 1] == 0x48
&& Bytes[Index + 2] == 0x85
&& Bytes[Index + 3] == 0xDB
&& Bytes[Index + 4] == 0x74
&& Bytes[Index + 5] == 0x71
&& Bytes[Index + 5] == 0x69
&& Bytes[Index + 6] == 0x48
&& Bytes[Index + 7] == 0x8B
&& Bytes[Index + 8] == 0x03
&& Bytes[Index + 12] == 0xFF
&& Bytes[Index + 13] == 0x50
&& Bytes[Index + 14] == 0x28
&& Bytes[Index + 15] == 0x48))
&& Bytes[Index + 15] == 0x48)
{
Bytes[Index + 4] = 0xEB;
Bytes[Index + 5] = 0x12;
count++;
verbose("\tFound Sierra SIP pattern: patched!\n");
verbose("\tFound High Sierra SIP pattern: patched!\n");
if (PatchApplied)
{
break;
}
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
}
}
// Sierra
if (kernelOSVer >= MacOSVer2Int("10.12") && kernelOSVer < MacOSVer2Int("10.13"))
{
for (Index = 0; Index < 0x1000000; ++Index)
{
// High Sierra
if (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 + 5] == 0x71
&& Bytes[Index + 6] == 0x48
&& Bytes[Index + 7] == 0x8B
&& Bytes[Index + 8] == 0x03
&& Bytes[Index + 12] == 0xFF
&& Bytes[Index + 13] == 0x50
&& Bytes[Index + 14] == 0x28
&& Bytes[Index + 15] == 0x48))
&& Bytes[Index + 15] == 0x48)
{
Bytes[Index + 4] = 0xEB;
Bytes[Index + 5] = 0x12;
count++;
verbose("\tFound High Sierra SIP pattern: patched!\n");
PatchApplied = true;
break;
}
}
}
verbose("\tFound Sierra SIP pattern: patched!\n");
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] == 0xCE
&& Bytes[Index + 9] == 0x02
&& Bytes[Index + 10] == 0x00
&& Bytes[Index + 11] == 0x00)
{
Bytes[Index + 5] = 0x90;
Bytes[Index + 6] = 0x90;
count++;
if (PatchApplied)
{
break;
}
verbose("\tFound Sierra EXT (Yosemite) pattern: patched!\n");
PatchApplied = true;
break;
}
}
}
if (kernelOSVer <= MacOSVer2Int("10.12.3"))
{
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 Sierra EXT (<= 10.12.4) pattern: patched!\n");
PatchApplied = true;
break;
}
}
}
if (kernelOSVer >= MacOSVer2Int("10.12.4"))
{
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] == 0x9E
&& Bytes[Index + 9] == 0x05
&& Bytes[Index + 10] == 0x00
&& Bytes[Index + 11] == 0x00)
{
Bytes[Index + 5] = 0x90;
Bytes[Index + 6] = 0x90;
count++;
verbose("\tFound Sierra (> = 10.12.4) EXT pattern: patched!\n");
PatchApplied = true;
break;
}
}
}
// El Capitan/Yosemite
// Yosemite/El Capitan
if (kernelOSVer >= MacOSVer2Int("10.10") && kernelOSVer < MacOSVer2Int("10.12"))
{
for (Index = 0; Index < 0x1000000; ++Index)
{
// El Capitan
if (Bytes[Index] == 0xC3
if (Bytes[Index] == 0xC3
&& Bytes[Index + 1] == 0x48
&& Bytes[Index + 2] == 0x85
&& Bytes[Index + 3] == 0xDB
PatchApplied = true;
}
// Yosemite and El Capitan
if ((kernelOSVer >= MacOSVer2Int("10.10") && kernelOSVer < MacOSVer2Int("10.12"))
&& (Bytes[Index] == 0xE8
}
}
// Yosemite onward.
// Yosemite/EL Capitan/Sierra/High Sierra
// if (kernelOSVer >= MacOSVer2Int("10.10") && kernelOSVer < MacOSVer2Int("10.14"))
if (kernelOSVer >= MacOSVer2Int("10.10"))
{
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] == 0xCE
&& Bytes[Index + 9] == 0x02
&& Bytes[Index + 10] == 0x00
&& Bytes[Index + 11] == 0x00))
&& Bytes[Index + 7] == 0xE8)
{
Bytes[Index + 5] = 0x90;
Bytes[Index + 6] = 0x90;
count++;
if (kernelOSVer < MacOSVer2Int("10.11"))
{
verbose("\tFound Yosemite EXT pattern: patched!\n");
if (kernelOSVer >= MacOSVer2Int("10.13") && kernelOSVer < MacOSVer2Int("10.14"))
{
verbose("\tFound High Sierra EXT pattern: patched!\n");
}
else
else if (kernelOSVer >= MacOSVer2Int("10.12") && kernelOSVer < MacOSVer2Int("10.13"))
{
verbose("\tFound Sierra EXT pattern: patched!\n");
}
else if (kernelOSVer >= MacOSVer2Int("10.11") && kernelOSVer < MacOSVer2Int("10.12"))
{
verbose("\tFound EL Capitan EXT pattern: patched!\n");
}
else
{
verbose("\tFound Yosemite EXT pattern: patched!\n");
}
if (PatchApplied)
{
for (Index = 0; Index < 0x1000000; ++Index)
{
if (Bytes[Index] == 0xC6
if (Bytes[Index] == 0xC6
&& Bytes[Index + 1] == 0xE8
&& Bytes[Index + 2] == 0x30
&& Bytes[Index + 3] == 0x00
&& Bytes[Index + 9] == 0xDF)
{
Bytes[Index + 5] = 0x90;
Bytes[Index + 6] = 0x90;
Bytes[Index + 6] = 0x90;
count++;
verbose("\tFound Lion EXT pattern: patched!\n");

Archive Download the corresponding diff file

Revision: 2885