Skip to content

Commit

Permalink
fixup! Simplified DebugDisplayTextBuffer hooking.
Browse files Browse the repository at this point in the history
  • Loading branch information
MiranDMC committed Sep 21, 2024
1 parent ae15676 commit 429d038
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/Mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inline void MemCopy(U p, const T* v) { memcpy((void*)p, v, sizeof(T)); }
template<typename T, typename U>
inline void MemCopy(U p, const T* v, int n) { memcpy((void*)p, v, n); }

// Write a jump to v to the address at p and copy the replaced call address to r
// Write a jump to v to the address at p and copy the replaced jump address to r
template<typename T, typename U>
inline void MemJump(U p, const T v, T *r = nullptr)
{
Expand All @@ -29,7 +29,9 @@ inline void MemJump(U p, const T v, T *r = nullptr)
*r = (T)(MemRead<DWORD>(p + 1) + p + 5);
break;

//case OP_JMPSHORT: // TODO
case OP_JMPSHORT:
*r = (T)(MemRead<BYTE>(p + 1) + p + 2);
break;

default:
*r = (T)nullptr;
Expand Down

0 comments on commit 429d038

Please sign in to comment.