Jump to content

MAARS

Contributor
  • Posts

    483
  • Joined

  • Last visited

  • Days Won

    16

Community Answers

  1. MAARS's post in Search within array value and location was marked as the answer   
    you can use this helper
    -- Search for a value in an array and return the index and value if found -- @param arr The array to search index -- @param callback The callback function to use for searching -- @return The index and value if found, nil otherwise local function array_find(arr, callback) for i, v in pairs(arr) do if callback(v, i) then return i, v end end end -- Iterate over an array and return a new array with the results of the callback -- @param arr The array to iterate over indexes -- @param callback The callback function to use for mapping -- @return The new array with the results of the callback local function array_map(arr, callback) local new_arr = {} for i, v in pairs(arr) do new_arr[i] = callback(v, i) end return new_arr end -- Iterate over an array and return true if the value passes the callback test and false otherwise -- @param arr The array to iterate over indexes -- @param callback The callback function to use for testing -- return true if the value passes the callback test and false otherwise local function array_every(array, callback) for i, v in pairs(array) do if not callback(v, i) then return false end end return true end -- Iterate over an array and return a new array with the values that pass the callback test -- @param array The array to iterate over indexes -- @param callback The callback function to use for testing -- return A new array with the values that pass the callback test local function array_filter(array, callback) local new_arr = {} for i, v in pairs(array) do if callback(v, i) then new_arr[i] = v end end return new_arr end They are implementation of native function that exist in JavaScript they are very useful
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
  2. MAARS's post in Write/Read If True File was marked as the answer   
    I think putting the line number is a bad idea cause it require you to do extra parsing when you will read the data in it
     
    local function appendFile(fileName, data) local file, err = io.open(fileName, "a+") file:write(tostring(data) .. "\n") file:close() end local function readLine(fileName, lineNumber) local data pcall(function() local f = io.lines(fileName) if lineNumber == 1 then data = f() return end while true do local line = f() if not line then break end lineNumber = lineNumber - 1 if lineNumber == 0 then data = line break end end end) return data end -- write to files ( file name, data to write ) appendFile("test.txt", true) appendFile("test.txt", true) appendFile("test.txt", false) appendFile("test.txt", true) -- read from files ( file name, line numberic ) print(readLine("test.txt", 1)) print(readLine("test.txt", 2)) print(readLine("test.txt", 3)) print(readLine("test.txt", 4))  
  3. MAARS's post in Can someone help me was marked as the answer   
    In lua we use square bracket to access table index which can be numeric or associative(string).
    for example: 
    local myTable = {"hello", "world"} print ( myTable[1] ) -- hello print ( myTable[2] ) -- world So to jump back in your code gg.getRangesList return a list table with memory regions. Each element is a table with fields: state, start, end, type, name, internalName.
    so to explain:
    This return a list table with all memory regions gg.getRangesList('libil2cpp.so') this access the first index in the table gg.getRangesList('libil2cpp.so')[1] this access the start index in the first element of the list table gg.getRangesList('libil2cpp.so')[1].start memory regions have those index available as listed above: state, start, end, type, name, internalName.

    so to conclude, my little advice is first you need to learn lua, it is mandatory to understand such thing cause it is the core the language and you need it to do scripting with gg. You need to check the class reference this is where everything about gg class is documented.
    and the last one is, use the print function to see table structure, lua implementation in gg permit you to print table content without looping, which is a game changer it save you a lot of time.
    print ( gg.getRangesList('libil2cpp.so') ) -- print ( gg.getRangesList('libil2cpp.so')[1] ) -- print ( gg.getRangesList('libil2cpp.so')[1].start ) one at a time so you do not get lost
  4. MAARS's post in Where is virtual exposed was marked as the answer   
    Can't find it either, looks like it have been deleted or hided from public.
    Try to find an equivalent on the list, there are still a lot of virtual available 
  5. MAARS's post in How to create floating table(button) was marked as the answer   
    Hi there is a template in the Class Reference
    gg.showUiButton() while true do if gg.isClickedUiButton() then -- do some action for click, menu for example local ret = gg.choice({ 'Item 1', 'Item 2', 'Item 3' }) or os.exit() gg.alert('You selected:', ret) end gg.sleep(100) end
  6. MAARS's post in GG freezes after to much loops was marked as the answer   
    for me  the main problem is optimization,
    the problem i have noticed
     you are using global variable everywhere Use local variable, they are more fast
    can you explain why you double loop here ? The first loop might be ok but the second one i think there is to much iteration going on here, an address divided by 4 still result a big number i think
    after test, this his approximately how much time you loop every time, the list still go down, so it is totally normal that you crash.

    code used for test
    local ranges = gg.getRangesList("anon:libc_malloc") for i, v in ipairs(ranges) do print('( v["end"] - v.start ) / 4 => ', (v["end"] - v.start) / 4) end  
    You just override a native libary Unless you voluntary does it, table is a native library, so when you use it as a variable name you just override everything from it
    You are using #identifiant +1 to set your table index this is a big performance problem, unless you are looping just 10 or 20 time that might be ok, but here you will loop more that 1000 time i guess event more,what the # operator does on a table ? actually it will also loop to count every item on your table so as you guess, when you have a 10k+ item on your table imagine how slow and memory that will take.
    in the beginning you say you must load  value within offset of 4 but since you are using DWORD, offset 4 mean just the next address, since DWORD value are 8bit encoded
     
     
     
  7. MAARS's post in install failled older sdk was marked as the answer   
    You can use apk editor to modify apk minimum sdk target
    https://apk-editor.en.uptodown.com/android/download
  8. MAARS's post in How to make your gg.choice ALPHABETICALLY in order? was marked as the answer   
    you can use table.sort your list, but for this you will need to create a separated list
     
    local list = { "z", "t", "a" } table.sort(list) gg.choice(list) but be aware that this modify the original table order
  9. MAARS's post in GameGuardian lua was marked as the answer   
    Lua is sigle threaded, there is no way you can run multiple thread at once, for that you will need to modify the implementation of Lua in C, and good luck for that.
  10. MAARS's post in Speed hack is causing a spike in ping was marked as the answer   
    This is totaly normal, the speedhack function is not for online game, if you want to do a speedhack you should look for values and edit them as your wish
    there are some tutorial on how to find speedhack on most of game, you should search and try any of them that work for you 😉
  11. MAARS's post in How to refine multiple values at the same time was marked as the answer   
    Just like when using gg.searchNumber the refine function also accept semicolon separated values to refine.
    gg.refineNumber("14;15;18", gg.TYPE_DWORD) See the Class reference
  12. MAARS's post in Speed hack is causing a spike in ping was marked as the answer   
    This is totaly normal, the speedhack function is not for online game, if you want to do a speedhack you should look for values and edit them as your wish
    there are some tutorial on how to find speedhack on most of game, you should search and try any of them that work for you 😉
  13. MAARS's post in Help With Lua Script for data collection and creation of .csv file from it. was marked as the answer   
    Ok, so i uderstand,  tell me if it is what u want.
    and also i have made a litle video to showhow the script work, link below
    here i am using two gameguardian just to make change to the target value and trigger the script
     
    to explain, the script just take watether value is in the saved list then watch them for change, if any value in the saved list change, all value are taken from the saved list then added to the csv file.
    the file is created in the same directory level as the script is running

     
     
    script.lua
×
×
  • 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.