New Features for exlaunch + marshmallow - #6
Open
Werechang wants to merge 11 commits into
Open
Conversation
Werechang
commented
Dec 3, 2025
Werechang
left a comment
Contributor
Author
There was a problem hiding this comment.
I will fix these things now and hope that this should be it
…defined symbols, wrong type for float inline hook
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 still needs some testing which I'll do in the next days.
NZCV access in inline hooks
The NZCV flags are now available in inline hooks. The only reason is that it got thrashed in older versions of exlaunch
so it needed to be backed up anyway.
Branched inline hooks
The branched inline hook allows you to jump to different spots in the code. This is useful when hooking a loop to
achieve equivalent results to
continueorbreakor to branch to the rightspot in nested control structures.
The branched inline hook requires
Callbackto return auint8_ttype, and take a valid inline context typeparameter (meaning inline float context works too). It needs a
static constexpr ptrdiff_t[]with the values being 4aligned.
C++20 Concepts for inline hooks
As foreshadowed in the text above, inline hook constraints are now concept based to be more readable and easier to use.
Extended and safe instruction API
A few instruction types were added:
b.eqandb.neAnd all instruction parameters are now compile time checked to capture register width mix-ups and immediate sizes being
too big. The error messages aren't very intuitive to read, but that is still better than exlaunch silently running into
unexpected behavior.
Error handling, logging and readability
Instead of relying on exlaunch's error codes the user now receives log messages which help better to track errors down.
The user is notified within the log if exlaunch has to resort to hook patches which possibly cause unexpected behavior.
Register thrashes usually come with that and are also logged.
These warnings usually happen when the exlaunch module is too far away from the target module.
Symbol + Offset hooking
Hook::InstallAtSymbolnow takes aSymbolinstead of aconst char*which can be constructed with the_symliteral. The class implements
operator+to support the symbol + offset hook. Trampoline and Replace hooks still usethe old method with
const char*to preserve backwards compatibility.This change unfortunately breaks the old API for inline hooks by removing the option for
const char*symbols.It was removed for the reason that
const char*andptrdiff_tcan be added, but it leads to an invalid symbol.Users might then forget
_symand writeInstallAtSymbol("MySym" + 0x4), which is invalid.An implicit conversion from
const char*toSymbolwouldn't have worked since the plus operator gets evaluated beforethe expression is converted.
Exlaunch internal changes + bugfixes
General TODOs
These are things I will probably do in the future which won't be a part of this merge request.