From 0b8e2a217b7e246707023513c0d4710647528450 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Tue, 28 Aug 2018 17:47:11 -0400 Subject: [PATCH] better error reporting --- vnrhook/hijack/texthook.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vnrhook/hijack/texthook.cc b/vnrhook/hijack/texthook.cc index 2684cd4..e37d3dc 100644 --- a/vnrhook/hijack/texthook.cc +++ b/vnrhook/hijack/texthook.cc @@ -264,11 +264,11 @@ bool TextHook::UnsafeInsertHookCode() } BYTE* original; - if (int err = MH_CreateHook((void*)hp.address, (void*)trampoline, (void**)&original)) + if (MH_STATUS err = MH_CreateHook((void*)hp.address, (void*)trampoline, (void**)&original)) if (err == MH_ERROR_ALREADY_CREATED) RemoveHook(hp.address); else { - ConsoleOutput(("NextHooker: UnsafeInsertHookCode: FAILED: error " + std::to_string(err)).c_str()); + ConsoleOutput(("NextHooker: UnsafeInsertHookCode: FAILED: error " + std::string(MH_StatusToString(err))).c_str()); return false; }