Redshirt2 decryption!

Anything and everything

Moderators: bert_the_turtle, jelco, Chris

User avatar
Jackmn
level5
level5
Posts: 1378
Joined: Thu Feb 07, 2002 5:21 pm

Postby Jackmn » Sun Aug 14, 2005 8:33 pm

MSVC 6.0 is horribly broken as far as C++ goes.

Try compiling under MinGW or with Microsoft's C++ compiler included with the VC++ Toolkit 2003 (CLI only available free here)
Stewsburntmonkey
level5
level5
Posts: 11553
Joined: Wed Jul 10, 2002 7:44 pm
Location: Nashville, TN
Contact:

Postby Stewsburntmonkey » Sun Aug 14, 2005 8:51 pm

MSVC++ 6 is as good as the user will let it be in my experience. For instance I have no problem compiling this code in it. :)
User avatar
Jackmn
level5
level5
Posts: 1378
Joined: Thu Feb 07, 2002 5:21 pm

Postby Jackmn » Sun Aug 14, 2005 8:56 pm

There a couple significant issues with it, namely the default scope for variables declared in the initialisation section of 'for' loops.
Stewsburntmonkey
level5
level5
Posts: 11553
Joined: Wed Jul 10, 2002 7:44 pm
Location: Nashville, TN
Contact:

Postby Stewsburntmonkey » Sun Aug 14, 2005 9:12 pm

There is a flag that corrects that. If you setup your project correctly it is not an issue. MSVC++ 6 came out before the C++ standard was set so there are few things that need to be corrected before you use it, however that is easily done. Like I said if you know what you are doing, MSVC++ is one of the best IDE/compilers out there. :)
User avatar
Jackmn
level5
level5
Posts: 1378
Joined: Thu Feb 07, 2002 5:21 pm

Postby Jackmn » Mon Aug 15, 2005 1:14 am

That's why I said the default scope. I had the flag pointed out to me in a similar conversation earlier.

It's quite usable, but it's far from ISO compatible (no compiler out there is, but g++ hits the mark a little closer), which makes it miserable for compiling large OSS applications. I used to use it myself prior to the release of the .net IDE.
Stewsburntmonkey
level5
level5
Posts: 11553
Joined: Wed Jul 10, 2002 7:44 pm
Location: Nashville, TN
Contact:

Postby Stewsburntmonkey » Mon Aug 15, 2005 1:44 am

Given most OSS projects are *nix based, there would be little reason to use MSVC++ for them anyway. Although given the numbers of professionals who use MSVC++ it is great for professional development. :)
Olethros
level0
Posts: 2
Joined: Fri Jul 29, 2005 8:27 pm
Location: im right behind you...
Contact:

MSVC 6.0 Redshirt2

Postby Olethros » Tue Aug 23, 2005 10:06 pm

This is the MSVC 6.0 compatible Redshirt2 source code.
Special thanks to Miah, it was his idea and he did help a lot

EDIT:
Source code removed, you can always find the exe in it's home, www.darwinite.com have FuN!
Last edited by Olethros on Thu Sep 01, 2005 7:46 pm, edited 3 times in total.
User avatar
Miah
level5
level5
Posts: 3155
Joined: Mon Oct 13, 2003 7:28 pm
Contact:

Postby Miah » Wed Aug 24, 2005 2:26 am

So like, yeah, I'm tutoring on C++ in general, so I thought I would use this as a starting ground.

Nice of me, eh? :P

Anyway, it's availible for download as an exe at http://darwinite.com/download.php?id=1 for those of you who still don't have it, and are too lazy, or don't know how to, compile it.

It works exactly like redshirt the original did. It you don't know that, then Start->Run
cmd [Enter]
cd <directory redshirt2.exe is in>
redshirt2

It will tell you syntax. That's it for me. Olethros here coded it all, I just provided support here and there.

And am hosting a file, I guess :P
Petsam
level0
Posts: 2
Joined: Sun Oct 02, 2005 12:08 pm

Postby Petsam » Sun Oct 02, 2005 3:37 pm

Hello there!

I have used afx's code (added monochrome's fixes) and created a Visual Studio .NET 2003 project. It also includes compiled binaries, so there's no need to have MSVS.NET.

