Chameleon

Chameleon Commit Details

Date:2017-08-13 13:16:33 (1 year 1 month ago)
Author:ErmaC
Commit:2893
Parents: 2892
Message:update mask for csrInfo
Changes:
M/branches/ErmaC/Enoch/i386/boot2/boot.c

File differences

branches/ErmaC/Enoch/i386/boot2/boot.c
231231
232232
233233
234
235234
236235
237236
......
13211320
13221321
13231322
1324
1323
13251324
13261325
1327
1328
1326
1327
13291328
13301329
13311330
......
13501349
13511350
13521351
1353
1352
1353
1354
13541355
1355
1356
13561357
13571358
1358
1359
13591360
13601361
13611362
1362
1363
13631364
13641365
13651366
13661367
13671368
1368
1369
1370
1371
1372
1373
1374
1375
1376
1369
1370
1371
1372
1373
1374
1375
1376
1377
13771378
13781379
13791380
// ===============================================================================
gMacOSVersion[0] = 0;
// TODO identify sierra as macOS
verbose("Booting on %s %s (%s)\n", (MacOSVerCurrent < MacOSVer2Int("10.8")) ? "Mac OS X" : (MacOSVerCurrent < MacOSVer2Int("10.12")) ? "OS X" : "macOS", gBootVolume->OSFullVer, gBootVolume->OSBuildVer );
setupBooterArgs();
}
else
{
bootArgs->flags|= kBootArgsFlagCSRActiveConfig;
bootArgs->flags|= kBootArgsFlagCSRActiveConfig;
}
// Set limit to 7bit
if ( getIntForKey(kCsrActiveConfig, &csrValue, &bootInfo->chameleonConfig) && (csrValue >= 0 && csrValue <= 127) )
// Set limit to 8bit
if ( getIntForKey(kCsrActiveConfig, &csrValue, &bootInfo->chameleonConfig) && (csrValue >= 0 && csrValue <= 255) )
{
bootArgs->csrActiveConfig= csrValue;
csrInfo(csrValue, 1);
// ErmaC
void csrInfo(int csrValue, bool custom)
{
int mask = 0x20;
#define CSR_BITS 0x080
int mask = CSR_BITS;
verbose("System Integrity Protection status: %s ", (csrValue == 0) ? "enabled":"disabled");
verbose("(%s Configuration).\nCsrActiveConfig = 0x%02x (", custom ? "Custom":"Default", csrValue);
verbose("(%s Configuration).\nCsrActiveConfig = 0x%02X (", custom ? "Custom":"Default", csrValue);
// Display integer number into binary using bitwise operator
((csrValue & 0x20) == 0) ? verbose("0"): verbose("1");
((csrValue & 0x020) == 0) ? verbose("0"): verbose("1");
while (mask != 0)
{
( ((csrValue & mask) == 0) ? verbose("0"): verbose("1") );
mask = mask >> 1;
mask = mask >> 1; // Right Shift
}
verbose(")\n");
if (csrValue != 0)
{
verbose("\nConfiguration:\n");
verbose("Kext Signing: %s\n", ((csrValue & 0x01) == 0) ? "enabled":"disabled"); /* (1 << 0) Allow untrusted kexts */
verbose("Filesystem Protections: %s\n", ((csrValue & 0x02) == 0) ? "enabled":"disabled"); /* (1 << 1) Allow unrestricted file system. */
verbose("Task for PID: %s\n", ((csrValue & 0x04) == 0) ? "enabled":"disabled"); /* (1 << 2) */
verbose("Debugging Restrictions: %s\n", ((csrValue & 0x08) == 0) ? "enabled":"disabled"); /* (1 << 3) */
verbose("Apple Internal: %s\n", ((csrValue & 0x10) == 0) ? "enabled":"disabled"); /* (1 << 4) */
verbose("DTrace Restrictions: %s\n", ((csrValue & 0x20) == 0) ? "enabled":"disabled"); /* (1 << 5) Allow unrestricted dtrace */
verbose("NVRAM Protections: %s\n", ((csrValue & 0x40) == 0) ? "enabled":"disabled"); /* (1 << 6) Allow unrestricted NVRAM */
//verbose("DEVICE configuration: %s\n", ((csrValue & 0x80) == 0) ? "enabled":"disabled"); /* (1 << 7) Allow device configuration */
//verbose("Disable BaseSystem Verification: %s\n", ((csrValue & 0x100) == 0) ? "enabled":"disabled"); /* (1 << 8) Disable BaseSystem Verification */
verbose("Kext Signing: %s\n", ((csrValue & 0x001) == 0) ? "enabled":"disabled"); /* (1 << 0) Allow untrusted kexts */
verbose("Filesystem Protections: %s\n", ((csrValue & 0x002) == 0) ? "enabled":"disabled"); /* (1 << 1) Allow unrestricted file system. */
verbose("Task for PID: %s\n", ((csrValue & 0x004) == 0) ? "enabled":"disabled"); /* (1 << 2) */
verbose("Debugging Restrictions: %s\n", ((csrValue & 0x008) == 0) ? "enabled":"disabled"); /* (1 << 3) */
verbose("Apple Internal: %s\n", ((csrValue & 0x010) == 0) ? "enabled":"disabled"); /* (1 << 4) */
verbose("DTrace Restrictions: %s\n", ((csrValue & 0x020) == 0) ? "enabled":"disabled"); /* (1 << 5) Allow unrestricted dtrace */
verbose("NVRAM Protections: %s\n", ((csrValue & 0x040) == 0) ? "enabled":"disabled"); /* (1 << 6) Allow unrestricted NVRAM */
verbose("Device configuration: %s\n", ((csrValue & 0x080) == 0) ? "enabled":"disabled"); /* (1 << 7) Allow device configuration */
verbose("BaseSystem Verification: %s\n", ((csrValue & 0x100) == 0) ? "enabled":"disabled"); /* (1 << 8) Allow any Recovery OS */
}
verbose("\n");
}

Archive Download the corresponding diff file

Revision: 2893