From b7ae95de62d0d82b4f8429e7982ff2370e5f42a1 Mon Sep 17 00:00:00 2001 From: jazzwolf <114281491+jazzwolf@users.noreply.github.com> Date: Fri, 7 Oct 2022 18:37:14 +0200 Subject: [PATCH] Fix nullptr exception when restoring debug functions --- src/client/component/arxan.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/component/arxan.cpp b/src/client/component/arxan.cpp index e052b166..b2d9dd9e 100644 --- a/src/client/component/arxan.cpp +++ b/src/client/component/arxan.cpp @@ -378,6 +378,11 @@ namespace arxan for (auto i = 0u; i < ARRAYSIZE(functions); ++i) { const auto func = ntdll.get_proc(functions[i]); + if (!func) + { + continue; + } + if (!loaded) { memcpy(buffers[i], func, sizeof(buffer)); @@ -700,7 +705,7 @@ namespace arxan void pre_start() override { disable_tls_callbacks(); - //restore_debug_functions(); + restore_debug_functions(); hide_being_debugged(); scheduler::loop(hide_being_debugged, scheduler::pipeline::async);