diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/SteamDebugHelper | |
| download | archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip | |
Diffstat (limited to 'utils/SteamDebugHelper')
| -rw-r--r-- | utils/SteamDebugHelper/DebugSourceBeta.cfg | 18 | ||||
| -rw-r--r-- | utils/SteamDebugHelper/StdAfx.cpp | 15 | ||||
| -rw-r--r-- | utils/SteamDebugHelper/StdAfx.h | 33 | ||||
| -rw-r--r-- | utils/SteamDebugHelper/SteamDebugHelper.cpp | 79 | ||||
| -rw-r--r-- | utils/SteamDebugHelper/SteamDebugHelper.h | 56 | ||||
| -rw-r--r-- | utils/SteamDebugHelper/SteamDebugHelper.rc | 184 | ||||
| -rw-r--r-- | utils/SteamDebugHelper/SteamDebugHelper.vcproj | 261 | ||||
| -rw-r--r-- | utils/SteamDebugHelper/SteamDebugHelperDlg.cpp | 384 | ||||
| -rw-r--r-- | utils/SteamDebugHelper/SteamDebugHelperDlg.h | 76 | ||||
| -rw-r--r-- | utils/SteamDebugHelper/res/SteamDebugHelper.ico | bin | 0 -> 1078 bytes | |||
| -rw-r--r-- | utils/SteamDebugHelper/res/SteamDebugHelper.rc2 | 13 | ||||
| -rw-r--r-- | utils/SteamDebugHelper/resource.h | 29 |
12 files changed, 1148 insertions, 0 deletions
diff --git a/utils/SteamDebugHelper/DebugSourceBeta.cfg b/utils/SteamDebugHelper/DebugSourceBeta.cfg new file mode 100644 index 0000000..2a45b43 --- /dev/null +++ b/utils/SteamDebugHelper/DebugSourceBeta.cfg @@ -0,0 +1,18 @@ +"debuginfo" +{ + "SourceExeDir" "c:\sourcebeta" + "SteamAppDir" "c:\valve\SteamTestPublic\steamapps\mikedussault\counter-strike source" + + "SteamApp.Cfg" + { + "text" "SteamAppID=270" + "text" "SteamAppUser=mikedussault" + "text" "MinFootprintAutoRefresh=disable" + // SteamInstallPath is added automatically by the SteamDebugHelper program. + } + + // These binaries get copied up to the steam directory for debugging. + "binary" "bin\engine.dll" + "binary" "cstrike\bin\server.dll" + "binary" "cstrike\bin\client.dll" +} diff --git a/utils/SteamDebugHelper/StdAfx.cpp b/utils/SteamDebugHelper/StdAfx.cpp new file mode 100644 index 0000000..874a5ce --- /dev/null +++ b/utils/SteamDebugHelper/StdAfx.cpp @@ -0,0 +1,15 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// stdafx.cpp : source file that includes just the standard includes +// SteamDebugHelper.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + + + diff --git a/utils/SteamDebugHelper/StdAfx.h b/utils/SteamDebugHelper/StdAfx.h new file mode 100644 index 0000000..0738ed3 --- /dev/null +++ b/utils/SteamDebugHelper/StdAfx.h @@ -0,0 +1,33 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__1427A276_CEDF_4CBC_82F1_31B639DB70A8__INCLUDED_) +#define AFX_STDAFX_H__1427A276_CEDF_4CBC_82F1_31B639DB70A8__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers + +#include <afxwin.h> // MFC core and standard components +#include <afxext.h> // MFC extensions +#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include <afxcmn.h> // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__1427A276_CEDF_4CBC_82F1_31B639DB70A8__INCLUDED_) diff --git a/utils/SteamDebugHelper/SteamDebugHelper.cpp b/utils/SteamDebugHelper/SteamDebugHelper.cpp new file mode 100644 index 0000000..9b1ea25 --- /dev/null +++ b/utils/SteamDebugHelper/SteamDebugHelper.cpp @@ -0,0 +1,79 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// SteamDebugHelper.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "SteamDebugHelper.h" +#include "SteamDebugHelperDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CSteamDebugHelperApp + +BEGIN_MESSAGE_MAP(CSteamDebugHelperApp, CWinApp) + //{{AFX_MSG_MAP(CSteamDebugHelperApp) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG + ON_COMMAND(ID_HELP, CWinApp::OnHelp) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CSteamDebugHelperApp construction + +CSteamDebugHelperApp::CSteamDebugHelperApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + +///////////////////////////////////////////////////////////////////////////// +// The one and only CSteamDebugHelperApp object + +CSteamDebugHelperApp theApp; + +///////////////////////////////////////////////////////////////////////////// +// CSteamDebugHelperApp initialization + +BOOL CSteamDebugHelperApp::InitInstance() +{ + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. + +#ifdef _AFXDLL + Enable3dControls(); // Call this when using MFC in a shared DLL +#else + Enable3dControlsStatic(); // Call this when linking to MFC statically +#endif + + CSteamDebugHelperDlg dlg; + m_pMainWnd = &dlg; + int nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: Place code here to handle when the dialog is + // dismissed with OK + } + else if (nResponse == IDCANCEL) + { + // TODO: Place code here to handle when the dialog is + // dismissed with Cancel + } + + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; +} diff --git a/utils/SteamDebugHelper/SteamDebugHelper.h b/utils/SteamDebugHelper/SteamDebugHelper.h new file mode 100644 index 0000000..594fd3b --- /dev/null +++ b/utils/SteamDebugHelper/SteamDebugHelper.h @@ -0,0 +1,56 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// SteamDebugHelper.h : main header file for the STEAMDEBUGHELPER application +// + +#if !defined(AFX_STEAMDEBUGHELPER_H__C6F4FF3C_B13B_4294_A881_57BC35FC16AF__INCLUDED_) +#define AFX_STEAMDEBUGHELPER_H__C6F4FF3C_B13B_4294_A881_57BC35FC16AF__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#ifndef __AFXWIN_H__ + #error include 'stdafx.h' before including this file for PCH +#endif + +#include "resource.h" // main symbols + +///////////////////////////////////////////////////////////////////////////// +// CSteamDebugHelperApp: +// See SteamDebugHelper.cpp for the implementation of this class +// + +class CSteamDebugHelperApp : public CWinApp +{ +public: + CSteamDebugHelperApp(); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CSteamDebugHelperApp) + public: + virtual BOOL InitInstance(); + //}}AFX_VIRTUAL + +// Implementation + + //{{AFX_MSG(CSteamDebugHelperApp) + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STEAMDEBUGHELPER_H__C6F4FF3C_B13B_4294_A881_57BC35FC16AF__INCLUDED_) diff --git a/utils/SteamDebugHelper/SteamDebugHelper.rc b/utils/SteamDebugHelper/SteamDebugHelper.rc new file mode 100644 index 0000000..57b4131 --- /dev/null +++ b/utils/SteamDebugHelper/SteamDebugHelper.rc @@ -0,0 +1,184 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#endif //_WIN32\r\n" + "#include ""res\\SteamDebugHelper.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON DISCARDABLE "res\\SteamDebugHelper.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_STEAMDEBUGHELPER_DIALOG DIALOGEX 0, 0, 220, 166 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "SteamDebugHelper - No File" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "&Setup For Debugging",ID_SETUP_FOR_DEBUGGING,40,19,139, + 14,WS_DISABLED + PUSHBUTTON "&Un-setup For Debugging",ID_UNSETUP_FOR_DEBUGGING,40,38, + 139,14,WS_DISABLED + PUSHBUTTON "&Choose Config File",ID_EDIT_CHOOSE_CONFIG_FILE,40,78, + 139,14 + PUSHBUTTON "&Edit Config File",ID_EDIT_CONFIG_FILE,40,97,139,14, + WS_DISABLED + PUSHBUTTON "&Launch Steam.exe",ID_START_STEAM,40,116,139,14 + PUSHBUTTON "&Quit",IDCANCEL,7,145,206,14 + GROUPBOX "Debug",IDC_STATIC,7,7,206,54 + GROUPBOX "Setup",IDC_STATIC,7,65,206,72 +END + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "\0" + VALUE "FileDescription", "SteamDebugHelper MFC Application\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "SteamDebugHelper\0" + VALUE "LegalCopyright", "Copyright (C) 2004\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "SteamDebugHelper.EXE\0" + VALUE "ProductName", "SteamDebugHelper Application\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_STEAMDEBUGHELPER_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 159 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif //_WIN32 +#include "res\SteamDebugHelper.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/utils/SteamDebugHelper/SteamDebugHelper.vcproj b/utils/SteamDebugHelper/SteamDebugHelper.vcproj new file mode 100644 index 0000000..c334514 --- /dev/null +++ b/utils/SteamDebugHelper/SteamDebugHelper.vcproj @@ -0,0 +1,261 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="SteamDebugHelper" + ProjectGUID="{288FA186-3A0A-4003-ACC5-3813D62D6F32}" + SccProjectName="" + SccAuxPath="" + SccLocalPath="" + SccProvider="" + Keyword="MFCProj"> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\Debug" + IntermediateDirectory=".\Debug" + ConfigurationType="1" + UseOfMFC="1" + ATLMinimizesCRunTimeLibraryUsage="FALSE" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="..\..\public,..\..\public\tier1" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + UsePrecompiledHeader="0" + PrecompiledHeaderThrough="stdafx.h" + PrecompiledHeaderFile=".\Debug/SteamDebugHelper.pch" + AssemblerListingLocation=".\Debug/" + ObjectFile=".\Debug/" + ProgramDataBaseFileName=".\Debug/" + WarningLevel="4" + SuppressStartupBanner="TRUE" + DebugInformationFormat="4" + CompileAs="0"/> + <Tool + Name="VCCustomBuildTool" + CommandLine="if exist ..\..\..\game\bin\SteamDebugHelper.exe del /f ..\..\..\game\bin\SteamDebugHelper.exe +copy "$(TargetPath)" ..\..\..\game\bin +" + Outputs="..\..\..\game\bin\SteamDebugHelper.exe"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="nafxcwd.lib libcmtd.lib" + OutputFile=".\Debug/SteamDebugHelper.exe" + LinkIncremental="1" + SuppressStartupBanner="TRUE" + GenerateDebugInformation="TRUE" + ProgramDatabaseFile=".\Debug/SteamDebugHelper.pdb" + SubSystem="2" + TargetMachine="1"/> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="_DEBUG" + MkTypLibCompatible="TRUE" + SuppressStartupBanner="TRUE" + TargetEnvironment="1" + TypeLibraryName=".\Debug/SteamDebugHelper.tlb" + HeaderFileName=""/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory=".\Release" + IntermediateDirectory=".\Release" + ConfigurationType="1" + UseOfMFC="1" + ATLMinimizesCRunTimeLibraryUsage="FALSE" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + AdditionalIncludeDirectories="..\..\public,..\..\public\tier1" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" + StringPooling="TRUE" + RuntimeLibrary="0" + EnableFunctionLevelLinking="TRUE" + UsePrecompiledHeader="0" + PrecompiledHeaderThrough="stdafx.h" + PrecompiledHeaderFile=".\Release/SteamDebugHelper.pch" + AssemblerListingLocation=".\Release/" + ObjectFile=".\Release/" + ProgramDataBaseFileName=".\Release/" + WarningLevel="4" + SuppressStartupBanner="TRUE" + CompileAs="0"/> + <Tool + Name="VCCustomBuildTool" + CommandLine="if exist ..\..\..\game\bin\SteamDebugHelper.exe del /f ..\..\..\game\bin\SteamDebugHelper.exe +copy "$(TargetPath)" ..\..\..\game\bin +" + Outputs="..\..\..\game\bin\SteamDebugHelper.exe"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="nafxcw.lib libcmt.lib" + OutputFile=".\Release/SteamDebugHelper.exe" + LinkIncremental="1" + SuppressStartupBanner="TRUE" + ProgramDatabaseFile=".\Release/SteamDebugHelper.pdb" + SubSystem="2" + TargetMachine="1"/> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="NDEBUG" + MkTypLibCompatible="TRUE" + SuppressStartupBanner="TRUE" + TargetEnvironment="1" + TypeLibraryName=".\Release/SteamDebugHelper.tlb" + HeaderFileName=""/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + <File + RelativePath="..\..\public\tier0\memoverride.cpp"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0"/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0"/> + </FileConfiguration> + </File> + <File + RelativePath="StdAfx.cpp"> + </File> + <File + RelativePath="SteamDebugHelper.cpp"> + </File> + <File + RelativePath="SteamDebugHelper.rc"> + </File> + <File + RelativePath="SteamDebugHelperDlg.cpp"> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl"> + <File + RelativePath="Resource.h"> + </File> + <File + RelativePath="StdAfx.h"> + </File> + <File + RelativePath="SteamDebugHelper.h"> + </File> + <File + RelativePath="SteamDebugHelperDlg.h"> + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> + <File + RelativePath="res\SteamDebugHelper.ico"> + </File> + <File + RelativePath="res\SteamDebugHelper.rc2"> + </File> + </Filter> + <File + RelativePath="ReadMe.txt"> + </File> + <File + RelativePath="..\..\lib\public\tier0.lib"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + Description="" + CommandLine=""/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + Description="" + CommandLine=""/> + </FileConfiguration> + </File> + <File + RelativePath="..\..\lib\public\tier1.lib"> + </File> + <File + RelativePath="..\..\lib\public\vstdlib.lib"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + Description="" + CommandLine=""/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + Description="" + CommandLine=""/> + </FileConfiguration> + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/utils/SteamDebugHelper/SteamDebugHelperDlg.cpp b/utils/SteamDebugHelper/SteamDebugHelperDlg.cpp new file mode 100644 index 0000000..c5095ef --- /dev/null +++ b/utils/SteamDebugHelper/SteamDebugHelperDlg.cpp @@ -0,0 +1,384 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// SteamDebugHelperDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "SteamDebugHelper.h" +#include "SteamDebugHelperDlg.h" +#include "filesystem.h" +#include "interface.h" +#include "filesystem_tools.h" +#include <io.h> +#include <direct.h> +#include "tier0/icommandline.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define CHECK( cmd ) \ + if ( !(cmd) ) \ + Error( "%s failed", #cmd ); + +#define CHECK_1STR( cmd, a ) \ + if ( !(cmd) ) \ + Error( "%s failed (%s)", #cmd, a ); + +#define CHECK_2STR( cmd, a, b ) \ + if ( !(cmd) ) \ + Error( "%s failed (%s, %s)", #cmd, a, b ); + + +///////////////////////////////////////////////////////////////////////////// +// CSteamDebugHelperDlg dialog + +CSteamDebugHelperDlg::CSteamDebugHelperDlg(CWnd* pParent /*=NULL*/) + : CDialog(CSteamDebugHelperDlg::IDD, pParent) +{ + //{{AFX_DATA_INIT(CSteamDebugHelperDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT + // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); +} + +void CSteamDebugHelperDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CSteamDebugHelperDlg) + // NOTE: the ClassWizard will add DDX and DDV calls here + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CSteamDebugHelperDlg, CDialog) + //{{AFX_MSG_MAP(CSteamDebugHelperDlg) + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + ON_BN_CLICKED(ID_SETUP_FOR_DEBUGGING, OnSetupForDebugging) + ON_BN_CLICKED(ID_UNSETUP_FOR_DEBUGGING, OnUnsetupForDebugging) + ON_BN_CLICKED(ID_START_STEAM, OnStartSteam) + ON_BN_CLICKED(ID_EDIT_CONFIG_FILE, OnEditConfigFile) + ON_BN_CLICKED(ID_EDIT_CHOOSE_CONFIG_FILE, OnEditChooseConfigFile) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CSteamDebugHelperDlg message handlers + +SpewRetval_t MySpewOutput( SpewType_t spewType, char const *pMsg ) +{ + if ( spewType == SPEW_ERROR ) + { + ::MessageBox( NULL, pMsg, "Error", MB_OK | MB_TASKMODAL ); + TerminateProcess( GetCurrentProcess(), 1 ); + } + + if ( spewType == SPEW_ASSERT ) + return SPEW_DEBUGGER; + + return SPEW_CONTINUE; +} + + +BOOL CSteamDebugHelperDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE); // Set small icon + + SpewOutputFunc( MySpewOutput ); + + // Load the file system. + CommandLine()->CreateCmdLine( __argc, __argv ); + FileSystem_Init( NULL, 0, FS_INIT_COMPATIBILITY_MODE ); + + if ( __argc >= 2 ) + { + SetConfigFilename( __argv[1] ); + } + + // Make sure the config file parses. + KeyValues *pTest = LoadConfigFile(); + pTest->deleteThis(); + + return TRUE; // return TRUE unless you set the focus to a control +} + +// If you add a minimize button to your dialog, you will need the code below +// to draw the icon. For MFC applications using the document/view model, +// this is automatically done for you by the framework. + +void CSteamDebugHelperDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // device context for painting + + SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); + + // Center icon in client rectangle + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // Draw the icon + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialog::OnPaint(); + } +} + +// The system calls this to obtain the cursor to display while the user drags +// the minimized window. +HCURSOR CSteamDebugHelperDlg::OnQueryDragIcon() +{ + return (HCURSOR) m_hIcon; +} + + +KeyValues* CSteamDebugHelperDlg::LoadConfigFile() +{ + if ( m_ConfigFilename.GetLength() == 0 ) + return NULL; + + KeyValues *pKV = ::new KeyValues( "" ); + if ( !pKV->LoadFromFile( g_pFileSystem, m_ConfigFilename ) ) + { + Error( "Error parsing %s.", m_ConfigFilename ); + } + + + // Get values from the kv file. + m_pSteamAppCfg = pKV->FindKey( "SteamApp.Cfg" ); + m_pSourceExeDir = pKV->GetString( "SourceExeDir", NULL ); + m_pSteamAppDir = pKV->GetString( "SteamAppDir", NULL ); + if ( !m_pSteamAppCfg || !m_pSourceExeDir || !m_pSteamAppDir ) + Error( "Missing one or more keys in the config file." ); + + // Steam base dir is the app dir but 3 slashes back. + Q_strncpy( m_SteamBaseDir, m_pSteamAppDir, sizeof( m_SteamBaseDir ) ); + for ( int i=0; i < 3; i++ ) + { + char *pSlash = strrchr( m_SteamBaseDir, '/' ); + if ( !pSlash ) + pSlash = strrchr( m_SteamBaseDir, '\\' ); + + if ( !pSlash ) + Error( "SteamAppDir %s invalid.", m_pSteamAppDir ); + else + *pSlash = 0; + } + return pKV; +} + + +void CSteamDebugHelperDlg::OnSetupForDebugging() +{ + char src[512], dest[512]; + KeyValues *pCur; + KeyValues *pKV = LoadConfigFile(); + if ( !pKV ) + return; + + HCURSOR hOldCursor = GetCursor(); + SetCursor( LoadCursor( AfxGetInstanceHandle(), IDC_WAIT ) ); + + // steam.dll + Q_snprintf( src, sizeof( src ), "%s\\steam.dll", m_SteamBaseDir ); + Q_snprintf( dest, sizeof( dest ), "%s\\steam.dll", m_pSteamAppDir ); + CHECK_2STR( CopyFile( src, dest, false ), src, dest ); + + // steam.cfg + Q_snprintf( src, sizeof( src ), "%s\\steam.cfg", m_SteamBaseDir ); + Q_snprintf( dest, sizeof( dest ), "%s\\steam.cfg", m_pSteamAppDir ); + CopyFile( src, dest, false ); + + // now build steamapp.cfg + Q_snprintf( dest, sizeof( dest ), "%s\\SteamApp.cfg", m_pSteamAppDir ); + FILE *fp = fopen( dest, "wt" ); + CHECK( fp ); + for ( pCur=m_pSteamAppCfg->GetFirstValue(); pCur; pCur=pCur->GetNextValue() ) + { + fprintf( fp, "%s\n", pCur->GetString() ); + } + fprintf( fp, "SteamInstallPath=\"%s\"", m_SteamBaseDir ); + fclose( fp ); + + // Now copy each binary up there and make it read-only. + for ( pCur=pKV->GetFirstValue(); pCur; pCur=pCur->GetNextValue() ) + { + const char *pName = pCur->GetName(); + if ( Q_stricmp( pName, "binary" ) == 0 ) + { + Q_snprintf( src, sizeof( src ), "%s\\%s", m_pSourceExeDir, pCur->GetString() ); + Q_snprintf( dest, sizeof( dest ), "%s\\%s", m_pSteamAppDir, pCur->GetString() ); + + if ( _access( dest, 0 ) == 0 ) + { + CHECK_1STR( SetFileAttributes( dest, FILE_ATTRIBUTE_NORMAL ), dest ); + } + + CHECK_2STR( CopyFile( src, dest, false ), src, dest ); + CHECK_1STR( SetFileAttributes( dest, FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_READONLY ), dest ); + } + } + + SetCursor( hOldCursor ); + + MessageBox( "Setup successfully!", MB_OK ); + + //pKV->deleteThis(); // note: leak the memory here knowingly to avoid warnings from the stupid way keyvalues overload memory allocation +} + +void CSteamDebugHelperDlg::OnUnsetupForDebugging() +{ + KeyValues *pKV = LoadConfigFile(); + + char dest[512]; + KeyValues *pCur; + + // Delete the steamapp.cfg, steam.dll, and steam.cfg files. + Q_snprintf( dest, sizeof( dest ), "%s\\steam.dll", m_pSteamAppDir ); + CHECK_1STR( SetFileAttributes( dest, FILE_ATTRIBUTE_NORMAL ), dest ); + CHECK_1STR( DeleteFile( dest ), dest ); + + // steam.cfg + Q_snprintf( dest, sizeof( dest ), "%s\\steam.cfg", m_pSteamAppDir ); + SetFileAttributes( dest, FILE_ATTRIBUTE_NORMAL ); + DeleteFile( dest ); + + // steamapp.cfg + Q_snprintf( dest, sizeof( dest ), "%s\\steamapp.cfg", m_pSteamAppDir ); + CHECK_1STR( SetFileAttributes( dest, FILE_ATTRIBUTE_NORMAL ), dest ); + CHECK_1STR( DeleteFile( dest ), dest ); + + for ( pCur=pKV->GetFirstValue(); pCur; pCur=pCur->GetNextValue() ) + { + const char *pName = pCur->GetName(); + if ( Q_stricmp( pName, "binary" ) == 0 ) + { + Q_snprintf( dest, sizeof( dest ), "%s\\%s", m_pSteamAppDir, pCur->GetString() ); + if ( _access( dest, 0 ) == 0 ) + { + CHECK_1STR( SetFileAttributes( dest, FILE_ATTRIBUTE_NORMAL ), dest ); + + CHECK_1STR( DeleteFile( dest ), dest ); + } + } + } + + MessageBox( "Un-setup successfully!", MB_OK ); + + //pKV->deleteThis(); // note: leak the memory here knowingly to avoid warnings from the stupid way keyvalues overload memory allocation +} + +void CSteamDebugHelperDlg::OnStartSteam() +{ + STARTUPINFO si; + memset( &si, 0, sizeof( si ) ); + si.cb = sizeof( si ); + + PROCESS_INFORMATION pi; + + char dest[512]; + Q_snprintf( dest, sizeof( dest ), "%s\\steam.exe", m_SteamBaseDir ); + CreateProcess( + dest, // app name + NULL, // command line + NULL, // process attr + NULL, // thread attr + false, // inherit handles + 0, // flags + NULL, // environment + m_SteamBaseDir, // cur directory + &si, // startup info + &pi // process info + ); +} + +void CSteamDebugHelperDlg::OnEditConfigFile() +{ + char str[512]; + Q_snprintf( str, sizeof( str ), "notepad \"%s\"", m_ConfigFilename ); + + STARTUPINFO si; + memset( &si, 0, sizeof( si ) ); + si.cb = sizeof( si ); + + PROCESS_INFORMATION pi; + + CreateProcess( + NULL, // app name + str, // command line + NULL, // process attr + NULL, // thread attr + false, // inherit handles + 0, // flags + NULL, // environment + NULL, // cur directory + &si, // startup info + &pi // process info + ); +} + +void CSteamDebugHelperDlg::OnEditChooseConfigFile() +{ + CFileDialog dlg( + true, + "cfg", + NULL, + 0, + "CFG Files (*.cfg)|*.cfg||", + this ); + + if ( dlg.DoModal() == IDOK ) + { + SetConfigFilename( dlg.GetPathName() ); + } +} + +void CSteamDebugHelperDlg::SetConfigFilename( const char *pName ) +{ + char absPath[MAX_PATH]; + MakeAbsolutePath( absPath, sizeof( absPath ), pName ); + + if ( _access( absPath, 0 ) == 0 ) + { + m_ConfigFilename = absPath; + } + else + { + char str[512]; + Q_snprintf( str, sizeof( str ), "%s doesn't exist.", absPath ); + AfxMessageBox( str, MB_OK ); + return; + } + + m_ConfigFilename = absPath; + + const char *pConfigFilename = absPath; + const char *pTest1 = strrchr( pConfigFilename, '\\' ) + 1; + const char *pTest2 = strrchr( pConfigFilename, '/' ) + 1; + const char *pBaseName = max( pTest1, max( pTest2, pConfigFilename ) ); + SetWindowText( CString( "SteamDebugHelper - " ) + pBaseName ); + + ::EnableWindow( ::GetDlgItem( m_hWnd, ID_EDIT_CONFIG_FILE ), true ); + ::EnableWindow( ::GetDlgItem( m_hWnd, ID_SETUP_FOR_DEBUGGING ), true ); + ::EnableWindow( ::GetDlgItem( m_hWnd, ID_UNSETUP_FOR_DEBUGGING ), true ); +} diff --git a/utils/SteamDebugHelper/SteamDebugHelperDlg.h b/utils/SteamDebugHelper/SteamDebugHelperDlg.h new file mode 100644 index 0000000..6ab72d1 --- /dev/null +++ b/utils/SteamDebugHelper/SteamDebugHelperDlg.h @@ -0,0 +1,76 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// SteamDebugHelperDlg.h : header file +// + +#if !defined(AFX_STEAMDEBUGHELPERDLG_H__E56B9648_8997_47D7_BEE1_CA0B572B380B__INCLUDED_) +#define AFX_STEAMDEBUGHELPERDLG_H__E56B9648_8997_47D7_BEE1_CA0B572B380B__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "KeyValues.h" + +///////////////////////////////////////////////////////////////////////////// +// CSteamDebugHelperDlg dialog + +class CSteamDebugHelperDlg : public CDialog +{ +// Construction +public: + CSteamDebugHelperDlg(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CSteamDebugHelperDlg) + enum { IDD = IDD_STEAMDEBUGHELPER_DIALOG }; + // NOTE: the ClassWizard will add data members here + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CSteamDebugHelperDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + + void SetConfigFilename( const char *pName ); + + CString m_ConfigFilename; + KeyValues* LoadConfigFile(); + + + // Extracted from the kv file. + const char *m_pSourceExeDir; + KeyValues *m_pSteamAppCfg; + + const char *m_pSteamAppDir; + char m_SteamBaseDir[512]; + + +// Implementation +protected: + HICON m_hIcon; + + // Generated message map functions + //{{AFX_MSG(CSteamDebugHelperDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + afx_msg void OnSetupForDebugging(); + afx_msg void OnUnsetupForDebugging(); + afx_msg void OnStartSteam(); + afx_msg void OnEditConfigFile(); + afx_msg void OnEditChooseConfigFile(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STEAMDEBUGHELPERDLG_H__E56B9648_8997_47D7_BEE1_CA0B572B380B__INCLUDED_) diff --git a/utils/SteamDebugHelper/res/SteamDebugHelper.ico b/utils/SteamDebugHelper/res/SteamDebugHelper.ico Binary files differnew file mode 100644 index 0000000..7eef0bc --- /dev/null +++ b/utils/SteamDebugHelper/res/SteamDebugHelper.ico diff --git a/utils/SteamDebugHelper/res/SteamDebugHelper.rc2 b/utils/SteamDebugHelper/res/SteamDebugHelper.rc2 new file mode 100644 index 0000000..93479a4 --- /dev/null +++ b/utils/SteamDebugHelper/res/SteamDebugHelper.rc2 @@ -0,0 +1,13 @@ +// +// STEAMDEBUGHELPER.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// diff --git a/utils/SteamDebugHelper/resource.h b/utils/SteamDebugHelper/resource.h new file mode 100644 index 0000000..b2d99e1 --- /dev/null +++ b/utils/SteamDebugHelper/resource.h @@ -0,0 +1,29 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by SteamDebugHelper.rc +// +#define ID_UNSETUP_FOR_DEBUGGING 3 +#define IDD_STEAMDEBUGHELPER_DIALOG 102 +#define IDR_MAINFRAME 128 +#define ID_SETUP_FOR_DEBUGGING 1004 +#define ID_START_STEAM 1005 +#define ID_EDIT_CONFIG_FILE 1006 +#define ID_EDIT_CHOOSE_CONFIG_FILE 1007 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1005 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif |