support comments in Libraries.txt

This commit is contained in:
Xpl0itR 2023-01-17 11:15:03 +00:00
parent a6131ef9ce
commit 2935e88ed9
Signed by: Xpl0itR
GPG Key ID: 91798184109676AD
2 changed files with 4 additions and 1 deletions

View File

@ -6,7 +6,7 @@ Usage
----- -----
Rename VersionShim.dll to `version.dll` and place it in the target application's search location, Rename VersionShim.dll to `version.dll` and place it in the target application's search location,
then create a file named `Libraries.txt` in the same directory and list the paths to all the libraries you'd like to load, then create a file named `Libraries.txt` in the same directory and list the paths to all the libraries you'd like to load,
each on a new line. each on a new line. Lines beginning with `#` will be skipped.
Libraries.txt *MUST* use CRLF line endings and be encoded in UTF-8 with *no* BOM. Libraries.txt *MUST* use CRLF line endings and be encoded in UTF-8 with *no* BOM.

View File

@ -46,6 +46,9 @@ BOOL APIENTRY DllMain(const HMODULE hModule, const DWORD fdwReason, LPCVOID lpRe
{ {
charsInLine = TerminateLineCrlf(line); charsInLine = TerminateLineCrlf(line);
if (*line == '#')
continue;
if (!LoadLibraryA(line)) if (!LoadLibraryA(line))
{ {
MessageBoxA(NULL, line, PROJECT_NAME" - Failed to load library", ErrBoxType); MessageBoxA(NULL, line, PROJECT_NAME" - Failed to load library", ErrBoxType);