From 444ef28d2478ec00ae3f47a8ab200a95835e0ac2 Mon Sep 17 00:00:00 2001 From: Winslow <33692631+senzee1984@users.noreply.github.com> Date: Fri, 16 Feb 2024 19:44:01 -0500 Subject: [PATCH] Update DumpPEFromMemory.cpp --- DumpPEFromMemory/DumpPEFromMemory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DumpPEFromMemory/DumpPEFromMemory.cpp b/DumpPEFromMemory/DumpPEFromMemory.cpp index e58c157..b53fb05 100644 --- a/DumpPEFromMemory/DumpPEFromMemory.cpp +++ b/DumpPEFromMemory/DumpPEFromMemory.cpp @@ -166,6 +166,10 @@ int main(int argc, char* argv[]) printf("Error"); } - TerminateProcess(pi.hProcess, 0); + if (!TerminateProcess(pi.hProcess, 0)) { + printf("TerminateProcess failed (%d).\n", GetLastError()); + return 1; + } + return 0; }