Hook virtual functions by offset#617
Conversation
DynamicDynamicHooks to support virtual functions
managed/CounterStrikeSharp.API/Modules/Memory/DynamicFunctions/BaseMemoryFunction.cs
Outdated
Show resolved
Hide resolved
managed/CounterStrikeSharp.API/Modules/Memory/DynamicFunctions/BaseMemoryFunction.cs
Show resolved
Hide resolved
5c674f5 to
73fe4ff
Compare
|
@roflmuffin +1 on this |
my second review has to be resolved before this pr is ready |
what is second pr? can community help you somehow? |
this is the second review |
DynamicHooks to support virtual functions|
virtual functions that has been created by an offset are now stored as
the hook itself is reused, but currently only the latter is called, I believe this could also happen if the same function is hooked with 2 different signatures? (tested it and yes) |
|
is there any plans to add this to the main branch? |
Hi, I plan to finish it in general, just need to find a better way to store these functions as the behaviour I've mentioned in my previous comment is not really viable in my opinion |
|
Looking forward for it |
|
This is fixed by #1143 and released |
With these changes, we will be able to hook virtual functions based on offset.
Example
Testing
StartTouch,Touch,EndTouchhooks on the soccerball in de_dust2{ "StartTouch": { "offsets": { "windows": 143, "linux": 142 } }, "Touch": { "offsets": { "windows": 144, "linux": 143 } }, "EndTouch": { "offsets": { "windows": 145, "linux": 144 } } }Debug output:
Developers should be aware that they are hooking the virtual function, which is shared between instances (same as with signatures)