diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..990c411 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.dll diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..06b86d2 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,25 @@ + +MIT NO-AI License + +Copyright © 2024 by Igor Levicki + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +Permission is not granted to use this software or any of the associated files +as sample data for the purposes of building machine learning models. + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..411b5ed --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +### SLC + +TL;DR — Code in this repository emulates [SLGetWindowsInformationDWORD](https://learn.microsoft.com/en-us/windows/win32/api/slpublic/nf-slpublic-slgetwindowsinformationdword) API from `SLC.DLL` with a singular purpose — to enable playing original [Microsoft FreeCell](https://en.wikipedia.org/wiki/Microsoft_FreeCell) and [Microsoft Minesweeper](https://en.wikipedia.org/wiki/Microsoft_Minesweeper) games from Microsoft Windows 7 on a modern Microsoft Windows operating systems such as Microsoft Windows 10 and Microsoft Windows 11. + +**DISCLAIIMER:** + +This code was written for educational purposes only, with a sole goal of gaming history preservation. + +It can only be used to bypass the enablement check for those two specific games which must be acquired legally (i.e. you must own a valid Microsoft Windows 7 product key and installation media). + +It is provided as a way to avoid having to run fully virtualized Microsoft Windows 7 operating system in order to run those games today. + +The author does not condone licensing circumvention nor piracy and cannot be held responsbile for your eventual misuse of their code. + +By obtaining and compiling this code or by downloading prebuilt DLLs from the Releases page you are taking full responsibility for your own actions. + +Microsoft Windows is a trademark of Microsoft Corporation. diff --git a/slc.c b/slc.c new file mode 100644 index 0000000..c888517 --- /dev/null +++ b/slc.c @@ -0,0 +1,35 @@ +// +// slc.c +// © 2024 by Igor Levicki. All Rights Reserved. +// +// Compile: +// cl /nologo /c /O2 /Ob1 slc.c +// +// Link: +// link /nologo /DLL /ENTRY:DllMain /DEF:slc.def /MACHINE:X64 /SUBSYSTEM:WINDOWS /NODEFAULTLIB /NOEXP /NOIMPLIB /DEBUG:NONE /EMITPOGOPHASEINFO /MERGE:.rdata=.text slc.obj kernel32.lib +// + +#include + +HRESULT __stdcall SLGetWindowsInformationDWORD(LPCWSTR ValueName, LPDWORD Value) +{ + + if (lstrcmpiW(L"Shell-InBoxGames-FreeCell-EnableGame", ValueName) == 0) { + *Value = 1; + } else if (lstrcmpiW(L"Shell-InBoxGames-Minesweeper-EnableGame", ValueName) == 0) { + *Value = 1; + } else { + *Value = 0; + } + + return S_OK; +} + +DWORD __stdcall DllMain(HINSTANCE hModule, DWORD dwReason, DWORD dwReserved) +{ + if (dwReason == DLL_PROCESS_ATTACH) { + DisableThreadLibraryCalls(hModule); + } + + return TRUE; +} diff --git a/slc.def b/slc.def new file mode 100644 index 0000000..f221b59 --- /dev/null +++ b/slc.def @@ -0,0 +1,3 @@ +LIBRARY SLC +EXPORTS +SLGetWindowsInformationDWORD