mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-23 16:17:40 +01:00
right way to patch kexts
Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
parent
f7c13f0b84
commit
0143e228ee
@ -558,17 +558,21 @@
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Comment</key>
|
||||
<string>Patch 8 apples</string>
|
||||
<string>Violet strips</string>
|
||||
<key>Disabled</key>
|
||||
<true/>
|
||||
<key>Find</key>
|
||||
<data>AQAAdSI=</data>
|
||||
<key>MatchOS</key>
|
||||
<string>10.13</string>
|
||||
<false/>
|
||||
<key>Name</key>
|
||||
<string>IOGraphicsFamily</string>
|
||||
<string>com.apple.kext.AMDSupport</string>
|
||||
<key>Procedure</key>
|
||||
<string>TestVRAM</string>
|
||||
<key>Find</key>
|
||||
<data>VUiJ</data>
|
||||
<key>Replace</key>
|
||||
<data>AQAA6yI=</data>
|
||||
<data>sAHD</data>
|
||||
<key>FindMask</key>
|
||||
<data>AAAA</data>
|
||||
<key>RangeFind</key>
|
||||
<integer>10</integer>
|
||||
</dict>
|
||||
</array>
|
||||
<key>KernelXCPM</key>
|
||||
|
@ -372,7 +372,7 @@ struct segment_command_64 { /* for 64-bit architectures */
|
||||
vm_prot_t initprot; /* initial VM protection */ //3c
|
||||
uint32_t nsects; /* number of sections in segment */ //40
|
||||
uint32_t flags; /* flags */ //44
|
||||
//struct section_64 sect[nsects]; //0x48 if nsect > 0
|
||||
// struct section_64 sect[]; //0x48 if nsect > 0 len=nsects
|
||||
};
|
||||
|
||||
/* Constants for the flags field of the segment_command */
|
||||
@ -1565,14 +1565,285 @@ struct note_command {
|
||||
//kexts cache
|
||||
struct command_35 {
|
||||
uint32_t cmd; //0x35 - LC_KEXT
|
||||
uint32_t cmdsize; //0x38 - short name, 0x48 - long name
|
||||
uint32_t cmdsize; //0x38 - short name, 0x48 - long name, ...
|
||||
uint64_t offset; /* file offset of this data */
|
||||
uint64_t size; /* length of data region */
|
||||
uint32_t res1;
|
||||
uint32_t res2;
|
||||
char name[16]; //kext name [16] or [32]
|
||||
uint32_t res1; //=0x20
|
||||
uint32_t res2; //=0x00
|
||||
char name[]; //kext name [16] or [32]
|
||||
// align to 8 byte boundary
|
||||
};
|
||||
|
||||
//from file nlist.h
|
||||
//struct symtab_command {
|
||||
// uint32_t cmd; /* LC_SYMTAB == 2 */
|
||||
// uint32_t cmdsize; /* sizeof(struct symtab_command) */
|
||||
// uint32_t symoff; /* symbol table offset */
|
||||
// uint32_t nsyms; /* number of symbol table entries */
|
||||
// uint32_t stroff; /* string table offset */
|
||||
// uint32_t strsize; /* string table size in bytes */
|
||||
//};
|
||||
|
||||
/*
|
||||
* This is the symbol table entry structure for 64-bit architectures.
|
||||
*/
|
||||
struct nlist_64 {
|
||||
union {
|
||||
uint32_t n_strx; /* index into the string table */ //str_adr=stroff+n_strx
|
||||
} n_un;
|
||||
uint8_t n_type; /* type flag, see below */
|
||||
uint8_t n_sect; /* section number or NO_SECT */
|
||||
uint16_t n_desc; /* see <mach-o/stab.h> */
|
||||
uint64_t n_value; /* value of this symbol (or stab offset) */
|
||||
};
|
||||
//samples, str=0x39A9C48
|
||||
//25000000 0F060000 940BFF00 80FFFFFF constructors_used |