From 190da1d44d8758aa64c196f4b9f9c0e59c6e5b20 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sat, 17 Sep 2022 10:26:21 +0200 Subject: [PATCH] Fix integrity debug prints --- src/client/component/arxan.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client/component/arxan.cpp b/src/client/component/arxan.cpp index 04125e2a..155233b9 100644 --- a/src/client/component/arxan.cpp +++ b/src/client/component/arxan.cpp @@ -6,10 +6,8 @@ #include #include "utils/io.hpp" -#include "utils/finally.hpp" #include "utils/string.hpp" #include "utils/thread.hpp" -#include "utils/hardware_breakpoint.hpp" #define ProcessDebugPort 7 #define ProcessDebugObjectHandle 30 // WinXP source says 31? @@ -426,11 +424,13 @@ namespace arxan uint32_t adjust_integrity_checksum(const uint64_t return_address, uint8_t* stack_frame, const uint32_t current_checksum) { + const auto handler_address = reverse_g(return_address - 5); const auto* context = search_handler_context(stack_frame, current_checksum); if (!context) { - OutputDebugStringA(utils::string::va("Unable to find frame offset for: %llX", return_address)); + MessageBoxA(nullptr, utils::string::va("No frame offset for: %llX", handler_address), "Error", MB_ICONERROR); + TerminateProcess(GetCurrentProcess(), 0xBAD); return current_checksum; } @@ -440,7 +440,6 @@ namespace arxan if (current_checksum != correct_checksum) { #ifndef NDEBUG - const auto handler_address = return_address - 5; printf("Adjusting checksum (%llX): %X -> %X\n", handler_address, current_checksum, correct_checksum); #endif