aboutsummaryrefslogtreecommitdiff
path: root/src/zentrack/zentrack.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-12-07 09:02:29 +0100
committerStefan Boberg <[email protected]>2023-12-07 09:02:29 +0100
commit654e0e6d56727e92bdd7e434bbe4a2c5268a2ac0 (patch)
tree0236d8124c760f5bb483a7edbe035b56da28a39e /src/zentrack/zentrack.cpp
parentlinux/mac build fix (diff)
downloadzen-654e0e6d56727e92bdd7e434bbe4a2c5268a2ac0.tar.xz
zen-654e0e6d56727e92bdd7e434bbe4a2c5268a2ac0.zip
minor edits
Diffstat (limited to 'src/zentrack/zentrack.cpp')
-rw-r--r--src/zentrack/zentrack.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/zentrack/zentrack.cpp b/src/zentrack/zentrack.cpp
index af4d94a08..b340bf0a3 100644
--- a/src/zentrack/zentrack.cpp
+++ b/src/zentrack/zentrack.cpp
@@ -134,13 +134,17 @@ DllMain(HINSTANCE, DWORD dwReason, LPVOID)
// Restore the contents in memory import table after a process was started
// with DetourCreateProcessWithDllEx or DetourCreateProcessWithDlls
if (!DetourRestoreAfterWith())
+ {
TerminateCurrentProcess(ZEN_EXITCODE_INIT_FAILED);
+ }
// Grab state
DWORD cbData = 0;
- zen::DetoursPayload* Payload = (zen::DetoursPayload*)DetourFindPayloadEx(DetoursPayloadGuid, &cbData);
+ zen::DetoursPayload* Payload = reinterpret_cast<zen::DetoursPayload*>(DetourFindPayloadEx(DetoursPayloadGuid, &cbData));
if (!Payload || cbData != sizeof(zen::DetoursPayload))
+ {
TerminateCurrentProcess(ZEN_EXITCODE_PAYLOAD_FAILED);
+ }
InstallHooks(*Payload);
}