Skip to content

Fix signed E9 displacement in HookManager - #1840

Merged
praydog merged 1 commit into
praydog:masterfrom
kassent:fix/e9-signed-rel32
Sep 16, 2026
Merged

praydog merged 1 commit into
praydog:masterfrom
kassent:fix/e9-signed-rel32

Conversation

@kassent

@kassent kassent commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Problem

When sdk.hook installs a hook, HookManager may follow an E9 jump to
resolve 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 E9 displacement as int32_t before adding it to the
instruction pointer.

@praydog
praydog merged commit d146137 into praydog:master Sep 16, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants