aboutsummaryrefslogtreecommitdiff
path: root/mp/src/utils/vice
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/utils/vice
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/utils/vice')
-rw-r--r--mp/src/utils/vice/vice-2010.vcxproj247
-rw-r--r--mp/src/utils/vice/vice-2010.vcxproj.filters65
-rw-r--r--mp/src/utils/vice/vice.cpp277
3 files changed, 589 insertions, 0 deletions
diff --git a/mp/src/utils/vice/vice-2010.vcxproj b/mp/src/utils/vice/vice-2010.vcxproj
new file mode 100644
index 00000000..12e10a33
--- /dev/null
+++ b/mp/src/utils/vice/vice-2010.vcxproj
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>Vice</ProjectName>
+ <ProjectGuid>{03F753C0-8BA5-FF2B-D7D2-EE230B4683B1}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <TargetName>vice</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <TargetName>vice</TargetName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\win32\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\win32\</IntDir>
+ <ExecutablePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\devtools\vstools;$(ExecutablePath);$(Path)</ExecutablePath>
+ <PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</PreBuildEventUseInBuild>
+ <PreLinkEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</PreLinkEventUseInBuild>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>
+ <PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</PostBuildEventUseInBuild>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\win32\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\win32\</IntDir>
+ <ExecutablePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\devtools\vstools;$(ExecutablePath);$(Path)</ExecutablePath>
+ <PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</PreBuildEventUseInBuild>
+ <PreLinkEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</PreLinkEventUseInBuild>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest>
+ <PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</PostBuildEventUseInBuild>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PreBuildEvent>
+ <Command>if EXIST ..\..\..\game\bin\$(TargetFileName) for /f &quot;delims=&quot; %%A in (&apos;attrib &quot;..\..\..\game\bin\$(TargetFileName)&quot;&apos;) do set valveTmpIsReadOnly=&quot;%%A&quot;&#x0D;&#x0A;set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%&#x0D;&#x0A;if &quot;%valveTmpIsReadOnlyLetter%&quot;==&quot;R&quot; del /q &quot;$(TargetDir)&quot;$(TargetFileName)&#x0D;&#x0A;if exist ..\..\devtools\bin\vpc.exe ..\..\devtools\bin\vpc.exe -crc2 vice.vcxproj&#x0D;&#x0A;if ERRORLEVEL 1 exit 1</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <AdditionalOptions> /MP</AdditionalOptions>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\common;..\..\public;..\..\public\tier0;..\..\public\tier1;..\common</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_DEBUG;DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;RAD_TELEMETRY_DISABLED;COMPILER_MSVC32;VPCGAMECAPS=VALVE;PROJECTDIR=D:\dev\games\rel\hl2\src\utils\vice;_DLL_EXT=.dll;VPCGAME=valve</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>false</ExceptionHandling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <RuntimeTypeInfo>true</RuntimeTypeInfo>
+ <OpenMPSupport>false</OpenMPSupport>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <ExpandAttributedSource>false</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)/</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)/</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)/</ProgramDataBaseFileName>
+ <BrowseInformation>false</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <BrowseInformationFile>$(IntDir)/</BrowseInformationFile>
+ <ErrorReporting>Prompt</ErrorReporting>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE</PreprocessorDefinitions>
+ <Culture>1033</Culture>
+ </ResourceCompile>
+ <PreLinkEvent>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions> /NXCOMPAT /ignore:4221</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <ShowProgress>NotSet</ShowProgress>
+ <OutputFile>$(OutDir)\vice.exe</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>libc;libcd;libcmt</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)/$(TargetName).pdb</ProgramDatabaseFile>
+ <GenerateMapFile>false</GenerateMapFile>
+ <MapFileName>$(IntDir)/$(TargetName).map</MapFileName>
+ <SubSystem>Console</SubSystem>
+ <BaseAddress> </BaseAddress>
+ <TargetMachine>MachineX86</TargetMachine>
+ <LinkErrorReporting>PromptImmediately</LinkErrorReporting>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ </Link>
+ <Manifest>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Manifest>
+ <Xdcmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Xdcmake>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(OutDir)/vice.bsc</OutputFile>
+ </Bscmake>
+ <PostBuildEvent>
+ <Message>Publishing to ..\..\..\game\bin</Message>
+ <Command>if not exist &quot;..\..\..\game\bin&quot; mkdir &quot;..\..\..\game\bin&quot;&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;$(TargetFileName) ..\..\..\game\bin\$(TargetFileName)&#x0D;&#x0A;if ERRORLEVEL 1 goto BuildEventFailed&#x0D;&#x0A;if exist &quot;$(TargetDir)&quot;$(TargetName).map copy &quot;$(TargetDir)&quot;$(TargetName).map ..\..\..\game\bin\$(TargetName).map&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;$(TargetName).pdb ..\..\..\game\bin\$(TargetName).pdb&#x0D;&#x0A;if ERRORLEVEL 1 goto BuildEventFailed&#x0D;&#x0A;goto BuildEventOK&#x0D;&#x0A;:BuildEventFailed&#x0D;&#x0A;echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. ***&#x0D;&#x0A;del /q &quot;$(TargetDir)&quot;$(TargetFileName)&#x0D;&#x0A;exit 1&#x0D;&#x0A;:BuildEventOK&#x0D;&#x0A;</Command>
+ </PostBuildEvent>
+ <CustomBuildStep>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <PreBuildEvent>
+ <Command>if EXIST ..\..\..\game\bin\$(TargetFileName) for /f &quot;delims=&quot; %%A in (&apos;attrib &quot;..\..\..\game\bin\$(TargetFileName)&quot;&apos;) do set valveTmpIsReadOnly=&quot;%%A&quot;&#x0D;&#x0A;set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%&#x0D;&#x0A;if &quot;%valveTmpIsReadOnlyLetter%&quot;==&quot;R&quot; del /q &quot;$(TargetDir)&quot;$(TargetFileName)&#x0D;&#x0A;if exist ..\..\devtools\bin\vpc.exe ..\..\devtools\bin\vpc.exe -crc2 vice.vcxproj&#x0D;&#x0A;if ERRORLEVEL 1 exit 1</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <AdditionalOptions> /MP /d2Zi+</AdditionalOptions>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>..\..\common;..\..\public;..\..\public\tier0;..\..\public\tier1;..\common</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;RAD_TELEMETRY_DISABLED;COMPILER_MSVC32;VPCGAMECAPS=VALVE;PROJECTDIR=D:\dev\games\rel\hl2\src\utils\vice;_DLL_EXT=.dll;VPCGAME=valve</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>false</ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <RuntimeTypeInfo>true</RuntimeTypeInfo>
+ <OpenMPSupport>false</OpenMPSupport>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <ExpandAttributedSource>false</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)/</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)/</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)/</ProgramDataBaseFileName>
+ <BrowseInformation>false</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <BrowseInformationFile>$(IntDir)/</BrowseInformationFile>
+ <ErrorReporting>Prompt</ErrorReporting>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE</PreprocessorDefinitions>
+ <Culture>1033</Culture>
+ </ResourceCompile>
+ <PreLinkEvent>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions> /DYNAMICBASE /NXCOMPAT /ignore:4221</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <ShowProgress>NotSet</ShowProgress>
+ <OutputFile>$(OutDir)\vice.exe</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>libc;libcd;libcmtd</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)/$(TargetName).pdb</ProgramDatabaseFile>
+ <GenerateMapFile>false</GenerateMapFile>
+ <MapFileName>$(IntDir)/$(TargetName).map</MapFileName>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <BaseAddress> </BaseAddress>
+ <TargetMachine>MachineX86</TargetMachine>
+ <LinkErrorReporting>PromptImmediately</LinkErrorReporting>
+ </Link>
+ <Manifest>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Manifest>
+ <Xdcmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Xdcmake>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(OutDir)/vice.bsc</OutputFile>
+ </Bscmake>
+ <PostBuildEvent>
+ <Message>Publishing to ..\..\..\game\bin</Message>
+ <Command>if not exist &quot;..\..\..\game\bin&quot; mkdir &quot;..\..\..\game\bin&quot;&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;$(TargetFileName) ..\..\..\game\bin\$(TargetFileName)&#x0D;&#x0A;if ERRORLEVEL 1 goto BuildEventFailed&#x0D;&#x0A;if exist &quot;$(TargetDir)&quot;$(TargetName).map copy &quot;$(TargetDir)&quot;$(TargetName).map ..\..\..\game\bin\$(TargetName).map&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;$(TargetName).pdb ..\..\..\game\bin\$(TargetName).pdb&#x0D;&#x0A;if ERRORLEVEL 1 goto BuildEventFailed&#x0D;&#x0A;goto BuildEventOK&#x0D;&#x0A;:BuildEventFailed&#x0D;&#x0A;echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. ***&#x0D;&#x0A;del /q &quot;$(TargetDir)&quot;$(TargetFileName)&#x0D;&#x0A;exit 1&#x0D;&#x0A;:BuildEventOK&#x0D;&#x0A;</Command>
+ </PostBuildEvent>
+ <CustomBuildStep>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <Library Include="..\..\lib\public\mathlib.lib" />
+ <Library Include="..\..\lib\public\tier0.lib" />
+ <Library Include="..\..\lib\public\tier1.lib" />
+ <Library Include="..\..\lib\public\tier2.lib" />
+ <Library Include="..\..\lib\public\vstdlib.lib" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\public\mathlib\IceKey.H" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\common\cmdlib.cpp" />
+ <ClCompile Include="..\..\public\filesystem_helpers.cpp" />
+ <ClCompile Include="..\..\public\filesystem_init.cpp" />
+ <ClCompile Include="..\common\filesystem_tools.cpp" />
+ <ClCompile Include="..\..\public\tier0\memoverride.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="vice.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\public\tier0\pointeroverride.asm">
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compiling pointeroverride.asm</Message>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">&quot;$(VCInstallDir)bin\ml.exe&quot; /c /Cp /Zi /Fo&quot;$(IntDir)\%(Filename).obj&quot; &quot;%(FullPath)&quot;</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\%(Filename).obj</Outputs>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compiling pointeroverride.asm</Message>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">&quot;$(VCInstallDir)bin\ml.exe&quot; /c /Cp /Zi /Fo&quot;$(IntDir)\%(Filename).obj&quot; &quot;%(FullPath)&quot;</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\%(Filename).obj</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/mp/src/utils/vice/vice-2010.vcxproj.filters b/mp/src/utils/vice/vice-2010.vcxproj.filters
new file mode 100644
index 00000000..82155f11
--- /dev/null
+++ b/mp/src/utils/vice/vice-2010.vcxproj.filters
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{1680C80B-FF1E-EA4D-9817-CC12254F2E40}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Link Libraries">
+ <UniqueIdentifier>{C5D73B3A-C648-896C-B7CE-F174808E5BA5}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{BA03E055-4FA2-FCE3-8A1C-D348547D379C}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <Library Include="..\..\lib\public\mathlib.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ <Library Include="..\..\lib\public\tier0.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ <Library Include="..\..\lib\public\tier1.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ <Library Include="..\..\lib\public\tier2.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ <Library Include="..\..\lib\public\vstdlib.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\public\mathlib\IceKey.H">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\common\cmdlib.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\public\filesystem_helpers.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\public\filesystem_init.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\common\filesystem_tools.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\public\tier0\memoverride.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="vice.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\public\tier0\pointeroverride.asm">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+</Project>
diff --git a/mp/src/utils/vice/vice.cpp b/mp/src/utils/vice/vice.cpp
new file mode 100644
index 00000000..0ed9c32e
--- /dev/null
+++ b/mp/src/utils/vice/vice.cpp
@@ -0,0 +1,277 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+// vice.cpp : Defines the entry point for the console application.
+//
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <malloc.h>
+#include <string.h>
+#include "tier1/strtools.h"
+#include <sys/stat.h>
+#include "conio.h"
+#include <direct.h>
+#include <io.h>
+#include "UtlBuffer.h"
+#include "tier0/dbg.h"
+#include "cmdlib.h"
+#include "tier0/icommandline.h"
+#include "windows.h"
+
+#include "mathlib/IceKey.h"
+#include <filesystem_tools.h>
+
+#define FF_TRYAGAIN 1
+#define FF_DONTPROCESS 2
+
+#undef GetCurrentDirectory
+
+static bool g_NoPause = false;
+static bool g_Quiet = false;
+static bool g_Encrypt = false;
+static bool g_Decrypt = false;
+static char g_ICEKey[16];
+static char g_Extension[16];
+
+static void Pause( void )
+{
+ if( !g_NoPause )
+ {
+ printf( "Hit a key to continue\n" );
+ getch();
+ }
+}
+
+static void Exit(const char *msg)
+{
+ fprintf( stderr, msg );
+ Pause();
+ exit( -1 );
+}
+
+static void Usage( void )
+{
+ fprintf( stderr, "Usage: vice [-quiet] [-nopause] [-encrypt key] [-decrypt key] [-newext name] file file2 . . .\n" );
+ fprintf( stderr, "-quiet : don't print anything out, don't pause for input\n" );
+ fprintf( stderr, "-nopause : don't pause for input\n" );
+ fprintf( stderr, "-encrypt : encrypt files with given key\n" );
+ fprintf( stderr, "-decrypt : decypt files with given key\n" );
+ fprintf( stderr, "-newext : new output file extension\n" );
+ Pause();
+ exit( -1 );
+}
+
+
+bool Process_File( char *pInputBaseName, int maxlen )
+{
+ Q_FixSlashes( pInputBaseName, '/' );
+ // Q_StripExtension( pInputBaseName, pInputBaseName, maxlen );
+
+ if( !g_Quiet )
+ {
+ printf( "input file: %s\n", pInputBaseName );
+ }
+
+ FileHandle_t f = g_pFullFileSystem->Open(pInputBaseName, "rb", "vice" );
+
+ if (!f)
+ Error("Could not open input file");
+
+ int fileSize = g_pFullFileSystem->Size(f);
+
+ unsigned char *buffer = (unsigned char*)_alloca(fileSize);
+
+ g_pFullFileSystem->Read(buffer, fileSize, f); // read into local buffer
+ g_pFullFileSystem->Close( f ); // close file after reading
+
+ IceKey ice( 0 ); // level 0 = 64bit key
+ ice.set( (unsigned char*) g_ICEKey ); // set key
+
+ int blockSize = ice.blockSize();
+
+ unsigned char *temp = (unsigned char *)_alloca( fileSize );
+ unsigned char *p1 = buffer;
+ unsigned char *p2 = temp;
+
+ // encrypt data in 8 byte blocks
+ int bytesLeft = fileSize;
+ while ( bytesLeft >= blockSize )
+ {
+ if ( g_Encrypt )
+ {
+ ice.encrypt( p1, p2 );
+ }
+ else if ( g_Decrypt )
+ {
+ ice.decrypt( p1, p2 );
+ }
+ else
+ {
+ memcpy( p2, p1, blockSize );
+ }
+
+ bytesLeft -= blockSize;
+ p1+=blockSize;
+ p2+=blockSize;
+ }
+
+ memcpy( p2, p1, bytesLeft );
+
+ Q_SetExtension( pInputBaseName, g_Extension, maxlen );
+
+ if( !g_Quiet )
+ {
+ printf( "output file: %s\n", pInputBaseName );
+ }
+
+ f = g_pFullFileSystem->Open(pInputBaseName, "wb", "vice" );
+
+ if (!f)
+ Exit("Could not open output file");
+
+ g_pFullFileSystem->Write( temp, fileSize, f ); // read into local buffer
+ g_pFullFileSystem->Close( f ); // close file after reading
+
+ return TRUE;
+}
+
+int main(int argc, char* argv[])
+{
+ CommandLine()->CreateCmdLine( argc, argv );
+
+
+ if( argc < 2 )
+ {
+ Usage();
+ }
+ char *pInputBaseName = NULL;
+ int i = 1;
+ strcpy( g_Extension, ".dat" );
+ while( i < argc )
+ {
+ if( stricmp( argv[i], "-quiet" ) == 0 )
+ {
+ i++;
+ g_Quiet = true;
+ g_NoPause = true; // no point in pausing if we aren't going to print anything out.
+ }
+ if( stricmp( argv[i], "-nopause" ) == 0 )
+ {
+ i++;
+ g_NoPause = true;
+ }
+ if( stricmp( argv[i], "-encrypt" ) == 0 )
+ {
+ g_Encrypt = true;
+ i++;
+
+ if ( strlen( argv[i] ) != 8 )
+ {
+ Exit("Error - ICE key must be a 8 char text.\n");
+ }
+
+ Q_strncpy( g_ICEKey, argv[i], sizeof(g_ICEKey) );
+ i++;
+
+ }
+ if( stricmp( argv[i], "-decrypt" ) == 0 )
+ {
+ g_Decrypt = true;
+ i++;
+
+ if ( strlen( argv[i] ) != 8 )
+ {
+ Exit("Error - ICE key must be a 8 char text.\n");
+ }
+
+ Q_strncpy( g_ICEKey, argv[i], sizeof(g_ICEKey) );
+ i++;
+
+ }
+ if( stricmp( argv[i], "-newext" ) == 0 )
+ {
+ i++;
+
+ if ( strlen( argv[i] ) > 5 )
+ {
+ Exit("Error - extension must be smaller than 4 chars.\n");
+ }
+
+ Q_strncpy( g_Extension, argv[i], sizeof(g_Extension) );
+ i++;
+
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if ( i >= argc )
+ {
+ Exit("Error - missing files in commandline.\n");
+ }
+
+ CmdLib_InitFileSystem( argv[i] );
+
+ g_pFullFileSystem->GetCurrentDirectory( gamedir, sizeof(gamedir) );
+ g_pFullFileSystem->AddSearchPath( gamedir, "vice" );
+
+
+ Q_FixSlashes( gamedir, '/' );
+
+ for( ; i < argc; i++ )
+ {
+ pInputBaseName = argv[i];
+ int maxlen = Q_strlen( pInputBaseName ) + 1;
+
+
+ if ( strstr( pInputBaseName, "*.") )
+ {
+ char search[ MAX_PATH ];
+ char fname[ MAX_PATH ];
+ char ext[_MAX_EXT];
+
+ _splitpath( pInputBaseName, NULL, NULL, fname, ext ); //find extension wanted
+ fname[strlen(fname)-1] = 0; // remove *
+
+ sprintf( search, "%s\\*%s", gamedir, ext );
+
+ Q_FixSlashes( search, '/' );
+
+ WIN32_FIND_DATA wfd;
+ HANDLE hResult;
+ memset(&wfd, 0, sizeof(WIN32_FIND_DATA));
+
+ hResult = FindFirstFile( search, &wfd );
+
+ while ( hResult != INVALID_HANDLE_VALUE )
+ {
+ if ( !strnicmp( fname, wfd.cFileName, strlen(fname) ) )
+ {
+ if ( !Process_File( wfd.cFileName, sizeof( wfd.cFileName ) ) )
+ break;
+ }
+
+ if ( !FindNextFile( hResult, &wfd) )
+ break;
+
+ }
+
+ FindClose( hResult );
+ }
+ else
+ {
+ Process_File( pInputBaseName, maxlen );
+ }
+ }
+
+ Pause();
+ return 0;
+}
+