toofaces2

Security_Check.h by toofaces2

Feb 22nd, 2015
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. #include <natives.h>
  2. #include <common.h>
  3. #include <strings.h>
  4. #include <types.h>
  5. #include <consts.h>
  6.  
  7. bool StringChecker(char *Line, char *SafeLine, int Length, uint Hash)
  8. {
  9. int SafeLength;
  10. uint StringHash;
  11. SafeLength = GET_LENGTH_OF_LITERAL_STRING(Line);
  12. StringHash = GET_HASH_KEY(Line);
  13. if(!COMPARE_STRING(Line, SafeLine)) return false;
  14. if(SafeLength != Length) return false;
  15. if(StringHash != Hash) return false;
  16. return true;
  17. }
  18.  
  19. /*bool StringChecker(char *Line, char *SafeLine, int Length, uint Hash)
  20. {
  21. int SafeLength;
  22. uint StringHash;
  23. SafeLength = GET_LENGTH_OF_LITERAL_STRING(Line);
  24. StringHash = GET_HASH_KEY(Line);
  25. if(!COMPARE_STRING(Line, SafeLine)) return false;
  26. if(SafeLength != Length) return false;
  27. if(StringHash != Hash) return false;
  28. return true;
  29. }
  30.  
  31. void string_check(void)
  32. {
  33. if(StringChecker("Toofaces2 Private", modmanager_header, 23, 863453295) && (StringChecker(Line, modmanager_subheader, 49, 827635247)) // Remember return true; on every line
  34. {
  35. print("String is fine");
  36. }
  37. else
  38. {
  39. float x,y,z;
  40. print("~r~Strings Edited. File Terminating.");
  41. // Below is just to add insult to injury, add or subtract as you please
  42. WAIT(1000);
  43. GET_CHAR_COORDINATES(GetPlayerPed(), &x, &y, &z);
  44. SET_CHAR_VISIBLE(GetPlayerPed(), 0);
  45. ADD_EXPLOSION(x, y, z, EXPLOSION_SHIP_DESTROY, 50.0f, true, true, 0.0f);
  46. SET_PLAYER_CONTROL(GetPlayerPed(), false);
  47. SET_CHAR_HEALTH(GetPlayerPed(), 0);
  48. FORCE_LOADING_SCREEN(true);
  49. print("~r~LOL!");
  50. TERMINATE_THIS_SCRIPT();
  51. }
  52. /*if(StringChecker(Line, modmanager_subheader, 49, 827635247)) return true;
  53. if(StringChecker(Line, modmanager_footer, 20, 829003475)) return true;
  54. if(StringChecker(Line, protection, 37, 922876274)) return true;
  55. if(StringChecker(Line, mod_menus, 28, 1003150641)) return true;
  56. if(StringChecker(Line, quick_weapons, 37, 1070466459)) return true;
  57. if(StringChecker(Line, quick_handling, 38, 928753672)) return true;
  58. if(StringChecker(Line, quick_fun, 33, 920863472)) return true;
  59. if(StringChecker(Line, mapmod_loader, 32, 829877563)) return true;
  60. if(StringChecker(Line, game_modes, 41, 9209987635)) return true;
  61. if(StringChecker(Line, dev Tools, 30, 922873452)) return true;
  62. if(StringChecker(Line, premium Menu, 45, 938762536)) return true;
  63.  
  64. // return false; // Remember return false; after all protected strings
  65. } */
Advertisement
Add Comment
Please, Sign In to add comment