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/finddbgdll | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'utils/finddbgdll')
| -rw-r--r-- | utils/finddbgdll/finddbgdll.cpp | 64 | ||||
| -rw-r--r-- | utils/finddbgdll/finddbgdll.vpc | 18 |
2 files changed, 82 insertions, 0 deletions
diff --git a/utils/finddbgdll/finddbgdll.cpp b/utils/finddbgdll/finddbgdll.cpp new file mode 100644 index 0000000..9931c8e --- /dev/null +++ b/utils/finddbgdll/finddbgdll.cpp @@ -0,0 +1,64 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Finds debug DLLs +// +// $NoKeywords: $ +//=============================================================================// + +#include "unitlib/unitlib.h" +#include "tier0/dbg.h" +#include "tier1/strtools.h" +#include <stdio.h> +#include <windows.h> + +#pragma warning (disable:4100) + +SpewRetval_t FindDbgDLLSpew( SpewType_t type, char const *pMsg ) +{ + printf( "%s", pMsg ); + OutputDebugString( pMsg ); + return SPEW_CONTINUE; +} + + +/* +============ +main +============ +*/ +int main (int argc, char **argv) +{ + printf( "Valve Software - finddbgdll.exe (%s)\n", __DATE__ ); + + // Install a special Spew handler that ignores all assertions and lets us + // run for as long as possible + SpewOutputFunc( FindDbgDLLSpew ); + + // Very simple... just iterate over all .DLLs in the current directory and call + // LoadLibrary on them; check to see if they define the BuiltDebug symbol. I + + WIN32_FIND_DATA findFileData; + HANDLE hFind = FindFirstFile("*.dll", &findFileData); + + while (hFind != INVALID_HANDLE_VALUE) + { + // Ignore 360 DLLs, can't load them on the PC + if ( !Q_strstr( findFileData.cFileName, "360" ) ) + { + HMODULE hLib = LoadLibrary(findFileData.cFileName); + + if ( GetProcAddress( hLib, "BuiltDebug" ) ) + { + Msg( "Module %s is a debug build\n", findFileData.cFileName ); + } + + FreeLibrary( hLib ); + } + + if (!FindNextFile( hFind, &findFileData )) + break; + } + + return 0; +} + diff --git a/utils/finddbgdll/finddbgdll.vpc b/utils/finddbgdll/finddbgdll.vpc new file mode 100644 index 0000000..a52c862 --- /dev/null +++ b/utils/finddbgdll/finddbgdll.vpc @@ -0,0 +1,18 @@ +//----------------------------------------------------------------------------- +// FINDDBGDLL.VPC +// +// Project Script +//----------------------------------------------------------------------------- + +$Macro SRCDIR "..\.." +$Macro OUTBINDIR "$SRCDIR\..\game\bin" + +$Include "$SRCDIR\vpc_scripts\source_exe_con_base.vpc" + +$Project "Finddbgdll" +{ + $Folder "Source Files" + { + $File "finddbgdll.cpp" + } +} |