Advertisement
Guest User

luaD_precall example

a guest
May 27th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. int hacker = 0;
  2. int func_loc = (int)(*curr_func(L)->c.f);
  3.  
  4. if ((int)func_loc >= aslr(0x423600)) {
  5. printConsole("You were caught trying to push a CClosure that is not within our application's range.");
  6. hacker = 1;
  7. }
  8.  
  9. const char i3_8opcode[8] = { 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC };
  10. if (memcmp((void*)(func_loc), i3_8opcode, sizeof(i3_8opcode)) == 0) {
  11. printConsole("You were caught trying to use VEH to bypass our internal checks.");
  12. hacker = 1;
  13. }
  14.  
  15. if (!hacker) {
  16. n = (*curr_func(L)->c.f)(L); /* do the actual call */
  17. }
  18. else {
  19. luaL_error(L, "Do not hack!");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement