fix(core): Use Signature pattern instead of symbol name for function calls - #14
Open
Dolly132 wants to merge 4 commits into
Open
fix(core): Use Signature pattern instead of symbol name for function calls#14Dolly132 wants to merge 4 commits into
Dolly132 wants to merge 4 commits into
Conversation
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.
This PR aims to solve #13
There is no real test case to confirm that this PR 100% fixes this issue, but it should definitely fix it
In the previous version of CSSFixes, for patches that NOP out specific function calls (Like Msg, and ConMsg), it was getting the actual function address from the shared library (tier0), therefore in rare cases when server crashes and restarts itself automatically, the extension fails to find anything to patch for the patches that require NOPing out Msg and ConMsg function calls.
So I came up with an idea, instead of resolving the symbol name of the function in the shared library and getting its function address by statically
dlopeningthe tier0.so, instead I replaced it with a first matching pattern that calls the targeted function where the last 5 bytes refer to the call instruction for that targeted function, address is calculated by this so the rest of the library has the same address (Unlike when it's statically done from the shared library, with dlopen)However, I can't gurantee that this will fix the issue 100%, but it's worth a try
I made tests where this new change exactly matches what it was doing before