It's convenient for people who use Visual Studio and want to change the code right away or who simply want to encode/decode the saved game files* without bothering about compiling.

Here's the link: http://www.freewebs.com/petsam/darwinia/redshirt2_vs-project.rar

Cheers :!:

*=In case you don't know: afx's program has two command line options for either encoding or decoding and the output is send to stdout.

So use it like this:
redshirt2 -d game.txt > game_clear.txt (for decoding)
redshirt2 -e game_clear.txt > game_rs2.txt (for encoding)
User avatar
ShepFan
level2
level2
Posts: 86
Joined: Sun Apr 30, 2006 12:51 am
Contact:

Re: Ruby version

Postby ShepFan » Wed May 10, 2006 8:15 am

Eridius wrote:Ok, I just whipped up a Ruby version of the conversion. It supports both encryption and decryption, from both a filename or stdin, and seems to work properly.

Code: Select all

<snip>

else
   print <<END
Usage: #{File.basename $0} (-e|-d) [filename]

   -e      Encrypts the given file
   -d      Decrypts the given file

This script encrypts or decrypts a file with the redshirt2 algorithm.
The resulting text is printed on stdout.
If you pass no filename or a -, it reads from stdin instead of the file.
END
end


Just copy that code into a file, mark it executable, and run it. Or don't mark it executable and run it via the ruby interpreter (ex: `ruby redshirt2.rb -d game.txt`). Run it with no arguments for a short help text.


Awesome job! One little quirk with ruby 1.8.2 (12-25-2004) on my Mac running OS X 10.4.6--it says "print <<END" is a syntax error, and it has no idea what to do with the string literals that follow. Being a Ruby newbie, I tried to find an elegant solution via Google. This ain't pretty, but it works:

Code: Select all

else
   print "Usage:  #{File.basename $0} (-e|-d) [filename] \n"
   print " \n"
   print "   -e      Encrypts the given file  \n"
   print "   -d      Decrypts the given file  \n"
   print " \n"
   print "This script encrypts or decrypts a file with the redshirt2 algorithm.  \n"
   print "The resulting text is printed on stdout.  \n"
   print "If you pass no filename or a -, it reads from stdin instead of the file.  \n"
end
User avatar
ShepFan
level2
level2
Posts: 86
Joined: Sun Apr 30, 2006 12:51 am
Contact:

Ruby version & strange characters--all better now

Postby ShepFan » Wed May 10, 2006 8:41 am

I kept reading after my last post, to make sense of it all. It turns out the original syntax is fine, but when I copied and pasted, I picked up a bunch of strange, invisible characters in the help text I called out before. When I isolated the strange characters, the error message was:

Code: Select all

Invalid char `\312' in expression


There were two in the original "print" line (causing the syntax error), and six in each of the "-e" and "-d" lines. I used TextWrangler as my text editor. Other editors might never have this problem. If I'd "Zapped Gremlins" this would have been much easier!

-S
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: Ruby version & strange characters--all better now

Postby xander » Wed May 10, 2006 2:53 pm

ShepFan wrote:There were two in the original "print" line (causing the syntax error), and six in each of the "-e" and "-d" lines. I used TextWrangler as my text editor. Other editors might never have this problem. If I'd "Zapped Gremlins" this would have been much easier!

-S

BBEdit FTW!

xander
cadbury
level0
Posts: 1
Joined: Fri Jul 14, 2006 11:28 am

Postby cadbury » Fri Jul 14, 2006 11:42 am

hi folks

based on dx9s php script, i made an online one for my own use, so why not sharing it :

http://clementcadbury.free.fr/redshirt2/

first you have to upload a redshirt2 crypted file, that is displayed in a textarea
you modify it, and then download it reencrypted (or in clear)

hope it can be usefull to someone
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Fri Jul 14, 2006 2:59 pm

cadbury wrote:hi folks

based on dx9s php script, i made an online one for my own use, so why not sharing it :

http://clementcadbury.free.fr/redshirt2/

first you have to upload a redshirt2 crypted file, that is displayed in a textarea
you modify it, and then download it reencrypted (or in clear)

hope it can be usefull to someone

Nice work, cadbury. Thanks.

And welcome to the boards.

xander

Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest