Chameleon

Chameleon Commit Details

Date:2017-10-03 11:32:40 (6 years 6 months ago)
Author:ErmaC
Commit:2900
Parents: 2899
Message:typo
Changes:
M/branches/ErmaC/Enoch/i386/boot2/kernel_patcher_internal.c
M/branches/ErmaC/Enoch/package/smbios.plist

File differences

branches/ErmaC/Enoch/i386/boot2/kernel_patcher_internal.c
167167
168168
169169
170
170
171171
172172
173173
......
808808
809809
810810
811
811
812812
813813
814814
......
907907
908908
909909
910
910
911911
912912
913913
......
930930
931931
932932
933
933
934934
935935
936936
......
21262126
21272127
21282128
2129
2129
21302130
21312131
2132
2132
21332133
2134
2134
21352135
21362136
21372137
......
21842184
21852185
21862186
2187
2187
21882188
21892189
21902190
......
22062206
22072207
22082208
2209
2209
22102210
22112211
22122212
......
22252225
22262226
22272227
2228
2228
22292229
22302230
22312231
......
22412241
22422242
22432243
2244
2244
22452245
22462246
22472247
22482248
2249
22502249
2250
22512251
22522252
22532253
22542254
22552255
2256
2256
22572257
22582258
2259
2259
22602260
22612261
22622262
22632263
2264
2264
22652265
22662266
2267
2267
22682268
22692269
22702270
......
22742274
22752275
22762276
2277
2277
22782278
22792279
22802280
22812281
22822282
22832283
2284
2284
22852285
22862286
22872287
// Determine location of _cpuid_set_info _panic call for reference
// basically looking for info_p->cpuid_model = bitfield32(reg[eax], 7, 4);
for (i=0; i<0x1000000; i++)
for (i = 0; i < 0x1000000; i++)
{
if (bytes[i + 0] == 0xC7
&& bytes[i + 1] == 0x05
// Lapic Error Panic 64
bool patch_lapic_init_64(void *kernelData) // KernelLapicPatch_64
{
// Credits to donovan6000 and sherlocks for providing the lapic kernel patch source used to build this function
// Credits to donovan6000 and Sherlocks for providing the lapic kernel patch source used to build this function
UInt8 *bytes = (UInt8 *)kernelData;
UInt32 patchLocation = 0;
verbose("\tFound Yosemite Lapic panic at 0x%08X\n", (unsigned int)patchLocation);
break;
}
// sherlocks: 10.11.DB1
// Sherlocks: 10.11.DP1
else if (KernelLapicError
&& (bytes[i + 0] == 0x65
&& bytes[i + 1] == 0x8B
verbose("\tFound El Capitan Lapic panic at 0x%08X\n", (unsigned int)patchLocation);
break;
}
// sherlocks: 10.12.DP1
// Sherlocks: 10.12.DP1
else if (KernelLapicError
&& (bytes[i+0] == 0x65
&& bytes[i+1] == 0x8B
UInt32 prelinkDictStartLocation = 0;
UInt32 prelinkDictEndLocation = 0;
if (bootInfo->kextConfig.dictionary)
{
KextsPatches = XMLGetProperty(bootInfo->kextConfig.dictionary, (const char*)"KextsPatches");
KextsPatches = XMLGetProperty(bootInfo->kextConfig.dictionary, (const char*)"KextsPatches");
}
verbose("[ KEXTS PATCHER START ]\n");
//int lessBytes = (int)((uncompressed_size/3)*2); // speedup, the _PrelinkInfoDictionary should not be 1/3 of entire cache!
for (Index = 0/*lessBytes*/; Index < uncompressed_size; ++Index)
break;
}
}
if (prelinkDictStartLocation)
{
for (Index = prelinkDictStartLocation; Index < uncompressed_size; ++Index)
&& Bytes[Index + 13] == 0x00)
{
Count++;
if ((Count = 2))
{
canPatchKexts = true;
memcpy(prelinkDic, Bytes+prelinkDictStartLocation, prelinkDictSize);
TagPtr prelinkInfoPtr = NULL;
XMLParseFile( (char *)prelinkDic, &prelinkInfoPtr );
if (prelinkInfoPtr)
{
TagPtr prelinkInfoDictionary = XMLGetProperty(prelinkInfoPtr, "_PrelinkInfoDictionary");
if (sub && XMLIsDict(sub))
{
char* execPath = XMLCastString(XMLGetProperty(sub, (const char*)"CFBundleExecutable"));
if (execPath != NULL)
{
UInt32 kextSize = XMLCastInteger(XMLGetProperty(sub, (const char*)"_PrelinkExecutableSize"));
UInt32 kextAddr = XMLCastInteger(XMLGetProperty(sub, (const char*)"_PrelinkExecutableSourceAddr"));
if (kextAddr && kextSize)
{
// adjust binary address location
kextAddr -= prelinkTextVmaddr;
kextAddr += prelinkTextFileOff;
DBG("\t[%d] found exec:%s (size = %u, kextAddr = 0x%X [vmaddr = 0x%X fileoff = 0x%X])\n", count, execPath,
(unsigned int)kextSize, (unsigned int)kextAddr, (unsigned int)prelinkTextVmaddr, (unsigned int)prelinkTextFileOff);
if (!strcmp(execPath, "FakeSMC"))
{
FakeSMCLoaded = true;
}
// chameleon patches
patchBooterDefinedKext(execPath, kernelData, kextSize, kextAddr);
// user's defined
if (KextsPatches && XMLIsDict(KextsPatches))
{
execPath,
KextsPatches);
}
#if DEBUG_KERNEL
getchar();
#endif
}
}
}
count --;
}
}
branches/ErmaC/Enoch/package/smbios.plist
4141
4242
4343
44
45
46
47
44
45
46
47
4848
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
7777
7878
7979
<key>SMchassisassettag</key>
<string>Pro-Enclosure</string>
<key>SMexternalclock</key>
<string>133</string>
<key>SMmaximalclock</key>
<string>3000</string>
<key>SMexternalclock</key>
<string>133</string>
<key>SMmaximalclock</key>
<string>3000</string>
<key>SMmemtype</key>
<string>24</string>
<key>SMmemspeed</key>
<string>1600</string>
<key>SMmemmanufacturer_1</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_1</key>
<string>0x00001020</string>
<key>SMmempart_1</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_2</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_2</key>
<string>0x00003021</string>
<key>SMmempart_2</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_3</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_3</key>
<string>0x00003021</string>
<key>SMmempart_3</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_4</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_4</key>
<string>0x00003021</string>
<key>SMmempart_4</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemtype</key>
<string>24</string>
<key>SMmemspeed</key>
<string>1600</string>
<key>SMmemmanufacturer_1</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_1</key>
<string>0x00001020</string>
<key>SMmempart_1</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_2</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_2</key>
<string>0x00003021</string>
<key>SMmempart_2</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_3</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_3</key>
<string>0x00003021</string>
<key>SMmempart_3</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_4</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_4</key>
<string>0x00003021</string>
<key>SMmempart_4</key>
<string>0x48594D503131325336344350362D59352020</string>
</dict>
</plist>

Archive Download the corresponding diff file

Revision: 2900