Skip to content

Commit

Permalink
Merge branch 'SteamDatabase:main' into IQA
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHinrichs authored Mar 23, 2024
2 parents 6cd86e1 + 9cef589 commit 160dafb
Show file tree
Hide file tree
Showing 27 changed files with 199 additions and 61 deletions.
4 changes: 0 additions & 4 deletions KNOWN_UNDETECTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ It is possible to package a GameMaker game as a standalone executable with no su

Godot games can also be packaged as standalone executables with no external asset files.

### GDevelop

GDevelop also doesn't have any non-generic files, so detection is kind of impossible.

### Stencyl

Stencyl games don't always have recognizable files so it may not give any signal on it's own.
Expand Down
1 change: 1 addition & 0 deletions descriptions/Engine.CatSystem2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[**CatSystem2**](https://cs2.suki.jp/) is a common game engine used in games published by Wooden Look.
1 change: 1 addition & 0 deletions descriptions/Engine.Eclipse_Engine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[**Eclipse Engine**](https://en.wikipedia.org/wiki/Digital_Eclipse#Eclipse_Engine) is the [Digital Eclipse's](https://www.digitaleclipse.com/) in-house engine.
1 change: 1 addition & 0 deletions descriptions/Engine.GDevelop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[**GDevelop**](https://gdevelop.io/) is a free and open-source, cross-platform 2D/3D game-making app designed to be used by anyone, with no prior programming knowledge required.
1 change: 1 addition & 0 deletions descriptions/Engine.GlyphX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**GlyphX** is [**Petroglyph Games'**](https://petroglyphgames.com/) in-house engine.
3 changes: 2 additions & 1 deletion descriptions/Engine.Torque.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
[**Torque Game Engine**](https://torque3d.org/torque3d/) is an open-source cross-platform 3D game engine, originally developed by GarageGames and actively maintained under the current versions Torque 3D as well as Torque 2D.
Torque covers a series of both proprietary and open-source cross-platform 3D game engines, originally developed by GarageGames and actively maintained under the current versions [**Torque 3D**](https://torque3d.org/torque3d/) and [**Torque 2D**](https://torque3d.org/torque2d/).
The original proprietary engines were never open-sourced except for later versions of Torque 3D and Torque 2D.
1 change: 1 addition & 0 deletions descriptions/Launcher.Paradox_Launcher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Paradox Launcher** is the launcher bundled with [Paradox Interactive's](https://www.paradoxinteractive.com/our-games/discover) games.
1 change: 1 addition & 0 deletions descriptions/SDK.Game_Development_Kit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The [**Microsoft Game Development Kit (GDK)**](https://learn.microsoft.com/en-us/gaming/gdk/) is a complete set of tools, APIs, extensions, and programing models that can be used across current and future Microsoft Gaming platforms and initiatives.
1 change: 1 addition & 0 deletions descriptions/SDK.NVIDIA_Streamline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[**Streamline**](https://developer.nvidia.com/rtx/streamline) is an open-sourced cross hardware vendor solution that simplifies integration of the latest NVIDIA and other manufacturers’ super resolution technologies into applications and games.
1 change: 1 addition & 0 deletions descriptions/SDK.V8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[**V8**](https://v8.dev/) is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
18 changes: 15 additions & 3 deletions rules.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RIM = \.rim$ ; BioWare
RPF = \.rpf$ ; RAGE
SCR = \.scr$ ; SCI
SIERRA_EXE = (?:^|/)SIERRA\.EXE$ ; SCI
SND_OGG = (?:^|/)snd_.+\.ogg$ ; GameMaker
SND_OGG = (?:^|/)snd?_.+\.ogg$ ; GameMaker
TAB = \.tab$ ; Apex Engine
TGA = \.tga$ ; BioWare
TLK = \.tlk$ ; BioWare
Expand All @@ -48,6 +48,7 @@ BlenderGameEngine[] = (?:^|/)blenderplayer\.exe$
Blitz3D = \.b3d$
Build = (?:^|/)buildlic\.txt$
C4_Engine = (?:^|/)Data/C4(?:\.pak)?$
CatSystem2 = ^cs2confx?\.dll$
ChromeEngine[] = (?:^|/)ChromEd\.exe$
ChromeEngine[] = (?:^|/)ChromeEngine[0-9]\.dll$
ChromeEngine[] = (?:^|/)engine(?:_pc)?\.rpack$
Expand All @@ -64,6 +65,8 @@ CryEngine[] = (?:^|/)CryRenderVulkan\.dll$
Danmakufu = (?:^|/)th_dnh\.def$
Defold = (?:^|/)game\.dmanifest$
Diesel = ^dieselx\.cfg$
Eclipse_Engine[] = ^data\.pie$
Eclipse_Engine[] = ^Bundle/bundleMain\.mbundle$
EngineX = ^(?:_bin_PC/BuildData|data)/FILELIST.BIN$
Essence_Engine = \.sga$
Fase = ^faseEngine\.dll$
Expand All @@ -86,8 +89,12 @@ GameMaker[] = (?:^|/)gm7zip\.dll$
GameMaker[] = (?:^|/)GMXInput\.dll$
GameMaker[] = \.gm(?:spr|bck)$
GameMaker[] = (?:^|/)gmsched\.dll$
GDevelop[] = (?:^|/)LICENSE\.GDevelop\.txt$
GDevelop[] = (?:^|/)gdjs-evtsext__
GDevelop[] = (?:^|/)GDCpp\.dll$
Gideros = gideros
Glacier = \.rpkg$
GlyphX = ^ClientLauncherG(?:64)?\.exe$
Godot[] = (?:^|/)project\.godot$ ; Extra detections are in IsEngineGodot
Godot[] = (?:^|/)(?:lib)?godotsteam
Godot[] = (?:^|/)(?:lib)?steamsdk-godot
Expand Down Expand Up @@ -144,7 +151,7 @@ RPG_Developer_Bakin = (?:^|/)bakinengine\.dll$
S2_Engine_HD = (?:^|/)S2Core\.dll$
SakanaGL[] = (?:^|/)sakanagl\.dll$
SakanaGL[] = \.sxstorage$
Serious_Engine = (?:^|/)(?:00_)?All\.gro$
Serious_Engine = (?:All|01|patch)\.gro$
ShiVa3D = \.stk$
Silk = ^packs/sli\.spk$
SmileGameBuilder = (?:^|/)data\.sgbpack$
Expand All @@ -161,7 +168,8 @@ Torque = \.cs\.dso$
TyranoBuilder = (?:^|/)tyrano\.js$
UbiArtFramework = pc(?:32)?\.ipk$
UbisoftAnvil = (?:^|/)(?:datapc(?:64)?|gamedatapc_00)\.forge$
Unigine = (?:^|/)(?:|lib)Unigine_x(?:86|64)\.(?:dylib|dll|so)$
Unigine[] = (?:^|/)Unigine_x(?:86|64)\.dll$
Unigine[] = (?:^|/)core\.ung$
Unity[] = (?:^|/)Unity(?:Engine|Player)\.(?:dylib|dll)$
Unity[] = (?:^|/)globalgamemanagers\.assets$
Unreal[] = (?:^|/)Binaries/Win(?:32|64)/
Expand Down Expand Up @@ -229,6 +237,7 @@ EpicOnlineServices = (?:^|/)(?:lib)?eossdk
FluidSynth = fluidsynth
FMOD = (?:^|/)(?:lib)?fmod(?:l|ex|exl|studio|studiol)?(?:64)?\.(?:dylib|dll|so)$
FreeImage = (?:^|/)FreeImage(?:\.so|\.dll)$
Game_Development_Kit = (?:^|/)(?:XGamingRuntime(?:Thunks)?|XCurl|Microsoft_Xbox_Services_141_GDK_C_Thunks)\.dll$
Granny_3D = (?:^|/)granny2(?:_x64)?\.dll$
Greenworks = (?:^|/)greenworks-(?:win|osx|linux)(?:32|64)?\.node$
iCue[] = cgsdk
Expand Down Expand Up @@ -258,6 +267,7 @@ NVIDIA_Real-Time_Denoisers = (?:^|/)(?:sl\.)?NRD\.dll$
NVIDIA_Reflex[] = (?:^|/)nvlowlatencyvk\.dll$
NVIDIA_Reflex[] = (?:^|/)GfxPluginNVIDIAReflex\.dll$
NVIDIA_Reflex[] = (?:^|/)sl\.reflex\.dll$
NVIDIA_Streamline = (?:^|/)sl\.common\.dll$
NVIDIA_Texture_Tools = (?:^|/)nvtt(?:_64)?\.dll$
NVIDIA_TXAA = (?:^|/)GFSDK_TXAA
NWJS = (?:^|/)nw\.(?:dll|pak)$
Expand Down Expand Up @@ -295,6 +305,7 @@ UnityEntities[] = (?:^|/)StreamingAssets/SubScenes/
UnityHDRP = (?:^|/)Unity\.RenderPipelines\.HighDefinition\.(?:Config\.Runtime|Runtime)\.dll$
UnityHybridRenderer = (?:^|/)Unity\.Rendering\.Hybrid\.dll$
UnityURP = (?:^|/)Unity\.RenderPipelines\.Universal\.Runtime\.dll$
V8 = (?:^|/)v8\.dll$
Vivox[] = (?:^|/)ortp\.dll$
Vivox[] = vivox
Vorbis = vorbis
Expand All @@ -307,6 +318,7 @@ EA_App = (?:^|/)EAappInstaller\.exe$
Gaijin = (?:^|/)gaijin_downloader\.exe$
Glyph = ^GlyphClient\.cfg$
MyGames = ^(?:GameCenter)?_chromeresources
Paradox_Launcher = (?:^|/)dowser\.exe$
Rockstar = (?:^|/)Rockstar-Games-Launcher\.exe$
Ubisoft[] = (?:^|/)UbisoftConnectInstaller\.exe$
Ubisoft[] = (?:^|/)UplayInstaller\.exe$
Expand Down
77 changes: 45 additions & 32 deletions tests/FileDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,17 @@ private static function TryDeduceEngine( array $Files, array $Matches ) : ?strin
//If we have both BIF and TLK files it's probably a BioWare Engine
if( $count( [ 'Evidence.BIF', 'Evidence.TLK' ] ) > 1 )
{
if( $has('Evidence.RIM') || $has('Evidence.TGA') )
if( $has( 'Evidence.RIM' ) || $has( 'Evidence.TGA' ) )
{
//RIM and TGA are found in Aurora but not in Infinity
return 'Engine.Aurora';
}

return 'Engine.Infinity';
}

//Any 2 of options.ini + data.win + snd_<whatever>.ogg is a good sign of a GameMaker Game
if( $count( [ 'Evidence.OPTIONS_INI', 'Evidence.DATA_WIN', 'Evidence.SND_OGG' ] ) > 1)
if( $count( [ 'Evidence.OPTIONS_INI', 'Evidence.DATA_WIN', 'Evidence.SND_OGG' ] ) > 1 )
{
return 'Engine.GameMaker';
}
Expand All @@ -252,7 +253,7 @@ private static function TryDeduceEngine( array $Files, array $Matches ) : ?strin
}

//If I have a PCK file it might be Godot
if( $has( 'Evidence.PCK' ) && $count(['Engine.Unreal', 'Engine.idTech5', 'Engine.idTech6', 'Engine.idTech7', 'Emulator.DOSBOX']) == 0 && self::IsEngineGodot( $Files ) )
if( $has( 'Evidence.PCK' ) && self::IsEngineGodot( $Files ) )
{
return 'Engine.Godot';
}
Expand All @@ -275,60 +276,72 @@ private static function IsEngineGodot( array $Files ) : bool
//1. A single .pck file named exactly "data.pck", and NO other pck files
//2. For every executable, a correspondingly named pck file, and no other pck files

$swapExtension = static fn( string $FileName, string $OldExtension, string $NewExtension ) : string => basename( $FileName, $OldExtension ) . $NewExtension;
$Pcks = [];
$Exes = [];

$ExecutableExtensions =
[
'EXE' => true, // Windows
'X86' => true, // 32-bit Linux in Godot 2.x/3.x
'X86_32' => true, // 32-bit Linux in Godot 4.x
'X86_64' => true, // 64-bit Linux in all versions
];

foreach( $Files as $File )
{
$Extension = strtolower( pathinfo( $File, PATHINFO_EXTENSION ) );
$BaseFile = basename( $File );
$Extension = pathinfo( $File, PATHINFO_EXTENSION );
$Extension = strtoupper( $Extension );

if( $Extension === 'pck' )
{
$Pcks[ $BaseFile ] = true;
}
if( $Extension === 'exe' )
{
$Exes[ $swapExtension( $BaseFile, ".exe", ".pck" ) ] = true;
}
else if( $Extension === 'x86' ) // 32-bit Linux in Godot 2.x/3.x
if( $Extension === 'PCK' )
{
$Exes[ $swapExtension( $BaseFile, ".x86", ".pck" ) ] = true;
$Pcks[] = $File;
continue;
}
else if( $Extension === 'x86_32' ) // 32-bit Linux in Godot 4.x
{
$Exes[ $swapExtension( $BaseFile, ".x86_32", ".pck" ) ] = true;
}
else if( $Extension === 'x86_64' ) // 64-bit Linux in all versions

// Mac and Linux can have extension-less executables
if( empty( $Extension ) )
{
$Exes[ $swapExtension( $BaseFile, ".x86_64", ".pck" ) ] = true;
if( str_ends_with( dirname( $File ), '/MacOS' ) )
{
// Mac executable is not in the same folder, let's pretend they are in the same folder
$File = str_replace( '/MacOS/', '/Resources/', $File );
}

$Exes[ $File . '.pck' ] = true;
}
else
else if( isset( $ExecutableExtensions[ $Extension ] ) )
{
//Mac and Linux can have extensionless executables, make sure we don't have folders in the mix, just filenames though
$Exes[ $BaseFile . ".pck" ] = true;
// Strip extension from the file path
$File = substr( $File, 0, -strlen( $Extension ) );

$Exes[ $File . 'pck' ] = true;
}
}

// This can happen if Evidence.PCK finds "BASE.PCK", but the $Pcks will be empty due to case sensitivity
if( !empty( $Pcks ) )
{
//If we have exactly 1 PCK file and it is data.pck, we can skip all the fancy checks
if( count( $Pcks ) === 1 && array_key_first( $Pcks ) === 'data.pck' )
{
return true;
}
$OnlyDataPck = true;

//Otherwise we have to match up exe & pck pairs
foreach ( array_keys( $Pcks ) as $pck )
foreach( $Pcks as $Pck )
{
if( basename( $Pck ) !== 'data.pck' )
{
$OnlyDataPck = false;
}

//If we match an exe and a pck file pair, we're good
if( isset( $Exes[ $pck ] ) )
if( isset( $Exes[ $Pck ] ) )
{
return true;
}
}

if( $OnlyDataPck )
{
return true;
}
}

return false;
Expand Down
30 changes: 30 additions & 0 deletions tests/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
TestBasicRules( $Detector, $SeenTestTypes, $FailingTests );
TestFilelists( $Detector, $SeenTestTypes, $FailingTests );
TestDescriptions( $SeenTestTypes, $FailingTests );
TestExtra( $Detector, $FailingTests );

// Really basic code to find extra detections that aren't specified in rules.ini
$Code = file_get_contents( __DIR__ . '/FileDetector.php' );
Expand Down Expand Up @@ -317,6 +318,35 @@ function TestFilelists( FileDetector $Detector, array &$SeenTestTypes, array &$F
}
}

function TestExtra( FileDetector $Detector, array &$FailingTests ) : void
{
$GodotTests =
[
[
'Game.exe',
'Sound/Game.pck',
],
[
'Folder/Game',
'Sound/Game.pck',
],
[
'Folder/Game.exe',
'Game.pck',
],
];

foreach( $GodotTests as $Files )
{
$Matches = $Detector->GetMatchesForFileList( $Files );

if( count( $Matches ) !== 1 || !isset( $Matches[ 'Evidence.PCK' ] ) )
{
$FailingTests[] = "Incorrectly matched Godot";
}
}
}

function err( string $Message ) : void
{
if( getenv( 'CI' ) !== false )
Expand Down
2 changes: 2 additions & 0 deletions tests/filelists/Engine.Godot.TestLinuxNoExt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Folder/MyGame
Folder/MyGame.pck
7 changes: 7 additions & 0 deletions tests/filelists/Engine.Godot.TestMultipleData.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MyGame.exe
data.pck
MyGame.app/Contents/MacOS/MyGame
MyGame.app/Contents/PkgInfo
MyGame.app/Contents/Resources
MyGame.app/Contents/Resources/icon.icns
MyGame.app/Contents/Resources/data.pck
2 changes: 2 additions & 0 deletions tests/types/Engine.CatSystem2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cs2conf.dll
cs2confx.dll
2 changes: 2 additions & 0 deletions tests/types/Engine.Eclipse_Engine.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Bundle/bundleMain.mbundle
data.pie
10 changes: 10 additions & 0 deletions tests/types/Engine.GDevelop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/GDCpp.dll
/LICENSE.GDevelop.txt
/gdjs-evtsext__
GDCpp.dll
LICENSE.GDevelop.txt
gdjs-evtsext__
gdjs-evtsext__achievements__unlockachievement-func.js
gdjs-evtsext__camerashake__camerashake-func.js
resources/app/app/gdjs-evtsext__achievements__unlockachievement-func.js
resources/app/app/gdjs-evtsext__camerashake__camerashake-func.js
2 changes: 2 additions & 0 deletions tests/types/Engine.GlyphX.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ClientLauncherG.exe
ClientLauncherG64.exe
5 changes: 5 additions & 0 deletions tests/types/Engine.Serious_Engine.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/00_All.gro
/All.gro
00_All.gro
01.gro
1_04_patch.gro
All.gro
Content/SeriousSam2017/00_All.gro
Content/SeriousSam3/All_01.gro
Content/SeriousSamHD/All.gro
Content/SeriousSamTLH/All_01.gro
patch.gro
24 changes: 3 additions & 21 deletions tests/types/Engine.Unigine.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
/core.ung
/Unigine_x64.dll
/Unigine_x64.dylib
/Unigine_x64.so
/Unigine_x86.dll
/Unigine_x86.dylib
/Unigine_x86.so
/libUnigine_x64.dll
/libUnigine_x64.dylib
/libUnigine_x64.so
/libUnigine_x86.dll
/libUnigine_x86.dylib
/libUnigine_x86.so
core.ung
data/core.ung
Unigine_x64.dll
Unigine_x64.dylib
Unigine_x64.so
Unigine_x86.dll
Unigine_x86.dylib
Unigine_x86.so
bin/Unigine_x64.dll
bin/Unigine_x86.dll
bin/libUnigine_x64.so
libUnigine_x64.dll
libUnigine_x64.dylib
libUnigine_x64.so
libUnigine_x86.dll
libUnigine_x86.dylib
libUnigine_x86.so
8 changes: 8 additions & 0 deletions tests/types/Evidence.SND_OGG.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
/sn_@.ogg
/sn_@@.ogg
/snd_@.ogg
/snd_@@.ogg
sn_@.ogg
sn_@@.ogg
sn_a.ogg
sn_whatever.ogg
snd_@.ogg
snd_@@.ogg
snd_a.ogg
snd_whatever.ogg
sub/folder/sn_a.ogg
sub/folder/sn_whatever.ogg
sub/folder/snd_a.ogg
sub/folder/snd_whatever.ogg
2 changes: 2 additions & 0 deletions tests/types/Launcher.Paradox_Launcher.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dowser.exe
dowser.exe
Loading

0 comments on commit 160dafb

Please sign in to comment.