Advertisement
ZeroX_Carxstreet

Test speed

Jan 23rd, 2024 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.86 KB | None | 0 0
  1. ui = false
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8. -- lib function made by CmP
  9. local function getLibStartAddress()
  10.   local startAddress = 0
  11.   local ranges = gg.getRangesList("libunity.so")
  12.   for i, v in ipairs(ranges) do
  13.     if v.state == "Xa" then
  14.       startAddress = v.start
  15.       break
  16.     end
  17.   end
  18.   return startAddress
  19. end
  20.  
  21. gg.clearList()
  22.  
  23. local start = getLibStartAddress()
  24. local offset = 0x12  --paste your offset
  25. local targetValueAddress = start + offset
  26. local values = {
  27.   {address = targetValueAddress, flags = gg.TYPE_BYTE}
  28. }
  29.  
  30. instructionSet = gg.getValues(values) -- create new table with address, flags, value
  31.  
  32. -- offsets
  33. function instructions() -- function parameters (instructionSets)
  34. if (instructionSet[1].value == 0x28) then -- if true then 32 bit else 64 bit
  35. hexConvert = 0x100000000
  36. dataType = 4
  37. cdOffsetSmall = 0xC
  38. cdOffsetBig =  0xB58
  39. cbOffsetSmall = 0x1C
  40. anonSpeedOffsetSmall = 0xE4
  41. anonSpeedOffsetBig = 0xEC
  42. anonGroupSearchOffset = 0x30
  43. else
  44. hexConvert = 0x0
  45. dataType = 32
  46. cdOffsetSmall = 0x18
  47. cdOffsetBig = 0x16B0
  48. cbOffsetSmall = 0x38
  49. cbOffsetBig = 0x48
  50. anonSpeedOffsetSmall = 0xF4
  51. anonSpeedOffsetBig = 0xFC
  52. anonGroupSearchOffset = 0x44
  53. end
  54. end
  55.  
  56. gg.clearList()
  57. gg.clearResults()
  58. old = gg.getRanges()
  59.  
  60.  
  61. function unityVersion() -- unity version
  62. gg.searchNumber(":Expected version: ", gg.TYPE_BYTE, gg.setRanges(16384))
  63. if gg.getResultsCount() == 0 then
  64. gg.alert("!")
  65. gg.alert("")
  66. randomized()
  67.  
  68. else
  69. local count = gg.getResultsCount()
  70. local results = gg.getResults(count)
  71. values = {}
  72. for i = 18, count, 18 do
  73.   local resultAddress = results[i].address
  74.   for j = 1, 7 do
  75.     values[#values + 1] = {address = resultAddress + j, flags = gg.TYPE_BYTE}
  76.   end
  77.   values = gg.getValues(values)
  78.   end
  79.   local str = ''
  80.   for i, v in ipairs(values) do
  81.     str = str .. string.char(v.value & 0xFF)
  82.   end
  83.   gg.clearResults()
  84. if values[1].value <= 0x35 and values[2].value == 0x2E and values[3].value <= 0x35 then -- unity versions 5.5 or below
  85. gg.alert("  "..str..", ")
  86. anonGroupSearchOffset = 0x3C
  87. cbOffsetSmall = 0x24
  88. anonSpeedOffsetSmall = 0xBC
  89. end
  90. gg.clearResults()
  91. end
  92. end
  93.  
  94. function finalSpeedResult()
  95. values = gg.getResults(1)
  96. if gg.getResultsCount() == 2 then
  97. gg.removeResults(values[1])
  98. end
  99. values[1].address = values[1].address + anonSpeedOffsetSmall
  100. values[1].flags = gg.TYPE_FLOAT
  101. value = gg.getValues(values)
  102. if value[1].value ~= 1 then
  103. value[1].address = value[1].address + 8
  104. value = gg.getValues(value)
  105. end
  106. if value[1].value ~= 1 then
  107. cbOffsetSmall = cbOffsetBig
  108. startcb()
  109. end
  110. value[1].name = "تـسريع الـلــعبة"
  111. gg.addListItems(value)
  112.  
  113. gg.clearResults()
  114.  
  115. end
  116.  
  117. function startxa()
  118. gg.clearResults()
  119. gg.searchNumber("h 6A 6F 79 73 74 69 63 6B 20 31 36 20 62 75 74 74 6F 6E 20 31 39", gg.setRanges(16384))
  120. if gg.getResultsCount() == 0 then
  121. gg.alert("")
  122. start()
  123. else
  124. a = gg.getResults(1)
  125. gg.searchNumber(a[1].address, dataType, gg.setRanges(gg.REGION_C_DATA | gg.REGION_OTHER), gg.clearResults())
  126. a = gg.getResults(1)
  127. gg.searchNumber(a[1].address + cdOffsetSmall, dataType, gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_C_ALLOC | gg.REGION_OTHER), gg.clearResults())
  128. if gg.getResultsCount() ~= 1 then
  129. gg.searchNumber(a[1].address - cdOffsetBig, dataType, gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_C_ALLOC | gg.REGION_OTHER), gg.clearResults())
  130. end
  131. finalSpeedResult()
  132. end
  133. end
  134.  
  135. function startcb()
  136. gg.clearResults()
  137. gg.searchNumber("h 00 00 80 3F CD CC 4C 3E 00 00 00 41 00 00 C8 42 00 00 B4 43 0A D7 23 3C CD CC 4C 3E 00 00 40 3F 00 00 00", gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_C_ALLOC | gg.REGION_OTHER))
  138. if gg.getResultsCount() == 0 then
  139. gg.alert("")
  140. start()
  141. else
  142. a = gg.getResults(1)
  143. gg.clearResults()
  144. gg.searchNumber(a[1].address - anonGroupSearchOffset, dataType, gg.setRanges(gg.REGION_C_BSS | gg.REGION_OTHER), gg.clearResults())
  145. if gg.getResultsCount() == 0 then
  146. gg.searchNumber(a[1].address - 0x48, dataType, gg.setRanges(gg.REGION_C_BSS | gg.REGION_OTHER), gg.clearResults())
  147. end
  148. offsetStart = gg.getResults(1)
  149. offsetStart[1].address = offsetStart[1].address - cbOffsetSmall
  150. valu = gg.getValues(offsetStart)
  151. gg.clearResults()
  152. gg.searchAddress(string.format("%x", valu[1].value + hexConvert), -1, dataType, gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_C_ALLOC | gg.REGION_OTHER))
  153. finalSpeedResult()
  154. end
  155. end
  156.  
  157. function randomized()
  158. gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_C_ALLOC | gg.REGION_OTHER)
  159. gg.searchFuzzy('0', gg.TYPE_FLOAT, gg.SIGN_FUZZY_GREATER)
  160. for i = 1 , 50 do
  161. gg.searchFuzzy('0', gg.TYPE_FLOAT, gg.SIGN_FUZZY_GREATER)
  162. gg.refineNumber('0.01~6', gg.TYPE_FLOAT)
  163. gg.sleep(50)                                                  
  164. end          
  165. secondResults = gg.getResults(10000)
  166.  for i = 0, 50  do
  167.  for i = 1, #secondResults do
  168.  secondResults[i].address = secondResults[i].address + 0x4
  169.  secondResults[i].flags = gg.TYPE_FLOAT
  170.  end
  171.  gg.addListItems(secondResults)
  172.  end
  173. new = gg.getListItems(secondResults)
  174. gg.loadResults(new)
  175. gg.removeListItems(new)
  176. gg.sleep(1000)
  177. gg.refineNumber('1', gg.TYPE_FLOAT)
  178. speedValue = gg.getResults(1000)
  179. gg.addListItems(speedValue)
  180.  
  181. end
  182.  
  183. function start()
  184. instructions()
  185. unityVersion()
  186. gg.alert("🎮 تسريع اللعبة كاملة 🎮")
  187. startcb()
  188. end
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. function main()
  202.  
  203.    
  204.  
  205.       ui = true
  206.      
  207.      
  208.       --🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
  209.      
  210.       start()
  211.      
  212.      
  213.      
  214. end
  215.      
  216.      
  217.      
  218.  
  219.  
  220.  
  221. while true
  222.   do
  223.     while gg.isVisible(true)
  224.       do
  225.         gg.setVisible(ui)
  226.         if ui == false
  227.           then
  228.             gg.hideUiButton()
  229.             main()
  230.           elseif ui == true
  231.            then
  232.              gg.showUiButton()
  233.         if gg.isClickedUiButton() -- checks if the UI button is Pressed
  234.           then
  235.             os.exit() -- calls the UI() function
  236.           end
  237.         end
  238.       end
  239.   end
  240.  
  241.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement