ebmar 893 Posted December 8, 2018 Greetings, fellow Jedi! May the Force be with you all. I have the DeNCS I grabbed from this post, but its format is on JAR. I have no experience with JAR files before and I'm kind of lost. Can someone explain one-or-two basic move to have the DeNCS running? Many thanks for considering this! Quote Share this post Link to post Share on other sites
DarthParametric 3,784 Posted December 8, 2018 It's a Java executable, so all you do is double click it to run it (assuming you have the Java Runtime Environment installed). After that you simply browse and load the NCS file you want to decompile. When you close the file, it will ask if you want to save it as an NSS. You need a copy of nwscript.nss in the same folder, but I would advise making two copies of the program in two separate folders. Set one up with K1's nwscript.nss and the other with TSL's nwscript.nss. 1 Quote Share this post Link to post Share on other sites
ebmar 893 Posted December 8, 2018 (edited) 1 hour ago, DarthParametric said: It's a Java executable, so all you do is double click it to run it (assuming you have the Java Runtime Environment installed). Thanks! I was downloading the 1.6.0 version as instructed in the readme but it seems what's your suggesting is the latest version; I'll go with that. Quote After that you simply browse and load the NCS file you want to decompile. When you close the file, it will ask if you want to save it as an NSS. You need a copy of nwscript.nss in the same folder, but I would advise making two copies of the program in two separate folders. Set one up with K1's nwscript.nss and the other with TSL's nwscript.nss. Thank you for the instructive details! Very much appreciated. Update: Greetings, @DarthParametric- I hope you don't mind me summoning you. I'm having this message on my end: "Decompiling...k_pend_trask_d.ncs: partial-could not recompile" which resulting the generated NSS couldn't be compiled back to NCS with KotOR Tool. Am I missing something substantial here? 🤔 Edited December 8, 2018 by ebmar Quote Share this post Link to post Share on other sites
Salk 374 Posted December 8, 2018 Hello, ebmar! I can answer your question. DeNCS does decompile most scripts "partially" but that is sufficient to display their content. All you need to do is to right click on the Original or the Recompiled window that appears and choose "View Decompiled Code". In my experience with the original files, I would estimate around 20-25% of compiled script which DeNCS fail completely at decompiling (for a few of them there is the source available in the game files though) while the majority does decompile partially. Cheers! 1 Quote Share this post Link to post Share on other sites
DarthParametric 3,784 Posted December 8, 2018 4 hours ago, ebmar said: "Decompiling...k_pend_trask_d.ncs: partial-could not recompile" which resulting the generated NSS couldn't be compiled back to NCS with KotOR Tool. Am I missing something substantial here? I would guess you tried decompiling it with TSL's nwscript.nss. Make sure you are using the version with K1's nwscript.nss, as I suggested by having two separate versions. If that still doesn't work, then you probably have JCarter's disease. He can't decompile certain scripts which other people can for some reason. 1 Quote Share this post Link to post Share on other sites
ebmar 893 Posted December 8, 2018 First, thank you both for the feedback! 5 hours ago, DarthParametric said: I would guess you tried decompiling it with TSL's nwscript.nss. Make sure you are using the version with K1's nwscript.nss... I am certain that was using K1's nwscript.nss in the same folder with DeNCS.jar; as I extracted the said NSS straight by the KTool. Quote If that still doesn't work, then you probably have JCarter's disease. He can't decompile certain scripts which other people can for some reason. Dang. More likely; as I had these two different report from two different scripts: Decompiling...k_pend_trask_7.ncs: success Decompiling...k_pend_trask_d.ncs: partial-byte code does not match 5 hours ago, Salk said: Hello, ebmar! Hello, Salk! Quote DeNCS does decompile most scripts "partially" but that is sufficient to display their content. All you need to do is to right click on the Original or the Recompiled window that appears and choose "View Decompiled Code". Many thanks for the information! I can see what's inside the decompiled script now. Quote In my experience with the original files, I would estimate around 20-25% of compiled script which DeNCS fail completely at decompiling (for a few of them there is the source available in the game files though) while the majority does decompile partially. Thanks for the insight! It seems to only see the what's inside the script/decompiled code was sufficient enough, as we can actually copy-paste the code to a text-editor, and then recompile it again using KotOR Tool, isn't it? Or DeNCS most likely failed to decrypt the code so there will be missing codes from the original? Quote Share this post Link to post Share on other sites
DarthParametric 3,784 Posted December 8, 2018 12 minutes ago, ebmar said: Decompiling...k_pend_trask_d.ncs: partial-byte code does not match Yeah that's fine. You can still save the NSS. 12 minutes ago, ebmar said: Or DeNCS most likely failed to encrypt the code so there will be missing codes from the original? DrMcCoy (lead Xoreos dev) explains here why certain scripts fail to decompile. 1 1 Quote Share this post Link to post Share on other sites
DrMcCoy 40 Posted December 9, 2018 And just as a note, the task to extend the xoreos NWScript disassembler into a decompiler is still open :P. More information on that can be found here: https://github.com/xoreos/xoreos-tools/issues/16 Likewise, the task for an assembler, and then compiler, is also still open, probably. The person who started working on it has been silent for a few months now: https://github.com/xoreos/xoreos-tools/issues/17 Quote Share this post Link to post Share on other sites