Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INLINEHOOK] Update thread PC correctly when unhooking
This change from the bug found by @hakujitsu7 in Microsoft Detours PR microsoft#331: microsoft#331, but matches rbCode region explicitly.
- Loading branch information
35aa2ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement! This fix ensures that the thread's program counter is correctly checked against
rbCode
, making the detour removal process more robust. However, on the x64 architecture, the PC may also point to instructions withinrbCodeIn
, not justrbCode
. To fully cover this case, it might be worth extending the condition to includerbCodeIn
as well. This would help prevent potential edge cases where the PC is not properly updated during unhooking.35aa2ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR #2 is opened for covering this case, and invite you @hakujitsu7 to review it.