Jump to content

CmP

Contributor
  • Posts

    663
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by CmP

  1. This indicates that value consists of one or more float values that correspond to units. You might be able to find float value corresponding to currently biggest unit used in particular instance of BigNumber, for that you can try range search (for example, if displayed value is 217.58C, then search "217.57~217.59" or maybe even "216.5~217.6", which should include the target value, but may also find many unrelated ones).
  2. You can insert code for logging amount of items in saved list before and after fragments of code to see where it works not as expected: local items = gg.getListItems() print("Amount of items in saved list is " .. #items)
  3. To remove items from saved list GG API has removeListItems function. Below is an example of how to use it to remove all items with value 0 from the list. local savedItems = gg.getListItems() local itemsForRemove = {} for i, v in ipairs(savedItems) do if v.value == 0 then itemsForRemove[#itemsForRemove + 1] = v end end gg.removeListItems(itemsForRemove)
  4. CmP

    JsonCodeDumper

    Right, but if it is not done, it will happen automatically once the script completes. It's not related to the error that you got, it was because file can't be created in specified path, so "io.open" returns nil and then it is indexed with "write" key, which is the error from your screenshot. For example, you can try the following code and check contents of the file after running it: local path = "/sdcard/test.txt" -- Change to any other path to file that can be written io.open(path, "w+"):write("123")
  5. CmP

    JsonCodeDumper

    And what's wrong with the syntax? Tried specifying path where it can create file before concluding that it's syntax issue?
  6. CmP

    Help me with loop in script

  7. CmP

    JsonCodeDumper

    Maybe just because "Notes" directory doesn't exist in "/sdcard" on devices where you tested?
  8. CmP

    Help me with loop in script

    The question is what you define as working. You asked for the code that modifies value(s) from saved list that are named "R" to "-2.0" 20 times in loop. The code above should do exactly that. Maybe that's not exactly what you need?
  9. CmP

    Help me with loop in script

    local savedValues = gg.getListItems() -- Enough to get items once if list won't change during execution of loop local targetValues = {} for i, v in ipairs(savedValues) do if v.name == "R" then targetValues[#targetValues + 1] = { address = v.address, flags = v.flags, value = "-2.0" } end end for i = 1, 20 do gg.setValues(targetValues) -- doesn't really make sense without delay end And, please, don't mention anyone in questions that are not directed to someone specifically.
  10. Try hiding GG interface (gg.setVisible(false)) before setting values.
  11. CmP

    Lua

    local function hack1() gg.toast("Hack 1") end local function hack2() gg.toast("Hack 2") end local function menu() gg.toast("Menu") end gg.setVisible(false) while not gg.isVisible() do gg.sleep(100) end hack1() gg.setVisible(false) while not gg.isVisible() do gg.sleep(100) end hack2() gg.setVisible(false) while true do if gg.isVisible() then menu() end gg.sleep(100) end
  12. View File Embed libraries finder This script consists of a module (Lua code organized in certain way) for finding addresses of native libraries that are loaded directly from apk (which is the case when android:extractNativeLibs manifest attribute is set to "false") and several examples of how to use the module. Finding name of libraries in the script is implemented by checking soname of memory regions that are loaded from apk (including splits), contents of which resemble library in ELF format. Libraries that don't have soname specified won't be found by the script. Though, typically, main libraries of interest in games have soname specified, so the script should be applicable in most cases when libraries are loaded directly from apk. If a library has soname specified, but the script doesn't find it, generate debug log (example 3 from the file) from attempt to find the library and include it in the comment with report of the issue. Submitter CmP Submitted 07/26/2024 Category Templates  
  13. Version 1.0

    311 downloads

    This script consists of a module (Lua code organized in certain way) for finding addresses of native libraries that are loaded directly from apk (which is the case when android:extractNativeLibs manifest attribute is set to "false") and several examples of how to use the module. The script works only for 64-bit processes. Finding name of libraries in the script is implemented by checking soname of memory regions that are loaded from apk (including splits), contents of which resemble library in ELF format. Libraries that don't have soname specified won't be found by the script. Though, typically, main libraries of interest in games have soname specified, so the script should be applicable in most cases when libraries are loaded directly from apk. If a library has soname specified, but the script doesn't find it, generate debug log (example 3 from the file) from attempt to find the library and include it in the comment with report of the issue.
  14. With group search only it can be done if offset between first and second searched value is known beforehand. For your example and assuming all values that need to be included/excluded are dwords, offset between first and second value is 28 (0x1C), so there are exactly 6 dword values between them and each of them needs to be not equal to 9, which can be specified as "8~~10". So the string for group search for this case is "10;8~~10;8~~10;8~~10;8~~10;8~~10;8~~10;40::29". Then you can refine with "10;40::29" to get target results (but if any of values in between is 10 or 40, they will be included as well).
  15. CmP

    Slowing Group search

    Then it's reasonable to just search either first or second value and filter only desired results that have other value at needed offset. Something like the following: local firstValue = 210.0 local secondValue = 30.0 local offset = 12 gg.clearResults() gg.searchNumber(firstValue, gg.TYPE_DOUBLE) local firstValues = gg.getResults(gg.getResultsCount()) local secondValues = {} for i, v in ipairs(firstValues) do secondValues[i] = {address = v.address + offset, flags = gg.TYPE_DOUBLE} end secondValues = gg.getValues(secondValues) local targetResults = {} local index = 1 for i = 1, #firstValues do if secondValues[i].value == secondValue then targetResults[index] = firstValues[i] targetResults[index + 1] = secondValues[i] index = index + 2 end end gg.loadResults(targetResults)
  16. CmP

    Slowing Group search

    What are the values? How many search results do you get when searching the values separately (i.e. new search for first value in desired ranges - X results, same for second value - Y results)? What is the offset between the values? Which option will work better for your case can be estimated only with knowledge of the details.
  17. CmP

    Help Tables concatenation

    If you mean how to do it without concatenating tables with results from separate searches for each value (and potentially significantly faster), it may be done by searching multiple values at once with range searches. The idea is to make initial search from lowest target value to highest, then N - 1 refine searches to exclude ranges of values that are between target values, so that only target values remain at the end. Below is an example implementation of this idea for your case (untested, may require minor changes if doesn't work as is). local function interpretAsInteger(double) return string.unpack("I8", string.pack("d", double)) end local function interpretAsDouble(integer) return string.unpack("d", string.pack("I8", integer)) end local function convertToString(double) return string.format("%.17g", double) end local function getNextDoubleStr(doubleValue) local intValue = interpretAsInteger(doubleValue) local nextDouble = interpretAsDouble(intValue + 1) return convertToString(nextDouble) end local function getPreviousDoubleStr(doubleValue) local intValue = interpretAsInteger(doubleValue) local previousDouble = interpretAsDouble(intValue - 1) return convertToString(previousDouble) end local function searchMultipleDoubleValues(values) if #values < 2 then return end table.sort(values) local initialSearchStr = convertToString(values[1]) .. "~" .. convertToString(values[#values]) gg.clearResults() gg.searchNumber(initialSearchStr, gg.TYPE_DOUBLE) for i = 1, #values - 1 do local excludedRangeLowerBound = getNextDoubleStr(values[i]) local excludedRangeUpperBound = getPreviousDoubleStr(values[i + 1]) local excludedRangeSearchStr = excludedRangeLowerBound .. "~" .. excludedRangeUpperBound gg.refineNumber(excludedRangeSearchStr, gg.TYPE_DOUBLE, false, gg.SIGN_NOT_EQUAL) end end local valuesToSearch = {} for value = 7, 700, 7 do valuesToSearch[#valuesToSearch + 1] = value end searchMultipleDoubleValues(valuesToSearch) local resultsCount = gg.getResultsCount() print("Found " .. resultsCount .. " results")
  18. CmP

    Help Tables concatenation

    It's not a good idea to do that for many results (like 100k-200k+), since you will most likely run out of memory, but you can test how it goes in your case. Here is a function to concatenate results from table of tables with results: function concatResults(resultsList) local mergedResults = {} local index = 0 for _, results in ipairs(resultsList) do for __, result in ipairs(results) do index = index + 1 mergedResults[index] = result end end return mergedResults end And example of it's usage: local resultsList = {} for i = 7, 700, 7 do gg.clearResults() gg.searchNumber(tostring(i), gg.TYPE_DOUBLE) resultsList[#resultsList + 1] = gg.getResults(gg.getResultsCount()) end local allResults = concatResults(resultsList)
  19. View File Tagged pointers helper This script addresses GG not supporting tagged pointers natively by providing two features (going to pointer and searching pointers) that work for both regular and tagged pointers. Additionally, pointer search supports searching pointers for multiple targets at once. Script is used by selecting item(s) for desired operation in any of GG interface tabs and pressing "Sx" button to invoke script menu and choose the operation. Credits: - @BadCase - for method of searching for tagged pointers to multiple targets at once. Submitter CmP Submitted 07/06/2024 Category Tools  
  20. Version 1.0

    211 downloads

    This script addresses GG not supporting tagged pointers natively by providing two features (going to pointer and searching pointers) that work for both regular and tagged pointers. Additionally, pointer search supports searching pointers for multiple targets at once. Script is used by selecting item(s) for desired operation in any of GG interface tabs and pressing "Sx" button to invoke script menu and choose the operation. Credits: - @BadCase - for method of searching for tagged pointers to multiple targets at once.
  21. CmP

    XOR Values Doesnt Match

    After XOR'ing encrypted value with key, swap middle bytes (i.e. 11 22 33 44 -> 11 33 22 44) of the result and you should get expected value.
  22. If what you mean is to add 0x14 to address of each found value and load the values to search results or saved list, then the following example based on your code shows how to do that: -- Define the address to search for (in hexadecimal format) local targetAddressHex = "7AF6EF6780" -- Replace with your specific hexadecimal address -- Set the search parameters and search gg.clearResults() gg.searchNumber(targetAddressHex .. "h", gg.TYPE_QWORD) -- Get the search results local results = gg.getResults(500) -- Create table for target values from results by adding offset local targetValues = {} for i, v in ipairs(results) do targetValues[i] = {address = v.address + 0x14, flags = gg.TYPE_FLOAT} end gg.loadResults(targetValues) -- to set search results to target values gg.addListItems(targetValues) -- to add target values to saved list
  23. CmP

    Help for auto-freezing

    Android has "Wait for debugger" developer option that suspends the application at startup until Java debugger is connected. You can use the option as described in official documentation to connect debugger before target code runs.
  24. There is good chance that in some cases it may work by allocating as many pages as needed one after another. Example implementation: local PAGE_SIZE = 0x1000 function allocateConsecutivePages(count, mode, address) count = count or 1 mode = mode or gg.PROT_READ | gg.PROT_EXEC address = address or 0 local firstPageAddress = gg.allocatePage(mode, address) if type(firstPageAddress) == "string" then return firstPageAddress end for i = 1, count - 1 do local desiredPageAddress = firstPageAddress + i * PAGE_SIZE local pageAddress = gg.allocatePage(mode, desiredPageAddress) if pageAddress ~= desiredPageAddress then -- failed to allocate page right after previous one, handle as needed end end return firstPageAddress end
  25. CmP

    Calculation error

    Make first operand floating-point by multiplying 1.0 by it, that way all calculations will be with floating-point values and you will get approximate result. mpy = 1.0 * tonumber(input[1]) * tonumber(input1[1])
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.