REPENTOGON
REPENTOGON copied to clipboard
[ZHL] Detours generates invalid trampolines on functions that start with jumps
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.
Duplicate of #122 ?
Not exactly, this issue is about the offset of the jump not being changed when the bytes are copied, the other issue is about jump backs to the beginning of the function not being adjusted, but both issues relate to the same meta issue