-
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
The label cannot be decompiled correctly 2 #103
Comments
@XMDS can you share this file? |
@x87 Simple sample code:
Decompile:
CLEO_CALL is the same, when there is hex, so is 0DD0 of Android |
@XMDS I found an interesting quirk testing this script. If I compile the script without Extra info and then disassemble it with IGNORE_UNKNOWN I get different result:
It properly restored 2 of 3 labels. If I compile the script with Extra info, then open it and decline a request to use the original source code I get the same result as you. I will need to look into why the behavior is different in these cases. |
@x87 As you said. In fact, in one of my cleos, when I decompile, some labels are displayed normally, but some labels are not displayed normally. I have just gone through a lot of testing, I don’t know why this is so, so I didn’t have too many clear examples to provide, especially 0AB1 cleo_call. I still don’t have a simple example to provide. It is only in my old VC CLEO appear. In addition, the same is true for Android 0DD0, it is sometimes normal, but some scripts are not displayed. |
So two things here. First, when the script is compiled with Extra info there is an information on hex..end locations so the disassembler is able to properly restore the labels. It was just that those hex location were not accounted as valid label offsets, so you see the numbers in 0AC6. This has been fixed, will be delivered in the next version. But for IGNORE_UNKNOWN (when the script does not have Extra info) it's not fixable at this point. Due to implementation details the disassembler skips some potential targettable offsets during scanning (it steps in 2 bytes when ignoring unknown data). So you see some labels present and some not. This can be improved eventually with #33 specifically and reducing stepping to 1 byte, but it requires major refactoring. I will create a separate issue for this. |
there is an issue with how disassembler treats absolute offsets in missions/cleo scripts. given a script:
after disassembling it becomes:
|
@x87 In some cases this problem still exists. In fact, I don't have an example, but I decompile the cleo that I wrote before and still have this problem. I noticed that when a cleo has a lot of hex (string,assembly) code, some OP tags are still not properly decompiled:
And there is no problem in the previous version
The text was updated successfully, but these errors were encountered: