Merge pull request #4158 from keymanapp/fix/windows/4002-tsysinfo-missing-symbolication

fix(windows): sentrytool should fail build on exception and access violation when rewriting executables
This commit is contained in:
Marc Durdin 2020-12-18 14:22:27 +11:00 • committed by GitHub
commit 22d191f16a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View file

@ -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);

View file

@ -16,6 +16,9 @@ begin
ExitCode := main;
except
on E: Exception do
begin
Writeln(E.ClassName, ': ', E.Message);
ExitCode := 1;
end;
end;
end.

View file

@ -6,7 +6,7 @@
build: version.res manifest.res #icons
$(DELPHI_MSBUILD) kmconfig.dproj /p:Platform=Win32
$(SENTRYTOOL_DELPHIPREP) $(WIN32_TARGET_PATH)\kmconfig.exe -dpr kmconfig.exe
$(SENTRYTOOL_DELPHIPREP) $(WIN32_TARGET_PATH)\kmconfig.exe -dpr kmconfig.dpr
$(TDS2DBG) $(WIN32_TARGET_PATH)\kmconfig.exe
$(COPY) $(WIN32_TARGET_PATH)\kmconfig.exe $(PROGRAM)\desktop
if exist $(WIN32_TARGET_PATH)\kmconfig.dbg $(COPY) $(WIN32_TARGET_PATH)\kmconfig.dbg $(DEBUGPATH)\desktop