From 6b2f34f28762d9c8cca1a2dd6adcd86d817ef272 Mon Sep 17 00:00:00 2001 From: belliash Date: Sun, 4 Dec 2022 22:46:33 +0100 Subject: [PATCH] Store physical address as well in the image context --- sdk/xtdk/xtimage.h | 1 + xtldr/modules/pecoff/pecoff.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sdk/xtdk/xtimage.h b/sdk/xtdk/xtimage.h index cc7d535..c15447c 100644 --- a/sdk/xtdk/xtimage.h +++ b/sdk/xtdk/xtimage.h @@ -211,6 +211,7 @@ typedef struct _PECOFF_IMAGE_CONTEXT UINT ImagePages; UINT ImageSize; LOADER_MEMORY_TYPE MemoryType; + PVOID PhysicalAddress; PVOID VirtualAddress; } PECOFF_IMAGE_CONTEXT, *PPECOFF_IMAGE_CONTEXT; diff --git a/xtldr/modules/pecoff/pecoff.c b/xtldr/modules/pecoff/pecoff.c index 7994b60..6e085df 100644 --- a/xtldr/modules/pecoff/pecoff.c +++ b/xtldr/modules/pecoff/pecoff.c @@ -226,6 +226,7 @@ PeLoadImage(IN PEFI_FILE_HANDLE FileHandle, /* Store image data and virtual address */ ImageData->Data = (PUINT8)(UINT_PTR)Address; + ImageData->PhysicalAddress = (PVOID)(UINT_PTR)Address; if(VirtualAddress) { /* Virtual address passed to this routine */