Skip to content

Commit

Permalink
fixup, quick-fix for coolxv/cpp-stub#21
Browse files Browse the repository at this point in the history
  • Loading branch information
jiridanek committed Jan 4, 2022
1 parent 1e9b47f commit 2fdbefa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/cpp-stub/cpp_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@

//5 byte(jmp rel32)
#define REPLACE_NEAR(t, fn, fn_stub)\
do{\
const int addr = fn_stub - fn - CODESIZE_MIN;\
*fn = 0xE9;\
*(int *)(fn + 1) = (int)(fn_stub - fn - CODESIZE_MIN);\
memcpy((int *)(fn + 1), &addr, sizeof(int));\
}while(false)
//CACHEFLUSH((char *)fn, CODESIZE);
#endif

Expand Down

0 comments on commit 2fdbefa

Please sign in to comment.