kernel addresses are shifted

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2020-07-23 23:42:29 +03:00
parent 0143e228ee
commit c87aabd9fe

View File

@ -2483,7 +2483,7 @@ LOADER_ENTRY::KernelAndKextPatcherInit()
KernelData = NULL;
return;
}
DBG( " kernel offset at 0x%x\n", KernelOffset);
// DBG( " kernel offset at 0x%x\n", KernelOffset);
// find __PRELINK_TEXT and __PRELINK_INFO
Get_PreLink();
//find symbol tables
@ -2491,8 +2491,8 @@ LOADER_ENTRY::KernelAndKextPatcherInit()
UINT32 symCmdOffset = 0;
Get_Symtab(&KernelData[KernelOffset], &symCmdOffset);
if (symCmdOffset != 0) {
symCmd = (struct symtab_command *)&KernelData[symCmdOffset];
AddrVtable = symCmd->symoff;
symCmd = (struct symtab_command *)&KernelData[KernelOffset + symCmdOffset];
AddrVtable = symCmd->symoff; //this offset relative to KernelData+0
SizeVtable = symCmd->nsyms;
NamesTable = symCmd->stroff;
DBG("Kernel: AddrVtable=0x%x SizeVtable=0x%x NamesTable=0x%x\n", AddrVtable, SizeVtable, NamesTable);