Merge pull request #48 from jazzwolf/main

Fix nullptr exception when restoring debug functions
This commit is contained in:
Maurice Heumann 2022-10-07 18:42:24 +02:00 committed by GitHub
commit 5db7334759

View File

@ -378,6 +378,11 @@ namespace arxan
for (auto i = 0u; i < ARRAYSIZE(functions); ++i) for (auto i = 0u; i < ARRAYSIZE(functions); ++i)
{ {
const auto func = ntdll.get_proc<void*>(functions[i]); const auto func = ntdll.get_proc<void*>(functions[i]);
if (!func)
{
continue;
}
if (!loaded) if (!loaded)
{ {
memcpy(buffers[i], func, sizeof(buffer)); memcpy(buffers[i], func, sizeof(buffer));
@ -700,7 +705,7 @@ namespace arxan
void pre_start() override void pre_start() override
{ {
disable_tls_callbacks(); disable_tls_callbacks();
//restore_debug_functions(); restore_debug_functions();
hide_being_debugged(); hide_being_debugged();
scheduler::loop(hide_being_debugged, scheduler::pipeline::async); scheduler::loop(hide_being_debugged, scheduler::pipeline::async);