aboutsummaryrefslogtreecommitdiff
path: root/EfiGuardDxe/PatchWinload.c
diff options
context:
space:
mode:
authorMatthijs Lavrijsen <mattiwatti@gmail.com>2023-04-03 01:21:37 +0200
committerMatthijs Lavrijsen <mattiwatti@gmail.com>2023-04-03 01:21:37 +0200
commit616f587d55819eabb58529b5321c220ce5d66d3d (patch)
tree3f1d9eeb05f8224c7c7ba9f397f37e04ca855483 /EfiGuardDxe/PatchWinload.c
parent383aea8793ad97011ae97648d2338cd003bd1923 (diff)
EfiGuardDxe: distinguish between winload and kernel build numbers
Diffstat (limited to 'EfiGuardDxe/PatchWinload.c')
-rw-r--r--EfiGuardDxe/PatchWinload.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/EfiGuardDxe/PatchWinload.c b/EfiGuardDxe/PatchWinload.c
index baa28d7..197ca75 100644
--- a/EfiGuardDxe/PatchWinload.c
+++ b/EfiGuardDxe/PatchWinload.c
@@ -131,7 +131,7 @@ HookedOslFwpKernelSetupPhase1(
CopyWpMem((VOID*)gOriginalOslFwpKernelSetupPhase1, gOslFwpKernelSetupPhase1Backup, sizeof(gHookTemplate));
UINT8* LoadOrderListHeadAddress = (UINT8*)&LoaderBlock->LoadOrderListHead;
- if (gKernelPatchInfo.BuildNumber < 7600)
+ if (gKernelPatchInfo.WinloadBuildNumber < 7600)
{
// We are booting Vista or some other fossil, which means that our LOADER_PARAMETER_BLOCK declaration in no way matches what is
// actually being passed by the loader. Notably, the first four UINT32 fields are absent, so fix up the list entry pointer.
@@ -609,6 +609,9 @@ PatchWinload(
{
Print(L"\r\nPatching winload.efi v%u.%u.%u.%u...\r\n", MajorVersion, MinorVersion, BuildNumber, Revision);
+ // Some... adjustments... need to be made later on in the case of pre-Windows 7 loader blocks, so store the build number
+ gKernelPatchInfo.WinloadBuildNumber = BuildNumber;
+
// Check if this is a supported winload version. All patches should work on all versions since Vista SP1,
// except for the ImgpFilterValidationFailure patch because this function only exists on Windows 7 and higher.
if (BuildNumber < 6001)
@@ -617,9 +620,6 @@ PatchWinload(
Status = EFI_UNSUPPORTED;
goto Exit;
}
-
- // Some... adjustments... need to be made later on in the case of pre-Windows 7 loader blocks, so store the build number
- gKernelPatchInfo.BuildNumber = BuildNumber;
}
// Find the .text and .rdata sections