Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed detour_alloc_trampoline_allocate_new #325

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Nov 2, 2024

  1. Fixed detour_alloc_trampoline_allocate_new

    detour_alloc_trampoline_allocate_new(pbTarget, pLo, pHi) was designed with the assumption that pbTarget is going to be between pLo and pHi. In our case, 32-bit cscript!mainCRTStartup was loaded at 0x34020, i.e. pbTarget was below pLo (which was fixed to 0x80000 in detour_2gb_below), and therefore:
    - detour_alloc_region_from_hi(pLo, pbTarget) did not do anything
    - detour_alloc_region_from_lo(pbTarget, pHi) allocated a 64 KiB block below pLo (in our case happened to be 0x70000) which was later discarded and NULL returned in detour_alloc_trampoline
    The fix clamps pbTarget into [pLo, pHi] range.
    miobrado committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    d541c14 View commit details
    Browse the repository at this point in the history