I have three optimizations about GG.
1. Add an API for converting byte array to string, such as
gg.bytesToString({0,104,0,105}, "utf-16");
, returns the string "Hi", similar to Java:
return new String ({0,104,0,105}, "utf-16");
2. When the address is negative number, it can automatically become positive number. When you enter -10 in the memory editing panel, the address will jump to 0xfffffffffffffff0. I hope to jump to 0xfffffff0.
3. Add API for file operating system to allow scripts to create folders.
Why do I need "bytesToString"?
I wrote a script for the game "WorldBox". Through the script, I can modify the equipment, talents and other attributes of the characters in the game. I pop up a menu to let users choose the characters to modify, so I read the character name from the memory. I use pure Lua implementation code, but the efficiency is very low. It will take a few seconds to read more text. I know this is very simple in Java, so I hope to add this function in the next version of GG.
Why do I want to automatically convert the address value of a negative number to a positive number?
I often encounter this situation: the value of the address 0x10001000 is 0x90001000. I want to get the value on the address 0x90001000.
Code:
local value = gg.getValues({{address = 0x10001000, flags = gg.TYPE_DWORD}})[1].value;
Now: value = -1879044096, the hexadecimal form is 0xffffffff90001000.
But I need 0x90001000 instead of 0xffffffff90001000. If I directly make address = 0xffffffff90001000, I will not get the value. My solution is to value << 32 >> 32, but I hope GG can avoid this problem in its design. My reason is, when the memory address is a negative number, the memory editor will turn it into a huge positive number. This is an astronomical number. Maybe the computer won't have such a large memory in 100 years. In terms of design, this is not in line with people's intuition.
Why do I need APIs related to file system operations?
Due to GG's security policy, "gg.execute" is disabled, which makes it impossible for me to create folders. When I replace the game archive, I need to create a new folder. This function is very important. I still have many designs that cannot be realized because of the lack of this function. Since this function may conflict with the security policy, I think it is necessary for me to talk about my views on the security policy. It's easy for scripts to do bad things. The person executing the script needs to evaluate the security himself. For malicious applications, it has no root permission, and only some ordinary permissions, such as accessing files, can still cause great damage. A script can access and modify memory, but cannot create folders. This script cannot do what an Android application can do. Of course, security measures also make sense. So I hope to allow the script to apply for the permission of a folder like the prompt when accessing the network. After the script has the permission of a folder, it can create a folder under this file path, traverse subdirectories and so on.
Finally, because my mother tongue is not English, I will miss a lot of information on the website when I don't actively translate, and I may make mistakes, also pardon me.
@Enyby