View unanswered posts | View active topics It is currently Sat Jul 20, 2019 3:15 am



Reply to topic  [ 7 posts ] 
 The end of locked scripts 
Author Message
Lieutenant J.G.
User avatar

Joined: Tue Dec 17, 2002 3:00 am
Posts: 322
Location: Virginia
Unread post 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

_________________
Image ICE 2017 Tournament Winning Team Member
Image ICE 2019 Tournament Winning Team Member


Mon Jan 28, 2019 2:24 am
Profile ICQ
Chief Warrant Officer

Joined: Sun Apr 17, 2005 2:00 am
Posts: 191
Location: USA
Unread post 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.

_________________
The New Order
66.26.112.116:2002

MicroBlaster:
http://www.microblaster.net/ServerDetai ... erverid=66

One day, the entire Tradewars 2002 fanbase will tremble at the mere mention of "Lionmane." Too bad it's not my name!?!?! -Krovach


Mon Jan 28, 2019 5:48 am
Profile
Lieutenant Commander
User avatar

Joined: Wed May 01, 2013 11:28 pm
Posts: 973
Location: Rural Indiana
Unread post 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

_________________
Star Killer
USA(RETIRED)
Loyalty Above All Else Except Honor
HHT 2015 Champs: Cloud09
2015 Lottery Tournament Winning Team Member
2016 Big Game Draft Tournament Winning Team Member
HHT 2016 Champs: Cloud09

Star Killer's Ice9 TWGS
Viper's Pit V1 TWGS
Website: http://sk-twgs.com
ts3server://sk-twgs.com My TeamSpeak Server(I'm Almost never there)
ts3server://ts.microblaster.net Micro's TeamSpeak Server(Where you can normally find me)
Email: starkillerstwgs@yahoo.com
ICQ: 693542389
Ice 9 V2 TWGS: SK-TWGS.COM PORT 2002
Viper's Pit V1 TWGS: V1.SK-TWGS.COM PORT 2002
Now The Fastest TWGS in the West
https://www.facebook.com/StarKillersTradeWars/
To help offset the server(s) hosting bill donate via PayPal to: starkillerstwgs@yahoo.com


Mon Jan 28, 2019 8:09 am
Profile ICQ WWW
Lieutenant J.G.
User avatar

Joined: Tue Dec 17, 2002 3:00 am
Posts: 322
Location: Virginia
Unread post 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.

_________________
Image ICE 2017 Tournament Winning Team Member
Image ICE 2019 Tournament Winning Team Member


Mon Jan 28, 2019 11:01 am
Profile ICQ
Lieutenant J.G.
User avatar

Joined: Tue Dec 17, 2002 3:00 am
Posts: 322
Location: Virginia
Unread post 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.

_________________
Image ICE 2017 Tournament Winning Team Member
Image ICE 2019 Tournament Winning Team Member


Mon Jan 28, 2019 11:11 am
Profile ICQ
Ambassador
User avatar

Joined: Wed Apr 20, 2011 1:19 pm
Posts: 2198
Location: Oklahoma City, OK 73170 US
Unread post 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.

_________________
Regards,
Micro

Website: http://www.microblaster.net
TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002
TeamSpeak3: ts.microblaster.net:9987

Do not try and bend the spoon. That’s impossible.
Instead… only try to realize there is no spoon.


Mon Jan 28, 2019 2:31 pm
Profile ICQ YIM WWW
Commander

Joined: Thu Oct 17, 2002 2:00 am
Posts: 1133
Unread post Re: The end of locked scripts
Nice


Tue Feb 05, 2019 9:03 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.