Closed bogen85 closed 1 year ago
As you can tell by the commit history, this was weekend project so I simply forgot to call PlatformFree. Unfortunately I am quite busy atm but I will try to push a fix as soon as possible for it so you won't need to call it manually.
No rush! Thanks! As I have a suitable solid workaround I don't need immediate resolution on this. Was mainly wanting to point it out.
I see you updated it! Thanks. I removed my work around.
Was resolved in this commit: https://github.com/SamuelTulach/LightHook/commit/451093cb6944080927b0270fdf6e542c47721d45
First off, let me say that of all the hooking libraries I tried recently
LightHook
is first one I got completely working. :smile:A couple issues regarding compiling, but I may file separate issues for those. (Mainly in regard to
-Wall -Werror
and could not get around those with clang++) Also, noarm
,arm64
orrisc-v
support, but I may have a friend help me getLightHook
working with those architectures.I was able to compile with
g++ -Wall -Werror -Os -std=gnu++17 -Wno-pointer-arith -Wno-error=parentheses -Wno-parentheses -Wno-error=sign-compare -Wno-sign-compare
and that is how I noticed thatPlatformFree
was never being called (as I got an error about that, and was not going to disable that warning/error).I'm using this with Free Pascal (
FPC
) and there was no way it could importLightHook.h
(without major surgery) so I did not bother, I just wrote a wrapperC
unit and created a much smaller header file thatFPC
could import.In my wrapper I'm calling
PlatformFree
immediately afterDisableHook
.Despite functions I tried hooking not being
C
compatible as far as calling,LightHook
had no problem hooking them.So, should I be calling
PlatformFree
immediately afterDisableHook
each time? I noticed I could enable and disable more than once and it performed as expected.