Thank you for your patience. @Lover1500
For byte array to string, my requirements are different from your understanding. I have a pointer to the string. I determine the length of the string through the nearby values (usually, in the game developed by unity, the specific bytes recording the length of the string and the content of the string are continuous). At this time, I want to read the bytes in the memory and convert them into a string according to the character encoding. There is no need to search for strings in this process. For example, when the player modifies the pet name, I only know the position of the pointer pointing to the name, jump to the pointer address, read the memory, and convert the byte array into a string to know the new name.
With regard to the address value of negative numbers, I hope to avoid this situation from GG itself.
I have some more to add to my theme. @Enyby
About converting byte arrays to Strings:
In fact, reading memory and then converting it into a string through Lua code is still a problem in efficiency. So I hope to add a method to read strings directly from memory on the basis of adding the new string() method.
function gg.getString(address:number, length:number,charset:string):string
About automatically turning negative numbers to positive numbers when reading memory addresses:
I think what I said before is not rigorous. If a pointer value is negative, it will only occur in a 32-bit process, and the first bit of this value is 1 (value ≥ 0x80000000), so my request should be: in a 32-bit application, the address value requested by the script will be automatically converted to 32 bits. In other words, automatically remove the 32 bits at the top.
About adding file system related APIs:
I think it is reasonable for scripts to request permissions under some paths. For example, the application package currently selected by GG is named "com.Worldbox", so it should be understandable that the script requests the highest permissions of the two file paths "/ data/data/com.Worldbox" and "/sdcard/ Android/data/com.Worldbox". We have reason to believe that script operation of these directories is a part of the script function. I can think of two designs to achieve my goal. The first: the script requests to obtain all permissions under a directory. The player will receive a pop-up warning, and the player will decide whether to allow the script to operate the directory. This is similar to the dynamic request permission in Android applications. The second: by default, the script is allowed to access the "/data/data/package.name" and "/sdcard/Android/data/package.name" directories associated with the currently selected process. Add two APIs, such as "gg. getDDFile()" and "gg.getADFile()" to return the related objects of the above two folders. These objects should encapsulate the APIs related to file operation. I think the most important thing is to create a folder and traverse all the files and directories under the folder.