reduce search range, by tluck

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-07-06 07:04:01 +03:00
parent d1fbcb92bf
commit b9f87e1443
2 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@ EFI_STATUS LOADER_ENTRY::getVTable()
//00FFFFFF FF0FFFFF 00000000 FFFFFFFF
// INT32 Tabble = FindBin(KernelData, 0x5000000, vtableSur, 8);
INT32 NTabble = FindBin(KernelData, 0x5000000, (const UINT8 *)ctor_used, (UINT32)strlen(ctor_used));
INT32 NTabble = FindBin(KernelData, 0x2000000, (const UINT8 *)ctor_used, (UINT32)strlen(ctor_used));
if (NTabble < 0) {
return EFI_NOT_FOUND;
}

View File

@ -1087,7 +1087,7 @@ VOID EFIAPI LOADER_ENTRY::KernelBooterExtensionsPatch()
//ffffff80009a227b
UINTN taskLocation = searchProc("IOTaskHasEntitlement");
procLocation = searchProc("loadExecutable");
patchLocation2 = FindMemMask(&KernelData[procLocation], 0x1000, find3, sizeof(find3), mask3, sizeof(mask3));
patchLocation2 = FindMemMask(&KernelData[procLocation], 0x500, find3, sizeof(find3), mask3, sizeof(mask3));
DBG("IOTaskHasEntitlement at 0x%llx, loadExecutable at 0x%llx\n", taskLocation, procLocation);
if (patchLocation2 != KERNEL_MAX_SIZE) {
DBG_RT("=> patch SIP applied\n");
@ -1099,7 +1099,7 @@ VOID EFIAPI LOADER_ENTRY::KernelBooterExtensionsPatch()
KernelData[patchLocation2 + 4] = 0x12;
}
} else {
patchLocation2 = FindRelative32(KernelData, procLocation, 0x1000, taskLocation);
patchLocation2 = FindRelative32(KernelData, procLocation, 0x500, taskLocation);
if (patchLocation2 != 0) {
DBG_RT("=> patch2 SIP applied\n");
KernelData[patchLocation2] = 0xEB;