Fix nullptr exception when restoring debug functions

This commit is contained in:
jazzwolf 2022-10-07 18:37:14 +02:00 committed by GitHub
parent 3da883537d
commit b7ae95de62

View File

@ -378,6 +378,11 @@ namespace arxan
for (auto i = 0u; i < ARRAYSIZE(functions); ++i)
{
const auto func = ntdll.get_proc<void*>(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);