Repository navigation
Fix signed E9 displacement in HookManager - #1840
Merged
Merged
Conversation
onehoon
added a commit
to onehoon/REFramework
that referenced
this pull request
Sep 24, 2026
* Pak loader redesign + DD2 pak loading fix (praydog#1830) * Deps: Update kananlib * IntegrityCheckBypass: Fix load_patch_func not getting found * Pak loading: Derive flags by reading pak from disk instead of register * Deps: Update kananlib * SDK: Fix sdk::memory::allocate/deallocate on newer games * Pak loading: WIP redesign * SDK: Make allocate/deallocate return early if not found * Pak loading: Remove unused ver redirect code and simplify the pipeline * Pak loading: Move globals/statics to header file, class scope * Deps: Update kananlib (possible fix for praydog#1827, hang/deadlock issue) * Fix collapsed Hooked Methods window (praydog#1833) ImGui windows require an End() for every Begin(), whether or not the window's contents are visible, but the Hooked Methods window would only End if the window wasn't collapsed * Fix signed E9 displacement in HookManager (praydog#1840) --------- Co-authored-by: praydog <2909949+praydog@users.noreply.github.com> Co-authored-by: praydog <praydog@praydog.com> Co-authored-by: Vaeux <123985499+Vaeux@users.noreply.github.com> Co-authored-by: kassent <wangzhengzewzz@gmail.com>
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.
Problem
When
sdk.hookinstalls a hook,HookManagermay follow anE9jump toresolve the method's target address. It treats the jump's 32-bit relative
displacement as unsigned. For backward jumps, the resolved address is 4 GiB
too high, causing hook installation to fail.
Fix
Interpret the
E9displacement asint32_tbefore adding it to theinstruction pointer.