Advertisement
Guest User

a

a guest
Jan 12th, 2022
1,102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.42 KB | None | 0 0
  1.  
  2. typedef unsigned int DWORD;
  3.  
  4. int ENTITY_LOAD_STUB(int r3, int a);
  5. int GET_ENTITY_TYPE_STUB(int a1, int a2);
  6. int EVENT_SPAM_FIX_STUB(int a1, int a2, int a3, int a4);
  7. int ResurrectPrintStub(int a1, int a2, int a3, int a4, int a5);
  8. int RemoveAllWeaponsStub(int a1, int a2, int a3, int a4, int a5);
  9. int RemoveWeaponStub(int a1, int a2, int a3, int a4, int a5);
  10. int RequestRagdollStub(int a1, int a2, int a3, int a4, int a5);
  11.  
  12.  
  13. int EntityType = -1;
  14. int Entity_PlayerID = 0;
  15. bool Block = 0;
  16.  
  17. int GET_ENTITY_TYPE(int Entity, int a2)
  18. {
  19. EntityType = Entity;
  20. return GET_ENTITY_TYPE_STUB(Entity, a2);
  21. }
  22.  
  23. int EVENT_SPAM_FIX(int a1, int PlayerID, int a3, int a4)
  24. {
  25. Entity_PlayerID = PlayerID;
  26. if (Block) {
  27. Block = 0;
  28. return 0;
  29. }
  30. return EVENT_SPAM_FIX_STUB(a1, PlayerID, a3, a4);
  31. }
  32.  
  33. int ResurrectPrint(int a1, int a2, int PlayerID, int a4, int a5)
  34. {
  35. char buffer[100];
  36. sprintf(buffer, "%s Tried To resurrect you", GET_PLAYER_NAME(PlayerID));
  37. printf("%s\n", buffer);
  38. print(buffer);
  39. return ResurrectPrintStub(a1, a2, PlayerID, a4, a5);
  40. }
  41.  
  42. int RemoveAllWeapons(int a1, int a2, int PlayerID, int a4, int a5)
  43. {
  44. char buffer[100];
  45. sprintf(buffer, "%s Tried To Remove All Your Weapons", GET_PLAYER_NAME(PlayerID));
  46. printf("%s\n", buffer);
  47. print(buffer);
  48. return RemoveAllWeaponsStub(a1, a2, PlayerID, a4, a5);
  49. }
  50.  
  51. int RemoveWeapon(int a1, int a2, int PlayerID, int a4, int a5)
  52. {
  53. char buffer[100];
  54. sprintf(buffer, "%s Tried To Remove Your Weapon", GET_PLAYER_NAME(PlayerID));
  55. printf("%s\n", buffer);
  56. print(buffer);
  57. return RemoveWeaponStub(a1, a2, PlayerID, a4, a5);
  58. }
  59.  
  60. int RequestRagdoll(int a1, int a2, int PlayerID, int a4, int a5)
  61. {
  62. char buffer[100];
  63. sprintf(buffer, "%s Tried to ragdoll you", GET_PLAYER_NAME(PlayerID));
  64. printf("%s\n", buffer);
  65. print(buffer);
  66. return RequestRagdollStub(a1, a2, PlayerID, a4, a5);
  67. }
  68.  
  69. int ENTITY_LOAD_HOOK(int key, int a)
  70. {
  71. char buffer[100];
  72. int isNetworkSession = *(int*)(0x10ABE30);
  73. if (isNetworkSession)
  74. {
  75. switch (EntityType)
  76. {
  77. case 0:
  78.  
  79. break;
  80.  
  81. case 1: case 2:
  82. if (key == MODEL_SUPERLOD || key == MODEL_PLAYER)
  83. {
  84. printf("%s Spawned Freeze Ped 0x%X\n", GET_PLAYER_NAME(Entity_PlayerID), key);
  85. sprintf(buffer, "%s Tried To Spawn A Freeze Ped %X", GET_PLAYER_NAME(Entity_PlayerID));
  86. print(buffer);
  87. EntityType = -1;
  88. Block = 1;
  89. return -1;
  90. }
  91. break;
  92.  
  93. case 3:
  94.  
  95. break;
  96.  
  97. case 4:
  98. {
  99. if (IS_THIS_MODEL_A_VEHICLE(key))
  100. {
  101. printf("%s Spawned Vehicle Object 0x%X\n", GET_PLAYER_NAME(Entity_PlayerID), key);
  102. sprintf(buffer, "%s Tried To Spawn A Vehicle Object", GET_PLAYER_NAME(Entity_PlayerID));
  103. print(buffer);
  104. EntityType = -1;
  105. Block = 1;
  106. return -1;
  107. }
  108. else if (key == OBJECT_WS_SUBLIGHT || key == OBJECT_NJ5_FIREPIP02 || key == OBJECT_CJ_WS_T_BASE_DAM || key == OBJECT_SUBLIGHT_MS || key == OBJECT_CJ_WALL_LIGHT_2)
  109. {
  110. printf("%s Spawned a lag object\n", GET_PLAYER_NAME(Entity_PlayerID));
  111. EntityType = -1;
  112. Block = 1;
  113. return -1;
  114. }
  115. printf("%s Spawned Object %X\n", GET_PLAYER_NAME(Entity_PlayerID), key);
  116. break;
  117. }
  118.  
  119. case 5:
  120. if (key == VEHICLE_ANGEL || key == VEHICLE_DAEMON || key == VEHICLE_DIABOLUS
  121. || key == VEHICLE_INNOVATION || key == VEHICLE_LYCAN || key == VEHICLE_NIGHTBLADE
  122. || key == VEHICLE_REVENANT || key == VEHICLE_WAYFARER || key == VEHICLE_WOLFSBANE)
  123. {
  124. printf("%s Spawned A Freeze Bike 0x%X\n", GET_PLAYER_NAME(Entity_PlayerID), key);
  125. sprintf(buffer, "%s Tried To Spawn A Freeze Bike", GET_PLAYER_NAME(Entity_PlayerID));
  126. print(buffer);
  127. EntityType = -1;
  128. Block = 1;
  129. return -1;
  130. }
  131. break;
  132.  
  133. case 6:
  134.  
  135. break;
  136.  
  137. case 7:
  138. if (key != VEHICLE_DINGHY && key != VEHICLE_JETMAX && key != VEHICLE_MARQUIS && key != VEHICLE_PREDATOR
  139. && key != VEHICLE_REEFER && key != VEHICLE_SQUALO && key != VEHICLE_TROPIC && key != VEHICLE_TUGA
  140. && key != VEHICLE_BLADE && key != VEHICLE_FLOATER && key != VEHICLE_SMUGGLER)
  141. {
  142. printf("%s Spawned A Freeze Boat 0x%X\n", GET_PLAYER_NAME(Entity_PlayerID), key);
  143.  
  144. sprintf(buffer, "%s Tried To Spawn A Freeze Boat %X", GET_PLAYER_NAME(Entity_PlayerID), key);
  145. print(buffer);
  146. EntityType = -1;
  147. Block = 1;
  148. return -1;
  149. }
  150. else if (key == VEHICLE_TUGA)
  151. {
  152. printf("%s Spawned A Tug\n", GET_PLAYER_NAME(Entity_PlayerID));
  153. EntityType = -1;
  154. Block = 1;
  155. return -1;
  156. }
  157. break;
  158.  
  159. case 8:
  160.  
  161. break;
  162.  
  163. case 9:
  164.  
  165. break;
  166.  
  167. case 10:
  168.  
  169. break;
  170.  
  171. default:
  172.  
  173. break;
  174. }
  175. }
  176. Block = 0;
  177. EntityType = -1;
  178. return ENTITY_LOAD_STUB(key, a);
  179. }
  180.  
  181. int GET_ENTITY_TYPE_STUB(int a1, int a2)
  182. {
  183. __asm("li 3, 0");
  184. }
  185.  
  186. int ENTITY_LOAD_STUB(int r3, int a)
  187. {
  188. __asm("li 3, 0");
  189. }
  190.  
  191. int EVENT_SPAM_FIX_STUB(int a1, int a2, int a3, int a4)
  192. {
  193. __asm("li 3, 0");
  194. }
  195.  
  196. int ResurrectPrintStub(int a1, int a2, int a3, int a4, int a5)
  197. {
  198. __asm("li 3, 0");
  199. }
  200.  
  201. int RemoveAllWeaponsStub(int a1, int a2, int a3, int a4, int a5)
  202. {
  203. __asm("li 3, 0");
  204. }
  205.  
  206. int RemoveWeaponStub(int a1, int a2, int a3, int a4, int a5)
  207. {
  208. __asm("li 3, 0");
  209. }
  210.  
  211. int RequestRagdollStub(int a1, int a2, int a3, int a4, int a5)
  212. {
  213. __asm("li 3, 0");
  214. }
  215.  
  216. extern "C" int _start()
  217. {
  218. *(int*)(0x404508) = 0x60000000; //patch Killzone
  219. *(int*)(0x4046B0) = 0x60000000; //patch Killzone
  220.  
  221. HookFunctionStart(0x828DE0, (DWORD)GET_ENTITY_TYPE_STUB, (DWORD)GET_ENTITY_TYPE);
  222. HookFunctionStart(0x24FF90, (DWORD)ENTITY_LOAD_STUB, (DWORD)ENTITY_LOAD_HOOK);
  223. HookFunctionStart(0x83C8A0, (DWORD)EVENT_SPAM_FIX_STUB, (DWORD)EVENT_SPAM_FIX);
  224. HookFunctionStart(0x7FCD38, (DWORD)ResurrectPrintStub, (DWORD)ResurrectPrint);
  225. HookFunctionStart(0x7FCA78, (DWORD)RemoveAllWeaponsStub, (DWORD)RemoveAllWeapons);
  226. HookFunctionStart(0x7FCB28, (DWORD)RemoveWeaponStub, (DWORD)RemoveWeapon);
  227. HookFunctionStart(0x7FC238, (DWORD)RequestRagdollStub, (DWORD)RequestRagdoll);
  228.  
  229. *(int*)(0x3A3CF0) = 0x4E800020; //Remove shadows
  230. *(int*)(0x3A3F40) = 0x4E800020; //Remove shadows
  231. *(int*)(0x3A49E0) = 0x4E800020; //Remove shadows
  232. *(int*)(0x3A4DA8) = 0x4E800020; //Remove shadows
  233.  
  234. *(int*)(0x8054B0) = 0x4E800020; //Block Resurrect
  235. *(int*)(0x807758) = 0x4E800020; //Block remove all weapons
  236. *(int*)(0x807830) = 0x4E800020; //Block remove weapons
  237. *(int*)(0x80AC30) = 0x4E800020; //Block give weapons
  238. *(int*)(0x8009D8) = 0x4E800020; //Block Ragdoll request
  239.  
  240. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement