Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.18 KB | None | 0 0
  1. #include <pthread.h>
  2. #include "KittyMemory/MemoryPatch.h"
  3. #include "KittyMemory/Logger.h"
  4. #include <jni.h>
  5.  
  6. struct Patch {
  7. MemoryPatch isUnlimatedGold;
  8. MemoryPatch isUnlimatedSilver;
  9. MemoryPatch isUnlimatedBackPack;
  10. MemoryPatch isUnlimatdGasTank;
  11. MemoryPatch isUnlimatedTrunk;
  12. MemoryPatch isUnlimatedKarma;
  13. MemoryPatch isUnlimatedSkillPoint;
  14. MemoryPatch isUnlimatedPerkPoint;
  15. MemoryPatch isUnlimatedHighDamage;
  16. MemoryPatch isAdsRemove;
  17. MemoryPatch isUnlimatedAmmoClip;
  18. MemoryPatch isUnlimatedAmmo;
  19. MemoryPatch isUnlimatedGas;
  20. } patches;
  21. bool isUnlimatedGold;
  22. bool isUnlimatedSilver;
  23. bool isUnlimatedBackPack;
  24. bool isUnlimatdGasTank;
  25. bool isUnlimatedTrunk;
  26. bool isUnlimatedKarma;
  27. bool isUnlimatedSkillPoint;
  28. bool isUnlimatedPerkPoint;
  29. bool isUnlimatedHighDamage;
  30. bool isAdsRemove;
  31. bool isUnlimatedAmmoClip;
  32. bool isUnlimatedAmmo;
  33. bool isUnlimatedGas;
  34.  
  35.  
  36.  
  37.  
  38. void* hack_thread(void*) {
  39. //Configure your patches here
  40. // loop until our target library is found
  41. ProcMap il2cppMap;
  42. do {
  43. il2cppMap = KittyMemory::getLibraryMap("libil2cpp.so");
  44. sleep(1);
  45. } while(!il2cppMap.isValid());
  46.  
  47.  
  48.  
  49. patches.isUnlimatedGold = MemoryPatch("libil2cpp.so",0xD952E8,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  50.  
  51. patches.isUnlimatedSilver = MemoryPatch("libil2cpp.so",0xD95178,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  52.  
  53. patches.isUnlimatedBackPack = MemoryPatch("libil2cpp.so",0xD95B0C,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  54.  
  55. patches.isUnlimatdGasTank = MemoryPatch("libil2cpp.so",0xD95C74,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  56.  
  57. patches.isUnlimatedTrunk = MemoryPatch("libil2cpp.so",0xD95B64,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  58.  
  59. patches.isUnlimatedKarma = MemoryPatch("libil2cpp.so",0xD95D84,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  60.  
  61. patches.isUnlimatedGas = MemoryPatch("libil2cpp.so",0xD94100,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  62.  
  63. patches.isUnlimatedSkillPoint = MemoryPatch("libil2cpp.so",0xCD231C,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  64.  
  65. patches.isUnlimatedPerkPoint = MemoryPatch("libil2cpp.so",0xCD23DC,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  66.  
  67. //patches.isUnlimatedBackPack = MemoryPatch("libil2cpp.so",0xD95B0C,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  68.  
  69. patches.isUnlimatedHighDamage = MemoryPatch("libil2cpp.so",0xFE7DC8,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  70.  
  71. patches.isAdsRemove = MemoryPatch("libil2cpp.so",0xD95AB0,"\x00\x00\x80\xd2\xc0\x03\x5f\xd6",8);
  72.  
  73. patches.isUnlimatedAmmo = MemoryPatch("libil2cpp.so",0xFE9268,"\x20\x00\x80\xd2\xc0\x03\x5f\xd6",8);
  74.  
  75. patches.isUnlimatedAmmoClip = MemoryPatch("libil2cpp.so",0xFE91CC,"\x20\x00\x80\xd2\xc0\x03\x5f\xd6",8);
  76.  
  77.  
  78. return NULL;
  79. }
  80.  
  81.  
  82.  
  83. extern "C"
  84. JNIEXPORT jobjectArray JNICALL Java_com_rh_mods_ModMenu_getListFT(JNIEnv *env, jobject jobj){
  85. jobjectArray ret;
  86. int i;
  87. int Total_Feature =14;
  88. const char *features[]={"Unlimated Gold", "Unlimated Silver", "Unlimated BackPack", "Unlimated GasTank", "Unlimated Trunk", "Unlimated Karma", "Unlimated SkillPoint", "Unlimated BackPack", "Unlimated PerkPoint", "High Damage", "Remove Ads", "Unlimaated AmmoClip", "Unlimated Ammo", "Unlimated Gas"};
  89.  
  90. ret= (jobjectArray)env->NewObjectArray(Total_Feature,
  91. env->FindClass("java/lang/String"),
  92. env->NewStringUTF(""));
  93.  
  94. for(i=0;i<Total_Feature;i++) {
  95. env->SetObjectArrayElement(
  96. ret,i,env->NewStringUTF(features[i]));
  97. }
  98. return(ret);
  99. }
  100.  
  101.  
  102. extern "C"
  103. JNIEXPORT void JNICALL Java_com_rh_mods_ModMenu_changeToggle(JNIEnv *env, jobject thisObj, jint number) {
  104. int i = (int) number;
  105. switch (i) {
  106.  
  107. case 0:
  108. isUnlimatedGold=!isUnlimatedGold;
  109. if (isUnlimatedGold) {
  110. patches.isUnlimatedGold.Modify();
  111. } else {
  112. patches.isUnlimatedGold.Restore();
  113. } break;
  114.  
  115.  
  116. case 1:
  117. isUnlimatedSilver=!isUnlimatedSilver;
  118. if (isUnlimatedSilver) {
  119. patches.isUnlimatedSilver.Modify();
  120. } else {
  121. patches.isUnlimatedSilver.Restore();
  122. } break;
  123.  
  124.  
  125. case 2:
  126. isUnlimatedBackPack=!isUnlimatedBackPack;
  127. if (isUnlimatedBackPack) {
  128. patches.isUnlimatedBackPack.Modify();
  129. } else {
  130. patches.isUnlimatedBackPack.Restore();
  131. } break;
  132.  
  133.  
  134. case 3:
  135. isUnlimatdGasTank=!isUnlimatdGasTank;
  136. if (isUnlimatdGasTank) {
  137. patches.isUnlimatdGasTank.Modify();
  138. } else {
  139. patches.isUnlimatdGasTank.Restore();
  140. } break;
  141.  
  142.  
  143. case 4:
  144. isUnlimatedTrunk=!isUnlimatedTrunk;
  145. if (isUnlimatedTrunk) {
  146. patches.isUnlimatedTrunk.Modify();
  147. } else {
  148. patches.isUnlimatedTrunk.Restore();
  149. } break;
  150.  
  151.  
  152. case 5:
  153. isUnlimatedKarma=!isUnlimatedKarma;
  154. if (isUnlimatedKarma) {
  155. patches.isUnlimatedKarma.Modify();
  156. } else {
  157. patches.isUnlimatedKarma.Restore();
  158. } break;
  159.  
  160.  
  161. case 6:
  162. isUnlimatedSkillPoint=!isUnlimatedSkillPoint;
  163. if (isUnlimatedSkillPoint) {
  164. patches.isUnlimatedSkillPoint.Modify();
  165. } else {
  166. patches.isUnlimatedSkillPoint.Restore();
  167. } break;
  168.  
  169.  
  170. case 7:
  171. isUnlimatedPerkPoint=!isUnlimatedPerkPoint;
  172. if (isUnlimatedPerkPoint) {
  173. patches.isUnlimatedPerkPoint.Modify();
  174. } else {
  175. patches.isUnlimatedPerkPoint.Restore();
  176. } break;
  177.  
  178.  
  179. case 8:
  180. isUnlimatedBackPack=!isUnlimatedBackPack;
  181. if (isUnlimatedBackPack) {
  182. patches.isUnlimatedBackPack.Modify();
  183. } else {
  184. patches.isUnlimatedBackPack.Restore();
  185. } break;
  186.  
  187.  
  188. case 9:
  189. isUnlimatedHighDamage=!isUnlimatedHighDamage;
  190. if (isUnlimatedHighDamage) {
  191. patches.isUnlimatedHighDamage.Modify();
  192. } else {
  193. patches.isUnlimatedHighDamage.Restore();
  194. } break;
  195.  
  196.  
  197. case 10:
  198. isAdsRemove=!isAdsRemove;
  199. if (isAdsRemove) {
  200. patches.isAdsRemove.Modify();
  201. } else {
  202. patches.isAdsRemove.Restore();
  203. } break;
  204.  
  205.  
  206. case 11:
  207. isUnlimatedAmmoClip=!isUnlimatedAmmoClip;
  208. if (isUnlimatedAmmoClip) {
  209. patches.isUnlimatedAmmoClip.Modify();
  210. } else {
  211. patches.isUnlimatedAmmoClip.Restore();
  212. } break;
  213.  
  214.  
  215. case 12:
  216. isUnlimatedAmmo=!isUnlimatedAmmo;
  217. if (isUnlimatedAmmo) {
  218. patches.isUnlimatedAmmo.Modify();
  219. } else {
  220. patches.isUnlimatedAmmo.Restore();
  221. } break;
  222.  
  223.  
  224. case 13:
  225. isUnlimatedGas=!isUnlimatedGas;
  226. if (isUnlimatedGas) {
  227. patches.isUnlimatedGas.Modify();
  228. } else {
  229. patches.isUnlimatedGas.Restore();
  230. } break;
  231.  
  232.  
  233. }
  234. return;
  235. }
  236.  
  237.  
  238. __attribute__((constructor))
  239. void libloaded() {
  240. pthread_t ptid;
  241. pthread_create(&ptid, nullptr, hack_thread, nullptr);
  242. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement