View Single Post
Author Message
Scag
AlliedModders Donor
Join Date: May 2017
Location: Crashing Hale
Old 09-19-2023 , 23:51   [EXTENSION] Midhooks
Reply With Quote #1

Hi. I wrote an extension that exposes midfunc/inline hooks for SourceMod.

Sometimes, you have a function you want to hook. And sometimes, the logic you want to fiddle with is way far down under deep in there, and it would be really, really hard to work to get what you want with just a hook. Sometimes, you can recreate the function yourself, but that might not work if it's super big and complicated. Sometimes, you might be able to patch over it, but if you want to execute more logic, then that also might not work. In those some times, you may need to deploy a midfunc hook.

By hand, it isn't very fun, you have to patch in a jump that goes somewhere that contains your own assembly, and then that assembly jump back when you're done. That stinks even more if you need to execute some bonus code.

And thus, that's why I wrote this extension. Here's how it works.

How it works and a test case:
Spoiler


SOURCE
RELEASES
__________________
Over-engineering is underrated.

GitHub
BTC
ETH

Retired

Last edited by Scag; 09-22-2023 at 22:40.
Scag is offline