TeamREPENTOGON / TeamREPENTOGON/REPENTOGON

[ZHL] Detours generates invalid trampolines on functions that start with jumps

Open
#121 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ZHL
Dominant language
C++
Stars
345
Forks
51
Avg merge
11h 2m
Merged PRs (30d)
4

Description

If a to-be detoured function contains a jump anywhere within its first five bytes, Detours generates an invalid trampoline when detouring. It naively copies all bytes of all broken instructions within the first five bytes, which includes the relative offset of the jump. This offset needs to be fixed to redirect towards the original code properly.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the Detours trampoline-generation and instruction-copying logic, then reproduce the issue with a detoured function whose first five bytes contain a jump. Trace how the jump’s relative offset is handled; done means the generated trampoline redirects correctly to the original code.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
reverse-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.