diff --git a/windows/src/buildtools/sentrytool/Keyman.System.AddPdbToPe.pas b/windows/src/buildtools/sentrytool/Keyman.System.AddPdbToPe.pas index f92b815172..0416c8bd54 100644 --- a/windows/src/buildtools/sentrytool/Keyman.System.AddPdbToPe.pas +++ b/windows/src/buildtools/sentrytool/Keyman.System.AddPdbToPe.pas @@ -265,6 +265,9 @@ begin s.SetSize(SectionOffset + SectionRawSize); FillChar((PByte(s.Memory) + SectionOffset)^, SectionRawSize, 0); + nh32 := PImageNtHeaders(NativeUInt(nh32)-NativeUInt(dh)+NativeUInt(s.Memory)); + section := PImageSectionHeader(NativeUInt(section)-NativeUInt(dh)+NativeUInt(s.Memory)); + // Increment the number of sections Inc(nh32.FileHeader.NumberOfSections); @@ -324,6 +327,9 @@ begin s.SetSize(SectionOffset + SectionRawSize); FillChar((PByte(s.Memory) + SectionOffset)^, SectionRawSize, 0); + nh64 := PImageNtHeaders64(NativeUInt(nh64)-NativeUInt(dh)+NativeUInt(s.Memory)); + section := PImageSectionHeader(NativeUInt(section)-NativeUInt(dh)+NativeUInt(s.Memory)); + // Increment the number of sections Inc(nh64.FileHeader.NumberOfSections);