Jump to content

CmP

Contributor
  • Posts

    663
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by CmP

  1. CmP

    LUA scripting

    You need to learn Lua and GG API, because the result can not be achieved without knowledge. There are at least 2 mistakes in your script because of which "it's not freezing": 1. Wrong usage of getListItems function. Incorrect usage: Correct usage: local list = gg.getListItems() 2. Using setValues function and expecting it to do the job of addListItems function. Incorrect (and even absurd) way to add items to the saved list: Correct way: list[1].value = '10000' list[1].freeze = true gg.addListItems(list)
  2. Also that "UI" variable is redundant in your case. Don't use something just because others do it. Your main loop can be rewritten this way: while true do if gg.isVisible() then gg.setVisible(false) main() end gg.sleep(100) end
  3. You need to explain that "idea" using words and not just drop some block of code. Noone here can read your thoughts. Moreover, quality of question/problem explanation affects receiving (or not receiving) answers more than anything else.
  4. CmP

    Requests for GG

    Got it, thanks for the answer. I assume that this information will be helpful for other forum members as well, since the question is not so trivial.
  5. CmP

    Requests for GG

    Well, this function is indeed very useful, but the question is: does it return updated information about process memory regions (because this is what author of the topic has written about, I suppose). I tried to find an answer to this question and got the following results. Script that was used for testing: local function calcTotalSize(ranges) local total = 0 for _, v in ipairs(ranges) do if v.state == 'Jh' or v.state == 'Ch' or v.state == 'Ca' or v.state == 'Cd' or v.state == 'Cb' or v.state == 'A' then total = total + (v['end'] - v.start) --print('start: ' .. v.start, 'end: ' .. v['end']) end end return total end local t1 = gg.getRangesList() print('Start') print('Count:', #t1) print('Size:', calcTotalSize(t1)) gg.setVisible(false) while not gg.isVisible() do gg.sleep(100) end local t2 = gg.getRangesList() print('\nFinish') print('Count:', #t2) print('Size:', calcTotalSize(t2)) Testing strategy: 1. Select targeted process (to get updated info about it's memory regions). 2. Launch the script. 3. Perform something in targeted process to "trigger" memory allocation/deallocation. 4. Click on GG floating icon. 5. Analyze info from the script output. Script execution result: Conclusion: Apparently, if I am not missing something, "getRangesList" function does not update info about process memory regions.
  6. CmP

    Requests for GG

    He probably meant info that GG receives when it is attached to the process. For example, list of memory regions, total "size" of process in memory, etc.
  7. You forget to check the value that is returned by your "GetLibraryTextBase" function. If the library was not found, function will return nil, which will be assigned to the variable "Base". Then some number is added to the variable, what leads to the error "attempt to perform arithmetic __add on nil and number" in this case. Typical user most likely won't understand what happened, so maybe it is better to handle this case appropriately.
  8. CmP

    Freeze error

    Tap Counter (#1e1gmlc8) You should have tried searching the forum before asking for the link, it's not rocket science.
  9. Little tweak to the solution above, so that returned string will look like address in GG: function toHexString(n) return string.format('%08X', n):sub(-8) end print(toHexString(12398754))
  10. View File Error handling for GG API functions template Note: This file is intended to be used by script developers. If you don't develop scripts or don't know what it is, ignore this file. Description: The file consists of three functions: - "attachHandler" function modifies a function in a way that when it returns a string, specified error handling function is called with that string as argument. It returns modified version of the function. This function should only be used on functions that return a string with error description when an error occurs. There is a list of such functions from GG API in the file. - "defaultHandler" function is an example of error handling function. - "testError" function (commented by default) "simulates" a function that has returned a string with error description, used for testing. How to use: 1. Include contents of the file at the beginning of your code. 2. Optionally create custom error handling functions. Error handling function has to accept 1 argument - a string with error description. 3. Use "attachHandler" function to get modified version of the function and either redefine original function with it or store it in a new variable. 4. Repeat step 3 for all desired functions. Examples: -- Custom error handling function local function myHandler(errorText) gg.toast('Whoops, looks like something went wrong', true) gg.toast('Mysterious error: ' .. errorText) print('Description of the error that has occurred during script execution:\n' .. errorText) end -- Using default error handling function and redefining the original function gg.searchNumber = attachHandler(gg.searchNumber, defaultHandler) -- Using custom error handling function and storing modified function in a new variable local getResultsModified = attachHandler(gg.getResults, myHandler) -- If an error occurs, "defaultHandler" function will be called gg.searchNumber('123', gg.TYPE_DWORD) -- If an error occurs, no error handling function will be called local results1 = gg.getResults(100) -- If an error occurs, "myHandler" function will be called local results2 = getResultsModified(100) Submitter CmP Submitted 01/01/2019 Category Templates  
  11. Version 2.0

    715 downloads

    Note: This file is intended to be used by script developers. If you don't develop scripts or don't know what it is, ignore this file. Description: The file consists of three functions: - "attachHandler" function modifies a function in a way that when it returns a string, specified error handling function is called with that string as argument. It returns modified version of the function. This function should only be used on functions that return a string with error description when an error occurs. There is a list of such functions from GG API in the file. - "defaultHandler" function is an example of error handling function. - "testError" function (commented by default) "simulates" a function that has returned a string with error description, used for testing. How to use: 1. Include contents of the file at the beginning of your code. 2. Optionally create custom error handling functions. Error handling function has to accept 1 argument - a string with error description. 3. Use "attachHandler" function to get modified version of the function and either redefine original function with it or store it in a new variable. 4. Repeat step 3 for all desired functions. Examples: -- Custom error handling function local function myHandler(errorText) gg.toast('Whoops, looks like something went wrong', true) gg.toast('Mysterious error: ' .. errorText) print('Description of the error that has occurred during script execution:\n' .. errorText) end -- Using default error handling function and redefining the original function gg.searchNumber = attachHandler(gg.searchNumber, defaultHandler) -- Using custom error handling function and storing modified function in a new variable local getResultsModified = attachHandler(gg.getResults, myHandler) -- If an error occurs, "defaultHandler" function will be called gg.searchNumber('123', gg.TYPE_DWORD) -- If an error occurs, no error handling function will be called local results1 = gg.getResults(100) -- If an error occurs, "myHandler" function will be called local results2 = getResultsModified(100)
  12. This is not a bug, it is supposed to work like that. Refer to description of "searchNumber" function in GG help: https://gameguardian.net/help/classgg.html#a7efd4ac7766e72688cb4a84a3915721e So if you need new search, make sure to clear results list first.
  13. You sent region log, but logcat is also required. These are not same things. More info about logcat: https://developer.android.com/studio/command-line/logcat https://stuff.mit.edu/afs/sipb/project/android/docs/tools/help/logcat.html
  14. This question is quite common on the forum. Here are possible options:
  15. Same way as for exact values, but using ranges. For example, a string for group searching these values with default group size looks like: "7~7.1;13.9~14;21~21.1". More information about this can be found in GG help: https://gameguardian.net/help/help.html#help_group_search_ https://gameguardian.net/help/help.html#help_range_search
  16. I am little late, because the answer is already given, but have one thing to add. If you need to match '[' character in the string, insert escape character ('%') before it, example: "abc123%[59959". Additional info about patterns in Lua can be found here: https://www.lua.org/pil/20.2.html
  17. Which patterns did you use, if it's not private info? Pattern is second argument of the call to string.find function, in your case it's value of the variable "v".
  18. You need to use "Changed/Unchanged" if you want to find xor-encrypted value with fuzzy search. "Increased/Decreased" won't work out because of how xor-encryption works.
  19. Here is a part from the script that is used in GG for text search: if utf16 then encoding = 'UTF-16LE' end It means that "UTF-16LE" encoding is used if user selects corresponding option (via checkbox). So, if you need same result as in GG text search, then use this encoding. Also check my previous comment, I have added info that explains why you got different result when "UTF-16" encoding was set.
  20. Are you sure that string that you are searching for is encoded in UTF-16 in process memory? You may try other encodings from available ones (see "bytes" function description in GG API reference). Edit: Those 2 bytes at start of the array from your second screenshot is byte order mask. You need to use "UTF-16LE" encoding in your case. I am not sure that BOM won't be included if you choose it, give it a try.
  21. Here is an example that you have asked for. Function to search text was taken from this post. function searchText(text, encoding) local bytes = gg.bytes(text, encoding) local ret = '' for i, b in ipairs(bytes) do ret = ret..';'..b end ret = ret:sub(2)..'::'..#bytes return gg.searchNumber(ret, gg.TYPE_BYTE) end function getResultsCount() if gg.getResultsCount then return gg.getResultsCount() end return gg.getResultCount() end local input = gg.prompt({'Input string to search:'}, nil, {'text'}) local str = '' if input == nil then -- Something to do if the prompt window was cancelled (this block can be omitted) end if input ~= nil then str = input[1] end if #str > 0 then gg.clearResults() searchText(str, 'UTF-16') gg.getResults(getResultsCount()) gg.editAll('1', gg.TYPE_BYTE) end text_search.lua
  22. You can't write like this. os.exit is a function and goto operator only works with labels. Either you make a call to the function (remove goto operator) or you jump to some label (replace os.exit() with label name), choose one option.
  23. Unfortunately, as I have written, you CAN'T protect the strings that are being searched in your script. If the user is able to run the script, then he can also find out, what strings were searched by the script. There is built-in GG feature, that logs every call to GG API in a text file, so if your script executes, for example, gg.searchNumber('123', gg.TYPE_DWORD), then user will see it in log file.
  24. He is using "choice" function. Not that it makes big difference, just a notice. Code after "sdone" label probably contains a call to os.exit function, so the script will terminate in both cases (when the user chooses "Exit" and when dialog was cancelled). Agree with this one, but maybe he want the script to terminate, if the dialog was cancelled, who knows.
  25. This won't prevent the user from logging script actions. If your goal is to protect the script, then hiding GG UI won't help almost anyhow.
×
×
  • 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.