| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| The end of locked scripts https://mail.black-squirrel.com/viewtopic.php?f=14&t=35449 |
Page 1 of 1 |
| Author: | Shadow [ Mon Jan 28, 2019 2:24 am ] |
| Post subject: | The end of locked scripts |
So, I am ready to announce that I have successfully built a .CTS decompiler (in C#, using the published Delphi code as a guide) that works on all versions of TWX from 2.03final to 2.05 (and the new 2.06 from Micro). There are some kinks that I am working out around properly de-compiling and reassembling language structures (IF, WHILE, and the like) but it is 75% accurate to the original code and the parts that aren't are easily readable and fixed. I will be releasing this to the community at some point soon, once the kinks are worked out and it's tested. Why? Because this is a game that is dying in many ways, with only a handful of serious players left, and it's far past time that anything that could be useful to the community is released openly. I know of people using locked scripts from a decade ago because someone gave it to them, and it's a good script, and they wish they could edit it but they can't. Also, because it was a fun and interesting project. Though I will not be upset if I never have to look at Delphi again. I am sure this will result in some condemnation but hey, as a friend of mine recently pointed out, enough people already think i'm a supervillain that I can't make that any worse. And now, for your enjoyment, some code from the start of EPHaggle that checks the date (which I used to block this part of the code - my decompiler also gives me all the commands, parameters, and labels and breaks them out in addition to the bytecode). This is direct output from the current version of the decompiler. Code: SETVAR $EOHHYP FALSE SETVAR $LPHRPH FALSE SYSTEMSCRIPT SETVAR $VERSION 2018 MERGETEXT EP's Perfect Haggle, v. $VERSION $$1 SETVAR $SIGLINE $$1 :INCLUDESTART GETWORD CURRENTLINE $YN 1 ISNOTEQUAL $$1 $YN Command BRANCH $$1 ::1 ECHO "Script must be started from the Command prompt, HALTING." HALT ::1 ::2 SEND "ct" SETTEXTLINETRIGGER AM :DATE AM SETTEXTLINETRIGGER PM :DATE PM PAUSE :DATE KILLTRIGGER AM KILLTRIGGER PM GETWORD CURRENTLINE $YEAR1 6 GETTIME $YEAR2 yyyy GETSECTORPARAMETER 81 INVALID $ISINVALID SEND "q" SETTEXTTRIGGER WAITON1 :WAITON1 Command [TL= PAUSE :WAITON1 ISEQUAL $$1 $ISINVALID 1 BRANCH $$1 ::3 ECHO ANSI_12 "Contact ElderProphet via email, " ANSI_14 ElderProphet@comcast.net HALT GOTO ::4 ::3 ISNOTEQUAL $$2 $YEAR1 2030 ISNOTEQUAL $$5 $YEAR1 2046 SETVAR $$1 $$2 AND $$1 $$5 BRANCH $$1 ::5 SETSECTORPARAMETER 81 INVALID 1 ECHO ANSI_12 "Contact ElderProphet via email," ANSI_14 ElderProphet@comcast.net HALT GOTO ::4 ::5 ISNOTEQUAL $$1 $YEAR2 2018 BRANCH $$1 ::6 SETSECTORPARAMETER 81 INVALID 1 HALT ::6 ::4 The parts that need to be fully restored for the code to compile should be pretty obvious. Oh, and the fun parts (well some of it; I want to clean it up before I post it all): Code: SETPRECISION 0 SETVAR FUEL 25.5 SETVAR ORGANICS 50.5 SETVAR EQUIPMENT 90.5 SETVAR FUEL 0.25 SETVAR ORGANICS 0.5 SETVAR EQUIPMENT 0.9 SETVAR FUEL 40 SETVAR FUEL 90 SETVAR ORGANICS 30 SETVAR ORGANICS 75 SETVAR EQUIPMENT 20 SETVAR EQUIPMENT 65 ISEQUAL $$1 $PLANETSHIP PLANET BRANCH $$1 ::77 SETVAR $PORPHT 0 SETVAR $ROLLHH 0 SETVAR $PLRYHH 0 SETARRAY $HHDYOR 0 SETVAR $EDDHPO 0 SETVAR $PELHOH 0 SETVAR $HLRHRT 0 GOTO ::78 ::77 SETVAR $PORPHT -0.003 SETVAR $ROLLHH -0.003 SETVAR $PLRYHH 0.003 ISEQUAL $$1 $WEEKDAY Mon BRANCH $$1 ::79 SETVAR $EDDHPO 0 SETVAR $PELHOH 5 GOTO ::80 ::79 ISEQUAL $$1 $WEEKDAY Tue BRANCH $$1 ::81 SETVAR $EDDHPO 7 SETVAR $PELHOH 7 GOTO ::80 ::81 ISEQUAL $$1 $WEEKDAY Wed BRANCH $$1 ::82 SETVAR $EDDHPO 10 SETVAR $PELHOH 15 GOTO ::80 ::82 ISEQUAL $$1 $WEEKDAY Thu BRANCH $$1 ::83 SETVAR $EDDHPO 9 SETVAR $PELHOH 9 GOTO ::80 ::83 ISEQUAL $$1 $WEEKDAY Fri BRANCH $$1 ::84 SETVAR $EDDHPO 11 SETVAR $PELHOH 12 GOTO ::80 ::84 ISEQUAL $$1 $WEEKDAY Sat BRANCH $$1 ::85 SETVAR $EDDHPO 11 SETVAR $PELHOH 18 GOTO ::80 ::85 ISEQUAL $$1 $WEEKDAY Sun BRANCH $$1 ::86 SETVAR $EDDHPO 10 SETVAR $PELHOH 12 GOTO ::80 |
|
| Author: | Lionmane [ Mon Jan 28, 2019 5:48 am ] |
| Post subject: | Re: The end of locked scripts |
Thanks! I agree with your sentiments regarding "locked" and "secret" in this game: we're all just too old to rely on that and history is more important than vanity. Edit: But I suppose it's ok to go ahead and say this. You should have called this thread "The End of Public Scripts." Because now everyone will know that their scripts can be cracked, and by the "supervillain," no less. There are (were) much more tactical uses for this knowledge. |
|
| Author: | Star Killer [ Mon Jan 28, 2019 8:09 am ] |
| Post subject: | Re: The end of locked scripts |
Yeah the only drawback I see with this is now no one is going to release anything new. other then that good job. sk |
|
| Author: | Shadow [ Mon Jan 28, 2019 11:01 am ] |
| Post subject: | Re: The end of locked scripts |
Lionmane wrote: Thanks! I agree with your sentiments regarding "locked" and "secret" in this game: we're all just too old to rely on that and history is more important than vanity. Edit: But I suppose it's ok to go ahead and say this. You should have called this thread "The End of Public Scripts." Because now everyone will know that their scripts can be cracked, and by the "supervillain," no less. There are (were) much more tactical uses for this knowledge. If by "tactical", you mean keeping it to myself and only using it to decrypt things for my friends, then yeah, I could have done that. But that's not why I did this. There are scripts that many of us use on a regular basis for which the owners have left the community entirely (some by choice, others not). I see a legitimate need for this, for the benefit of the community. And I don't want to be accused of cheating or "bug use" because I have a tool that nobody else does, so I am being very open about it. I will make it available to everyone. |
|
| Author: | Shadow [ Mon Jan 28, 2019 11:11 am ] |
| Post subject: | Re: The end of locked scripts |
Star Killer wrote: Yeah the only drawback I see with this is now no one is going to release anything new. other then that good job. sk There may be a few rare exceptions where people would choose not to release something to the general public without trusting in the encryption, because they feel that not releasing it gives them a tactical advantage. But in the vast majority of cases, the scripts that were shared encrypted were not shared with the public but rather were shared among teammates or "corpies" that didn't trust each other. In these cases, the author wanted to limit the use of something by locking it to one user or applying a time limit on its use. I have a fundamental problem with that concept. I understand that some people don't script or code at all and those that do have an advantage in the tradewars world, one they would like to maintain. But if you're the consumer of such a script, do you really want to use it without having any idea what's in it? How hard do you think it would be to put a backdoor in the script that the author could use against you later? You'll never know it's there in an encrypted script. Anything in a script that's not nefarious can be easily re-created by another coder simply by watching the script's behavior and creating their own version. I've done it myself many times. The value of a script is not the code but the tactics it uses - and once you share the script as a ts or a cts, you've shared the tactics. So at that point, there's really no reason to hide the script itself. |
|
| Author: | Micro [ Mon Jan 28, 2019 2:31 pm ] |
| Post subject: | Re: The end of locked scripts |
Star Killer wrote: Yeah the only drawback I see with this is now no one is going to release anything new. other then that good job. sk This is not new. No one shares the aggressive "attack" scripts or anything they think might give them an edge. The only way you might ever get some of these scripts is if you were part of a permacorp or had a really good friend you played with. These scripts are so private, the users didn't even want you to see them running the script. If you watched them run it, then you could duplicate the functionality. When I first returned, no one would even teach me how to use simple stuff, like Lonestar's Dockshopper. I would see them run it in mombot, but they wouldn't even tell me what it was. Lack of documentation is not always because they didn't have time. It is a defense mechanism in the event someone got a copy of one of their scripts. So you somehow managed to get a copy, but you will never figure out how to use it. |
|
| Author: | Comet [ Tue Feb 05, 2019 9:03 pm ] |
| Post subject: | Re: The end of locked scripts |
Nice |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|