diff --git a/Tools/Source/TianoTools/PeCoffLoader/BasePeCoff.c b/Tools/Source/TianoTools/PeCoffLoader/BasePeCoff.c index 9c25e1f4b8..556b2d73c9 100644 --- a/Tools/Source/TianoTools/PeCoffLoader/BasePeCoff.c +++ b/Tools/Source/TianoTools/PeCoffLoader/BasePeCoff.c @@ -858,7 +858,7 @@ Returns: Base = PeCoffLoaderImageAddress (ImageContext, Section->VirtualAddress); End = PeCoffLoaderImageAddress ( ImageContext, - Section->VirtualAddress + Section->Misc.VirtualSize - 1 + Section->VirtualAddress + Section->SizeOfRawData - 1 ); if (ImageContext->IsTeImage) { Base = (CHAR8 *) ((UINTN) Base + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize);