Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.93 KB | None | 0 0
  1. #include <pthread.h>
  2. #include "KittyMemory/MemoryPatch.h"
  3. #include "KittyMemory/Logger.h"
  4. #include <jni.h>
  5.  
  6.  
  7. struct Patch {
  8. MemoryPatch isUnlimatedGold;
  9. MemoryPatch isUnlimatedSilver;
  10. MemoryPatch isUnlimatedGas;
  11. MemoryPatch isUnlimatedKarma;
  12. MemoryPatch isUnlimatedSP;
  13. MemoryPatch isUnlimatedPK;
  14. MemoryPatch isUnlimatedBK;
  15. MemoryPatch isUnlimatedGasTank;
  16. MemoryPatch isUnlimatedTrunk;
  17. MemoryPatch isHighDamage;
  18. MemoryPatch isRemoveAds;
  19. } patches;
  20. bool isUnlimatedGold;
  21. bool isUnlimatedSilver;
  22. bool isUnlimatedGas;
  23. bool isUnlimatedKarma;
  24. bool isUnlimatedSP;
  25. bool isUnlimatedPK;
  26. bool isUnlimatedBK;
  27. bool isUnlimatedGasTank;
  28. bool isUnlimatedTrunk;
  29. bool isHighDamage;
  30. bool isRemoveAds;
  31.  
  32.  
  33.  
  34.  
  35. void* hack_thread(void*) {
  36. //Configure your patches here
  37. // loop until our target library is found
  38. ProcMap il2cppMap;
  39. do {
  40. il2cppMap = KittyMemory::getLibraryMap("libil2cpp.so");
  41. sleep(1);
  42. } while(!il2cppMap.isValid());
  43.  
  44.  
  45. patches.isUnlimatedGold = MemoryPatch("libil2cpp.so",0xD9B0D4,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  46. patches.isUnlimatedSilver = MemoryPatch("libil2cpp.so",0xD9AF84,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  47. patches.isUnlimatedGas = MemoryPatch("libil2cpp.so",0xD9A694,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  48. patches.isUnlimatedKarma = MemoryPatch("libil2cpp.so",0xD9B890,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  49. patches.isUnlimatedSP = MemoryPatch("libil2cpp.so",0xC7DEA4,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  50. patches.isUnlimatedPK = MemoryPatch("libil2cpp.so",0xC7DF64,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  51. patches.isUnlimatedBK = MemoryPatch("libil2cpp.so",0xD9B734,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  52. patches.isUnlimatedGasTank = MemoryPatch("libil2cpp.so",0xD9B7E0,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  53. patches.isUnlimatedTrunk = MemoryPatch("libil2cpp.so",0xD9B76C,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  54. patches.isHighDamage = MemoryPatch("libil2cpp.so",0xE4AD6C,"\x00\xe0\xaf\xd2\xc0\x03\x5f\xd6",8);
  55. patches.isRemoveAds = MemoryPatch("libil2cpp.so",0xD9B6F8,"\x00\x00\x80\xd2\xc0\x03\x5f\xd6",8);
  56.  
  57.  
  58. return NULL;
  59. }
  60.  
  61.  
  62.  
  63. extern "C"
  64. JNIEXPORT jobjectArray JNICALL Java_com_rh_mods_ModMenu_getListFT(JNIEnv *env, jobject jobj){
  65. jobjectArray ret;
  66. int i;
  67. int Total_Feature =11;
  68. const char *features[]={"Unlimated Gold", "Unlimated Silver", "Unlimated Gas", "Unlimated Karma", "Unlimated SkillPoint", "Unlimated PerkPoint", "Unlimated BackPack", "Unlimated GasTank", "Unlimated Trunk", "High Damage", "Remove Ads" };
  69.  
  70. ret= (jobjectArray)env->NewObjectArray(Total_Feature,
  71. env->FindClass("java/lang/String"),
  72. env->NewStringUTF(""));
  73.  
  74. for(i=0;i<Total_Feature;i++) {
  75. env->SetObjectArrayElement(
  76. ret,i,env->NewStringUTF(features[i]));
  77. }
  78. return(ret);
  79. }
  80.  
  81.  
  82. extern "C"
  83. JNIEXPORT void JNICALL Java_com_rh_mods_ModMenu_changeToggle(JNIEnv *env, jobject thisObj, jint number) {
  84. int i = (int) number;
  85. switch (i) {
  86.  
  87. case 0:
  88. isUnlimatedGold=!isUnlimatedGold;
  89. if (isUnlimatedGold) {
  90. patches.isUnlimatedGold.Modify();
  91. } else {
  92. patches.isUnlimatedGold.Restore();
  93. } break;
  94.  
  95.  
  96. case 1:
  97. isUnlimatedSilver=!isUnlimatedSilver;
  98. if (isUnlimatedSilver) {
  99. patches.isUnlimatedSilver.Modify();
  100. } else {
  101. patches.isUnlimatedSilver.Restore();
  102. } break;
  103.  
  104.  
  105. case 2:
  106. isUnlimatedGas=!isUnlimatedGas;
  107. if (isUnlimatedGas) {
  108. patches.isUnlimatedGas.Modify();
  109. } else {
  110. patches.isUnlimatedGas.Restore();
  111. } break;
  112.  
  113.  
  114. case 3:
  115. isUnlimatedKarma=!isUnlimatedKarma;
  116. if (isUnlimatedKarma) {
  117. patches.isUnlimatedKarma.Modify();
  118. } else {
  119. patches.isUnlimatedKarma.Restore();
  120. } break;
  121.  
  122.  
  123. case 4:
  124. isUnlimatedSP=!isUnlimatedSP;
  125. if (isUnlimatedSP) {
  126. patches.isUnlimatedSP.Modify();
  127. } else {
  128. patches.isUnlimatedSP.Restore();
  129. } break;
  130.  
  131.  
  132. case 5:
  133. isUnlimatedPK=!isUnlimatedPK;
  134. if (isUnlimatedPK) {
  135. patches.isUnlimatedPK.Modify();
  136. } else {
  137. patches.isUnlimatedPK.Restore();
  138. } break;
  139.  
  140.  
  141. case 6:
  142. isUnlimatedBK=!isUnlimatedBK;
  143. if (isUnlimatedBK) {
  144. patches.isUnlimatedBK.Modify();
  145. } else {
  146. patches.isUnlimatedBK.Restore();
  147. } break;
  148.  
  149.  
  150. case 7:
  151. isUnlimatedGasTank=!isUnlimatedGasTank;
  152. if (isUnlimatedGasTank) {
  153. patches.isUnlimatedGasTank.Modify();
  154. } else {
  155. patches.isUnlimatedGasTank.Restore();
  156. } break;
  157.  
  158.  
  159. case 8:
  160. isUnlimatedTrunk=!isUnlimatedTrunk;
  161. if (isUnlimatedTrunk) {
  162. patches.isUnlimatedTrunk.Modify();
  163. } else {
  164. patches.isUnlimatedTrunk.Restore();
  165. } break;
  166.  
  167.  
  168. case 9:
  169. isHighDamage=!isHighDamage;
  170. if (isHighDamage) {
  171. patches.isHighDamage.Modify();
  172. } else {
  173. patches.isHighDamage.Restore();
  174. } break;
  175.  
  176.  
  177. case 10:
  178. isRemoveAds=!isRemoveAds;
  179. if (isRemoveAds) {
  180. patches.isRemoveAds.Modify();
  181. } else {
  182. patches.isRemoveAds.Restore();
  183. } break;
  184.  
  185.  
  186. }
  187. return;
  188. }
  189.  
  190.  
  191. __attribute__((constructor))
  192. void libloaded() {
  193. pthread_t ptid;
  194. pthread_create(&ptid, nullptr, hack_thread, nullptr);
  195. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement