-
Content Count
70 -
Joined
-
Last visited
-
Days Won
1
Single Status Update
See all updates by Masamune753
-
Making sense of decompiled scripts is just awful...if you are doing it wrong. Thanks DarthParametric.
- Show previous comments 6 more
-
You can't really have a partially decompiled script. DeNCS either works or it doesn't. I assume what you are talking about is just readability and substitution. It won't use constants from nwscript.nss or Include scripts for example, it will just use their numerical value. And things like object declarations are a little uninspired, because whatever was used in the original source is discarded on compilation and DeNCS has to provide a stand-in.
-
Interesting. When I used DeNCS, I got the following message in the status window:
"Decompiling...k_ptar_larrimsto.ncs: partial-could not recompile:"I couldn't see anything in the other windows in the program, so I hit "Save", and it did save a .nss version of the script. I did the same for another script that I wrote and I got the same "partial-could not recompile:" status. I saved the script and I saw the DeNCS version of the original script I wrote. This version had all the things you describe as being different.
-
Yeah that is a bytecode mismatch. What DeNCS does (or tries to do) is to decompile the source script to bytecode, reverse engineer a script from that, then recompiles that script and sees if its bytecode matches the original. For simple scripts this is easy, since there's no real room for interpretation, but for more complex scripts with loops and so forth, it's a bit more fuzzy. Basically the way you interpret that is that the script DeNCS produces is functionally the same as the original, even if it technically may not be written the same way (not that you'd ever know since we don't have the original source).
If you are interested, have a read through AmanoJyaku's thread on creating a replacement for DeNCS, which covers how some of this stuff works under the hood.