[Lua] Native methods hooking/intercepting

The problem

I’m trying to find a way to use/create a hook for native methods or intercept them in some way. Mainly I’m aiming for blocking cheaters’ LUA executors and other cheats, but also for logging some events that happened, etc.

What I already have

There are some hooks and, in general, ways to intercept some events or natives:

The question

Even though, the above hooks help quite a bit with cheaters and logging, I still look for a way to handle more natives.

How can I hook into or intercept execution of FiveM’s natives? It can be both native-specific or a general solution.

PS. I’m a programmer, the answer can be more complex

If you dig into the FiveM source, you can find where these intecepts and hooks are, and then create pull requests to issue similar events for the things you want events for.

1 Like