Posted by: ts2do
Date posted: Jun 15 2005 User Rating: 1 out of 5.0 | Number of views: 12908 Number of comments: 19 | Description: Directions on how to encrypt your weapon scripts and and any other file |
 ICE is the type of encryption Valve uses for scripts like the weapon scripts...Weapon script files are encrypted into a file of the extension .ctxIf you do not know the encryption key of your mod, it's probably x9Ke0BY7 (the default for HL2DM)
Why do I want to encrypt my script files?
You should encrypt your script files so they can not easily be changed by users. To have the ability to change the weapon scripts, a mod user would have to delete the .ctx files and create the .txt files from scratch. This makes your mod more resistant to change, which means hosted servers won't as likely have changed the weapon scripts.
How do I deal with encryption for my mod?
- Encrpyting script files
Download this file and install it into your Source SDK bin folder (C:\Program Files\[Valve]\Steam\SteamApps\[Username]\sourcesdk\bin):
Execute this in the command prompt to make the .ctx files: "[Source SDK Bin]\vice.exe" -encrypt [Key: x9Ke0BY7 by default] -newext .ctx [.txt filenames (Use * for wildcard)]
- Changing the encryption key for your mod
To change the encryption key for your mod, you must change the returned string in the function "GetEncryptionKey" in the gamerules. The new encryption key must be eight characters long. This encryption key should be used when running vice.
- Decrypting script files
If you happen to lose your .txt files and you only have their .ctx files and your mod's encryption key, you can run vice to decrypt also: "[Source SDK Bin]\vice.exe" -decrypt [Key: x9Ke0BY7 by default] -newext .txt [.ctx filenames (Use * for wildcard)]
Here's some defines to make your life somewhat easier if you wanna look for ctx and txt or just any specific type...
| | #define findFiles( path, todo ) findExtFiles( path, todo, .txt );\ findExtFiles( path, todo, .ctx ) #define findExtFiles( path, todo, ext ) {\ FileFindHandle_t findHandle;\ const char *pFilename = filesystem->FindFirstEx( "##path##*##ext##", "MOD", &findHandle );\ while ( pFilename != NULL )\ {\ todo;\ }\ filesystem->FindClose( findHandle );\ }(void)0 |
then you just say
| | findFiles( scripts/weapons/,
char fileBase[512]; Q_FileBase( pFilename, fileBase, sizeof(fileBase) ); WEAPON_FILE_INFO_HANDLE tmp; if ( ReadWeaponDataFromFileForSlot( filesystem, fileBase, &tmp, pICEKey ) ) gWR.LoadWeaponSprites( tmp ); pFilename = filesystem->FindNext( findHandle ); ); |
but never do quotes around extensions or paths |
|
User Comments
Showing comments 1-19
did some digging in the Counter-Strike Source client.dll and found the encryption key.. d7NSuLq2
i was finaly able to decrypt them damn weapon script files :)
oh yeah and nice article !
edit: Someone emailed me saying this key for CSS doesn't work now. It should. i have the newest CSS Client.dll and just checked.. and its still, d7NSuLq2Edited by Counter Life on Oct 19 2005, 08:23:59
|
|
I see that it's near the start of CSGameRules in wordpad.... what doesnt make sense is why they have it defined as a gamerules function.....because if there are going to be multiple gamerules, they're gonna be using the same encryption key....of course if someone would want to disable a weapon in certain gamerules, they could do it this way with 100% control, (unless someone figured out the key and decrypted em all that is)Edited by ts2do on May 30 2005, 08:14:31
|
|
What's the encryption key for DoD source? |
|
I'm have trouble with this, vice shows "input file" then says "cant open file" what am I doing wrong???? |
|
Anyone know DoD: Source's encryption key?
Never mind, I found it. ;)Edited by KillerKind on Nov 19 2005, 03:02:19
|
|
anyone know dods encyption key? |
|
Wl0u5b3f
Pretty easy to find, actually. |
|
Alright, this is a really nub question, but how to you view the client.dll in wordpad? |
|
I am getting an error when I execute the vice program "Extra App ID set to 211, but no SteamAppId." What am I doing wrong??? Thanks for the input. |
|
Hey Absolute !! to answer your question... just right click on the client.dll file and chose open with and then select the program word pad. ( there may be one other step in between but can not recall at this time but I do remeber just select the bottom radio button) hope this helps.... |
|
Thanks ts2do !!! just one last thing. I have the file decrypted and modified for our Lan server. But there appears to be no way to re-encrypt with the new independent program. The help menue says nothing about encrypting. is the extention -e for encrypt?? The steam dependant one also does not work as would be expected. It appears that re-encryption is nessary for the game to work. Or does each computer need to have the decrypted CTX file ??? I will test that later today. Again Thanks for all your help. |
|
just leave -d out to encrypt... |
|
Sup yall I am having a problem where i have the steam independed but it always fails to find the blasted file. anyu suggestions
p.s. i am typing in as follows ice -d -x .txt -k d:\program files\steam\models\weapon_ak47.ctx "The system can not find the specified file"
i made the modle folder was a naming mishap also the ice binary is in the model folderEdited by Unknown on Feb 08 2006, 00:50:43
|
|
you didn't provide the key |
|
Yes i did. Something apprently is when i put it in the msg board is knocks is off
ice -d -x .txt -k "" d:\program files\steam\models\weapon_ak47.ctx "The system can not find the specified file"
I had to add the " " to make it work, it barks at me if i do not enter the key in "< key >" that format w/o the " " obviously.Edited by Unknown on Feb 08 2006, 12:01:42
|
|
the key is 8 characters long and the name of the file is vice...not ice Also call it from its folder...unless you placed it in your system folder |
|
OHHH K see that is where i was going wrong you useage of the word vice just unlock the whole friggen THING!!!! Ya know i am pretty dense, but when it comes to computer i am not. This time i just failed miserably ohhh soo miserably ohh well thanks for the help |
|
Hi i just downloaded this tool, vice. When click on this aplication i get a small dos prompt that says a few things and press any key to continue. now when i got to press any key to try and type this stuff in. The window just closes on me. I dunno what you guys are doin. Please help.Edited by {UPS}DoloMight[FRD] on Mar 14 2006, 10:35:54
|
|
You must register to post a comment. If you have already registered, you must login.
|
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (8 guests)
|
|