From ad610421edaed2a1f8e93f3e931b28a10bb7f972 Mon Sep 17 00:00:00 2001 From: Seemann Date: Sat, 10 Jan 2026 11:45:40 -0500 Subject: [PATCH 1/2] Prevent loading of ASI plugins with the same file name --- vorbisFile.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/vorbisFile.cpp b/vorbisFile.cpp index 2b3862d..e4efca2 100644 --- a/vorbisFile.cpp +++ b/vorbisFile.cpp @@ -59,6 +59,21 @@ __declspec(dllexport, naked) int ov_time_seek_page(void* vf, double pos) } +void ShowErrorAndExit(const char * format, ...) +{ + char buffer[4096]; + + va_list vl; + va_start(vl, format); + + _vsnprintf_s(buffer, _countof(buffer), _TRUNCATE, format, vl); + + MessageBoxA(NULL, buffer, "Silent ASI loader error", MB_OK); + ExitProcess(NULL); + + va_end(vl); +} + struct ExcludedEntry { char* entry; ExcludedEntry* prev; @@ -275,8 +290,23 @@ void LoadPlugins() } } + // Prevent loading of ASI plugins with the same file name + for (auto& plugin : pluginsToBeLoaded) + { + for (auto& plugin2 : pluginsToBeLoaded) + { + if (&plugin != &plugin2 && !_stricmp(plugin.pluginFilename.c_str(), plugin2.pluginFilename.c_str())) + ShowErrorAndExit("An ASI with name %s exists in more than one directory.\n\nDirectories:\n%s\n%s", + plugin.pluginFilename.c_str(), + plugin.dirPath.c_str(), plugin2.dirPath.c_str() + ); + } + } + // Load ASI plugins - std::sort(pluginsToBeLoaded.begin(), pluginsToBeLoaded.end(), [](tPluginToBeLoaded& a, tPluginToBeLoaded& b) { return a.pluginFilename < b.pluginFilename; }); + std::sort(pluginsToBeLoaded.begin(), pluginsToBeLoaded.end(), [](tPluginToBeLoaded& a, tPluginToBeLoaded& b) { + return _stricmp(a.pluginFilename.c_str(), b.pluginFilename.c_str()) < 0; + }); for (auto& plugin : pluginsToBeLoaded) { @@ -285,6 +315,9 @@ void LoadPlugins() // MessageBoxA(NULL, pluginPath, "Test", MB_OK); LoadLibraryA(pluginPath); } + + // Use if debugging + // ExitProcess(NULL); } // Unprotect the module NOW (CLEO 4.1.1.30f crash fix) From 1b6b8bd4b546092b6012b974b864383d717b7d93 Mon Sep 17 00:00:00 2001 From: Seemann Date: Sat, 10 Jan 2026 11:47:59 -0500 Subject: [PATCH 2/2] fix ci build --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60317fe..9a10682 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" cl -c /GS- /GF /O2 vorbisFile.cpp - link /dll /nodefaultlib /entry:_DllMainCRTStartup@12 vorbisFile.obj Kernel32.lib LIBCMT.LIB libvcruntime.lib libucrt.lib libcpmt.lib + link /dll /nodefaultlib /entry:_DllMainCRTStartup@12 vorbisFile.obj Kernel32.lib User32.lib LIBCMT.LIB libvcruntime.lib libucrt.lib libcpmt.lib - name: Upload artifact uses: actions/upload-artifact@v6 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e030573..3df0e88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" cl -c /GS- /GF /O2 vorbisFile.cpp - link /dll /nodefaultlib /entry:_DllMainCRTStartup@12 vorbisFile.obj Kernel32.lib LIBCMT.LIB libvcruntime.lib libucrt.lib libcpmt.lib + link /dll /nodefaultlib /entry:_DllMainCRTStartup@12 vorbisFile.obj Kernel32.lib User32.lib LIBCMT.LIB libvcruntime.lib libucrt.lib libcpmt.lib - name: Create Release uses: ncipollo/release-action@main