From 9ed3900512d19de3b62b2e760c3226fc9ca6aac3 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sat, 16 Feb 2019 00:24:36 -0500 Subject: [PATCH] dont remove all hooks when 0 in hcode --- vnrhook/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnrhook/main.cc b/vnrhook/main.cc index 08c38d0..0a237eb 100644 --- a/vnrhook/main.cc +++ b/vnrhook/main.cc @@ -164,7 +164,7 @@ void NewHook(HookParam hp, LPCSTR lpname, DWORD flag) if (++currentHook >= MAX_HOOK) return ConsoleOutput(TOO_MANY_HOOKS); if (lpname && *lpname) strncpy_s(hp.name, lpname, HOOK_NAME_SIZE - 1); ConsoleOutput(INSERTING_HOOK, hp.name); - RemoveHook(hp.address, 0); + if (hp.address) RemoveHook(hp.address, 0); if (!hooks[currentHook].Insert(hp, flag)) ConsoleOutput(HOOK_FAILED); } }