Using Vice without Steam
paintings for sale nature boys tournament players club at the canyons decorative switchplates dometic glutathione kraltv war pictures star trek the next generation main web admission application form joshua tree lodging split croatia reduction of amides liquid coffee concentrate main lsa glassware uk sand dollar acura forum ryan renolds compass cove canadian immigration services julius caesar history belmont tech trash compactors pba commercial fountain designers securities professionals helmet laws silver bullet mayor race new york city security of state michigan we come one msc kbots association lawyer texas trial power rangers in space episodes systemic insecticide imidacloprid japanese girl games homepage biggest breasts world record lonely housewives stories public school township washington home dna paternity testing services toyota fj cruiser photo shannen doherty gallery vapor barrier insulation yardbirds home and garden interior design fabrics unique baby boys names lactaid pills dataw island real estate ticket printing machines www nudnicks sony television repair part accel cap distributor meads restaurant optics the sick rose interpretation martin d 18 guitar lake tahoe real estate map toilet sign nike infant clothing usps passport form more lone star preview marching speed fins surf rpg online games 3d runco big butts in tight jeans belleville illinois animal shelter 5 cable cat crimp kit these are the days mescalero apaches style quizzes teknik lingkungan itb industrial computers volvo c30 takaful national ep graphic sheila house corbin seats work gloves prince kiss mp3 download legal pittsburgh service clarissa newsrover general motors canada domain tnt express worldwide track scottish jewelry zi zis lawyer lawrenceville ga keisha evans www italo disco windows safe mode xp saddlebred aqa couples sexual positions flight schedules inthe vip new york newspapers plus size bra nightloop stoneware bowl abbs dive site st domain french currency poconos trussville auto mart pontiac vibe a map of pa new york tooth implant winxp media center serial team america song americas test kitchen home oops celebs nicole kidman ladders marine steel neopets crossword puzzle christmas songs herb ritts equine classifieds virginia wizardry 7 walkthrough sex with my first cousin minnesota viking address lake chatuge georgia postales gratis para imprimir mansion for sale serikat dot to dot mineral make-up omar bradley teenage wrestling sample female ejaculation video bain de soleil caller ringtone medical restraint denver home glass flower vases top rmvb tech lighting helga lawyers directory bed side table where can i buy ielts books free mac games download games lawrence travel chanel saddleback covenant church jayachandra state income tax hair growth system the spokesman review.com application illinois secretary state title filmmaking equipment lingerie clothing online store giga galleries rejection line.com whats the difference chiropractor relief doctor xho1 site pre approved credit cards wildland jacket vertical horizon andria university of saskatchewan houston mls el paso nursing home strength as a teacher tyranny guild burning legion ayline contentment party game ideas 5a aircraft british se prince william charles submissive sluts estate manayunk real beach wallpaper web moonligt sidekick phone covers redstone federal credit union jet airways girls caught on camera raining all over the world self employment medical insurance 3 wonder lake il zip code multi grain pancake mix prince of persia 2 xbox guide hordes of the underdark walkthrough link abraxas
What is this?
This is a Steam port of VICE that is built to not depend on Steam. This modification works on Windows and Linux.
Pre-Built binaries
Compiling on Windows
- First you need to create a new Empty VisualC++ Console Project that will compile this code into an executable.
- Add public/IceKey.cpp into your project
- Setup the include paths in your settings to include public/ (for the header file)
- Copy the code below into main.cpp, and compile.
Compiling on Linux
- Copy the makefile into a file called Makefile
- edit the Makefile to reflect the path to your SDK_ROOT/public/ directory
- make
main.cpp
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: Standalone utility to encrypt files with ice encryption, that doesn't // depend on Steam. // // Author: Valve Software and Scott Loyd (scottloyd@gmail.com). // Tested and proofread by Me2. // Depends on: Just needs public/IceKey.cpp to be compiled/linked with it // $NoKeywords: $ // //=============================================================================// #include <stdio.h> #include <stdlib.h> #include <string.h> #include "IceKey.H" // Globals static bool g_Encrypt = true; //By default we encrypt #define MAX_ICE_KEY 8 #define MAX_EXTENSION 16 static char g_ICEKey[MAX_ICE_KEY]; static char g_Extension[MAX_EXTENSION]; #ifdef WIN32 #define STRING_CMP stricmp #else #define STRING_CMP strcasecmp #undef NULL #define NULL 0 #endif //----- Helpers ----- void Usage( void ) { fprintf( stdout, "Usage: ice <-d> <-x ext> [-k IceKey(8 byte)] [file]\n" ); fprintf( stdout, "Default action: Encrypt. \n" ); fprintf( stdout, "-d : Decrypt a file. \n" ); fprintf( stdout, "-x : Extension to use as output. \n" ); fprintf( stdout, "-k : You need to specify your 8 byte Ice Encryption Key. \n" ); fprintf( stdout, "-h : Print the help menu, and stop.\n" ); } void Exit(const char *msg) { fprintf( stderr, msg ); exit( 1 ); } void SetExtension(char *dest, size_t length, const char *ext) { //Start at the end till we hit a . //if we reach 0 without a . just append the extension; one must not have existed. size_t mover = length; while( (*(dest + mover) != '.') && (mover > 0)) mover--; if(mover == 0) strcat(dest,ext); else { strcpy(dest + mover,ext); } } /* The entry point, see usage for I/O */ int main(int argc, char* argv[]) { if(argc < 2) { Usage(); exit( 0 ); } //By default we output .ctx strncpy( g_Extension, ".ctx",MAX_EXTENSION ); memset(g_ICEKey,0,MAX_ICE_KEY); int i = 1; while( i < argc ) { if( STRING_CMP( argv[i], "-h" ) == 0 ) { Usage(); exit( 0 ); } else if( STRING_CMP( argv[i], "-d" ) == 0 ) { g_Encrypt = false; } else if( STRING_CMP( argv[i], "-x" ) == 0 ) { //Extension i++; if ( strlen( argv[i] ) > MAX_EXTENSION ) { Exit("Your Extension is too big.\n"); } strncpy( g_Extension, argv[i], MAX_EXTENSION ); } else if( STRING_CMP( argv[i], "-k" ) == 0 ) { //Key i++; if ( strlen( argv[i] ) != MAX_ICE_KEY ) { Exit("Your ICE key needs to be 8 characters long.\n"); } strncpy( g_ICEKey, argv[i], MAX_ICE_KEY ); } else { break; } i++; } if(g_ICEKey[0] == '\0') { Exit("You need to specify a key.\n"); } //Parse files starting from current arg position if(argv[i] == NULL && (strlen(argv[i]) < 1)) Exit("Was not about to find a file to parse\n"); //Open allocate/read a file into memory FILE *pFile; pFile = fopen (argv[i], "rb"); if(! pFile) Exit("Failed to open input file\n"); long lFileSize; //Size of input file unsigned char *pBuff; //Holds the input file contents unsigned char *pOutBuff; //Holds the output goodies // obtain file size. fseek (pFile , 0 , SEEK_END); lFileSize= ftell (pFile); rewind (pFile); // allocate memory to contain the whole file. pBuff = (unsigned char*) malloc (lFileSize); pOutBuff = (unsigned char*) malloc (lFileSize); if (pBuff == NULL || pOutBuff == NULL) { fclose(pFile); Exit("Could not allocate buffer\n");; } // copy the file into the buffer. fread (pBuff,1,lFileSize,pFile); //clean the output buffer memset(pOutBuff,NULL,lFileSize); fclose(pFile); //Lets start the ice goodies! IceKey ice( 0 ); // level 0 = 64bit key ice.set( (unsigned char*) g_ICEKey ); // set key int blockSize = ice.blockSize(); unsigned char *p1 = pBuff; unsigned char *p2 = pOutBuff; // encrypt data in 8 byte blocks int bytesLeft = lFileSize; while ( bytesLeft >= blockSize ) { if ( g_Encrypt ) ice.encrypt( p1, p2 ); else ice.decrypt( p1, p2 ); bytesLeft -= blockSize; p1+=blockSize; p2+=blockSize; } //The end chunk doesn't get an encryption? that sux... memcpy( p2, p1, bytesLeft ); size_t outLength = strlen(argv[i]) + MAX_EXTENSION + 1; char *pOutPath = (char *)malloc(outLength); strncpy(pOutPath,argv[i],outLength); SetExtension(pOutPath, outLength, g_Extension); pFile = fopen (pOutPath , "wb"); if(pFile == NULL) { fprintf( stderr, "Was not able to open output file for writing.\n" ); goto dealloc; } fwrite (pOutBuff , 1 , lFileSize , pFile); fclose (pFile); dealloc: free(pBuff); free(pOutBuff); free(pOutPath); }
Linux Makefile
#Simple Makefile for compiling on Linux CPP = g++ PUBLIC=../../public ice: ${CPP} -o $@ main.cpp ${PUBLIC}/IceKey.cpp -I${PUBLIC} clean: -rm -f ice
(Optional) Perl Script to make life easier
I use Env. Variables in all my scripts because of multiple developers, so you can either hardcode the variables, or set the env. variables on your system (see msdn docs. for that). Also, to take this even further, on my system I created a new MSVC project, then changed it to a utility project (leaving me with just build events); I then called the perl script as my post-build and MSVC now does everything for me in my build process.
#!/usr/bin/perl # easy script that compiles our scripts folder and then moves them to our mod directory! use warnings; use strict; use File::Copy; our $outExt = ".ctx"; our $baseOutput = $ENV{'MOD_CONTENT'}; die("Could not find MOD_CONTENT envirornment variable.\n") if !$baseOutput; our $outputDir = $baseOutput."\\scripts"; our $inputDir = $ENV{'CODE_SCRIPTS'}; die("Could not find CODE_SCRIPTS envirornment variable.\n") if !$inputDir; our $iceKey = $ENV{'ICE_KEY'}; die("Could not find ICE_KEY envirornment variable.\n") if !$iceKey; our $devToolPath = $ENV{'CODE_DEVTOOLS'}; die("Could not find CODE_DEVTOOLS envirornment variable.\n") if !$devToolPath; printf(" ** Encrypting scripts and copying them into your mod ** \n"); my $command = "$devToolPath\\ice -x $outExt -k $iceKey "; opendir DH, $inputDir or die "Could not open code-scripts directory\n"; while ($_ = readdir(DH)) { # we don't want to process . or .. directory holders. next if $_ eq "."; next if $_ eq ".."; next if -d $_; next if $_ !~ m/.txt$/; my $inFile = $inputDir."\\".$_; system($command.$inFile); #printf "Command: ".$command.$inFile."\n"; #Get a filename/path without the extension, add the extension to the end. my $outFile = $outputDir."\\".$_; $outFile =~ s/(.*).txt$/$1.ctx/; $inFile =~ s/(.*).txt$/$1.ctx/; #printf "InFile: ".$inFile."\n"; #printf "OutFile: ".$outFile."\n"; move($inFile,$outFile); } closedir DH;
See also
- Vice with wildcard(*) support - Red Comet's version
- Vice