-
-
Notifications
You must be signed in to change notification settings - Fork 252
Description
I wanted to write a documentation for this library, so i digged into source code (for VEH hooks especially). First of all, why not use inline static variables instead of regular static? Secondly, why don't check the result of VirtualProtect in mem_protect? If the function fails, it will trigger an exception and crush the program. I also suggest using [[nodiscard]] in getProtectionObject() of BreakPointHook, becuase if we don't save the result to local variable, the hook will be restored instantly, which will cause an infinity loop upon calling original function. Thirdly, PLH::AVehHook::Handler checks for m_onException and m_onUnhandledException, but you can't specify it, because library does not have an interface for that. Same goes for range-based type of VEH hook. Also if you have two hooks for the same address, the behavior is undefined, because hooks are stored in set. Thats what i spotted by glancing through the code. If the changes are acceptable, i am happy to make a commit. Let me know if the documentation is needed.