Add FindVirtualTable method#1075
Merged
roflmuffin merged 1 commit intoroflmuffin:mainfrom Oct 18, 2025
Merged
Conversation
Contributor
Author
|
PS. Hey Rofl, could you check my discord DMs? I wrote you few days ago on discord: slyxncz. Thank you! |
roflmuffin
approved these changes
Oct 18, 2025
Owner
|
Looks good, thank you |
This was referenced Oct 20, 2025
Closed
Closed
This was referenced Oct 20, 2025
Closed
This was referenced Oct 27, 2025
Closed
Closed
Closed
This was referenced Nov 17, 2025
Closed
This was referenced Dec 1, 2025
Merged
Closed
This was referenced Dec 8, 2025
Closed
Merged
This was referenced Dec 23, 2025
This was referenced Jan 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose internal virtual table resolver to scripting layer for CounterStrikeSharp.
Overview
This change introduces a new native function and corresponding managed API method that allow plugins to find vtable pointers by class name directly from a loaded module (e.g.
server.dll).It provides the same functionality that the native side internally uses via
modules::server->FindVirtualTable("ClassName").The new native makes it possible to dynamically resolve class virtual tables from C# plugins and access or call functions through their indices — enabling advanced integrations such as physics tracing or low-level entity systems.
Added Components
Native Function
FIND_VIRTUAL_TABLEThe function returns a raw pointer (
void*) to the vtable of the specified class within the target module.It is internally backed by the same logic as
Module::FindVirtualTable.Native Registration
The native identifier hash is calculated with the standard CounterStrikeSharp
hash_stringfunction:Managed API Integration
A corresponding method was added to
NativeAPIfor use in managed CounterStrikeSharp plugins:Example Usage
This replicates the native logic:
Purpose
CREATE_VIRTUAL_FUNCTIONor manual pointer dereferencing.TraceShape), AI interfaces, or entity extension systems.Author
Michal "Slynx" Přikryl
slynxdev.cz