-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Special Hex String Construct for Mobile Label Addresses #33
Comments
In fact, SB will always turn the string contained in hex into hexadecimal after decompilation. This makes the code unreadable |
On the PC version:
After decompilation:
The code becomes unreadable hexadecimal. Although you can open it with Notepad to see the character names. As OrionSR said. |
Even on Android CLEO:
For example, the pointer structure of the player obtained above, after decompilation:
They are very messy, this kind of bad code |
When only using a function, put the function name at the end. Decompilation does not affect the sorting of the previous CLEO code. Here I have a "real time CLEO" that I wrote before (the game time is synchronized with the phone system time). The decompilation is very bad... In fact, I really like the structure of Android CLEO, even though the SB tool is currently used for Android GTA scripts Compilation/decompilation is bad. In fact, if the string {function name} cannot be decompiled correctly. So is it possible to add a function of importing strings to SB (only for Android GTA). To make it decompile correctly. |
Thanks for all the examples. I don't think this can be solved in a general way, i.e. it would be impossible to cover all possible use cases with hex.end input. But particularly for |
I believe @Deji69 had this feature in his Scrambl compiler. We might discuss this in a separate ticket if you will. |
there is "Add extra info" option in Sanny Builder to get better decompilation results with hex.end specifically. Does it help? |
Finally, there is an Android CLEO issue.
The above code gets the memory address of the function asm_call in CLEO.SO in the Android cleo library, and reads its first byte for display. But the problem is not here. The ASM assembly code at the beginning must be placed at the beginning of CLEO. If placed at the end, the game will crash and report an error.
When accessing memory, the data is not aligned
If you do not add hex 00 end here to fill a byte to align the data, the game will crash. I noticed that this problem only occurs in Android, which is also the particularity of the architecture. It seems that the CLEO code will affect the alignment in memory?
|
Yes, the source code will be retained if you check to add additional information. This is indeed a good way. But not everyone does it |
let's continue in #36 |
I think disabling Extra Info was added to Mobile Coding 101 back when storage space on mobile devices was considerably more limited. I have seen very few examples of advanced mobile scripts that use this option. Even on PC, Extra Info is usually only included with scripts from beginners that haven't explored SB's options yet, or scripts designed with the explicit intent of sharing the original code. I suspect the basic player instinct is to disable Extra Info to hide your sloppy coding strategies, or to discourage people from stealing what you worked so hard to create. |
Yes. Usually not checked. Because it affects the lock. There are also some encrypted CLEOs in the writing of Android CLEO. But there is nothing advanced. They use the compilation mechanism of the SB tool to hide their code. I have studied this encryption method. However, Android CLEO is largely limited, and I don't like the so-called deliberate concealment of code. For example, I provided the method for reading and writing the Android configuration ini file before, but others have encrypted their CLEO when they know it. |
I guess another problem with the mobile hex strings is that it encourages players to think too much about locking strategies. I usually recommend tossing any script that is deliberately locked but for mobile scripts it's often hard to tell the difference. So for this particular case, I'm really hoping that a better strategy can be developed. |
@XMDS in v3.8.0-beta.1 disassembler should be able to write the content of a hex..end block as a string. Please try it and share your feedback with me. |
After a short period of testing, I have not found any problems for the time being. The string is currently decompiled correctly |
The issue is that CleoA uses a label search strategy to find structure addresses so scripts are compatible with multiple versions of the game. The hex constructs used to store the label string won't decompile without IGNORE_UNKNOWN, and is returned as a hex bytes. which works, but provides little useful information on how to adapt the code.
These constructs are always used in combination with a label used by opcode 0DD0:. I'm wondering if that's enough information for Sanny to format the hex construct as a null terminated string. Or maybe there's a better solution, because this "Magic Hex" construct is extremely common in CleoA scripts - anything that accesses memory and isn't complete garbage.
Example (used in script body):
Labels (traditionally appended to the end of the script):
The text was updated successfully, but these errors were encountered: