gamebase.dll - ready to use (AES Rijndael)
by Thomas Bang · 05/09/2008 (12:49 pm) · 19 comments

Hi
This is my first blog here at garagegames.
What i have to say...
I wrote a DLL where you can use functions to save/load crypted/decrypted text to/from a file (usable with TGB, TGE and TGEA). This has several reasons.
1. I want to get some deeper knowledge about GG's engines.
2. I write my own game with TGB and i need some special functions.
3. It's a lot of fun to write DLLs. ;-)
Here we have a saved file.

The customer of your game can edit all values very easy. Bad.
And this is the crypted version of the file. Good.
The text is crypted/decrypted password-dependent.

The functions provided with this DLL are very easy to use.
Here is the complete documentation.
www.darkware.de/gamebase_documentation/index.htm
The future:
I will implement more functions like copy, delete and remove files/folders, create folders, search files in a folder, support for ini-files and the registry and so on.
If you have wishes... please let me know.
I hope you like the gamebase.dll
Greetings
Thomas Bang
Germany
Edit: New functions are available.
Now you can crypt/decrypt text if you have your own load/save-functions.
And you can search files in a specified folder with more than one search-mask.
Documentation modified !!!
About the author
#2
05/09/2008 (2:57 pm)
Nice, I likes.
#3
Thanks! please keep working on this.
05/09/2008 (4:16 pm)
cool, nice little addition, made even better with the good level of documentation you have created!Thanks! please keep working on this.
#4
Question: in your installation walkthrough, you said to make sure to add it in Release mode. Does the dll work in debug mode as well?
05/10/2008 (1:24 am)
Excellent! I was about to write my own encryption thingo, but you saved me the work - and it's implemented very cleanly, too.Question: in your installation walkthrough, you said to make sure to add it in Release mode. Does the dll work in debug mode as well?
#5
@Daniel
I didn't tried Debug Mode but i think it should work also.
05/10/2008 (1:57 am)
Thanks for your nice comments. @Daniel
I didn't tried Debug Mode but i think it should work also.
#6
Now you can crypt/decrypt text if you have your own load/save-functions.
And you can search files in a specified folder with more than one search-mask.
Documentation modified !!!
05/10/2008 (6:39 am)
New functions are available. Now you can crypt/decrypt text if you have your own load/save-functions.
And you can search files in a specified folder with more than one search-mask.
Documentation modified !!!
#7
05/10/2008 (11:35 am)
I've compiled in debug mode, but haven't tried using the functions yet.
#8
05/10/2008 (11:59 am)
Very nice. I'm sure atleast 75% of the people here will want to use this.
#9
05/10/2008 (12:11 pm)
You should put this up as an official resource as well to accompany this blog post.
#10
thanks...
05/12/2008 (10:31 am)
cool, but you can publish the source code and VS2005 project for make our own functions in the dll?thanks...
#11
05/12/2008 (10:42 am)
Javier... I know Delphi much better than C/C++. That's the reason why i wrote a DLL and not directly in the Engine Sourcecode.
#12
05/13/2008 (5:53 am)
Modding this into the file IO pipeline would be nice for encrypting all assets and not just text files.
#13
There is a resource called "CipherLib". It is possible to crypt/decrypt Image-Files. I use this piece of code with TGB. It works very good.
I tried it also with TGE. It works but there is a problem with DTS and DIF.
As far as i know textures for dts and dif are stored separately.
The best way would be a new TGE(A)-Update with password-dependent file-encryption. And a new ShowToolPro-Update where we can open these encrypted files.
05/13/2008 (6:50 am)
Brian... you are right. There is a resource called "CipherLib". It is possible to crypt/decrypt Image-Files. I use this piece of code with TGB. It works very good.
I tried it also with TGE. It works but there is a problem with DTS and DIF.
As far as i know textures for dts and dif are stored separately.
The best way would be a new TGE(A)-Update with password-dependent file-encryption. And a new ShowToolPro-Update where we can open these encrypted files.
#14
05/16/2008 (11:58 am)
kick ass DLL man!... really appreciate all the effort made into this, its a pretty handy tool, y'know!?
#15
Unfortunately for securing game assets it fails as the password has to be stored within the application that the player has full access to. It will be found and used to decrypt, modify and re-encrypt the protected files.
BTW what cipher mode are you using?
05/18/2008 (8:09 am)
I hate to say this, but this will not protect game assets. As a learning experience I would say this is perfect and you did well.Unfortunately for securing game assets it fails as the password has to be stored within the application that the player has full access to. It will be found and used to decrypt, modify and re-encrypt the protected files.
BTW what cipher mode are you using?
#16
what this DLL does, however, its givin cheaters a hard time... for awhile, that is.
05/20/2008 (11:49 am)
well, as far as i understand, this DLL its not meant to be used to protect assets... so, for me, its pretty usefull for what it is... and like someone in the forums said, theres no use in protectin the assets, since if someone really wants to get them and have the skills, they eentually will... what this DLL does, however, its givin cheaters a hard time... for awhile, that is.
#17
05/24/2008 (11:06 am)
Each level of deterrence will deter the corresponding level of game exploiter. The casual cheater will be inevitably deterred by this encryption; it would take a dedicated hacker with at least some experience to break this encryption.
#18
Its really amazing to hear about this. This could be very helpful. I need some help regarding copying file from local machine to a share folder on another machine on LAN.
e.g. By pressing button in Game, it will copy my record.txt file from current game directory to share folder on share folder on LAN machine.
Please help me as much as you can. I am stuck on this.
thanks
09/29/2008 (2:10 am)
Hi Thomas,Its really amazing to hear about this. This could be very helpful. I need some help regarding copying file from local machine to a share folder on another machine on LAN.
e.g. By pressing button in Game, it will copy my record.txt file from current game directory to share folder on share folder on LAN machine.
Please help me as much as you can. I am stuck on this.
thanks
#19
Example:
You have a game in this folder: C:\MySuperGame
Your shared folder on the other machine in drive z:
To copy a file named "torque.txt" (located in C:\MySuperGame\MyTxtFiles) you have to write this command:
dw_copyFileToFolder("currentdir\\MyTxtFiles","Z:","torque.txt","torque.txt");
Usage: dw_copyFileToFolder(srcFolder, dstFolder, Filename, NewFilename);
Please beware:
- write paths always with double backslash
- at the end of a path DONT write double backslash
09/29/2008 (3:24 am)
HiExample:
You have a game in this folder: C:\MySuperGame
Your shared folder on the other machine in drive z:
To copy a file named "torque.txt" (located in C:\MySuperGame\MyTxtFiles) you have to write this command:
dw_copyFileToFolder("currentdir\\MyTxtFiles","Z:","torque.txt","torque.txt");
Usage: dw_copyFileToFolder(srcFolder, dstFolder, Filename, NewFilename);
Please beware:
- write paths always with double backslash
- at the end of a path DONT write double backslash

Torque 3D Owner Neill Silva