From 35640b9b6cd45365af1b96274b7ab995e71157d6 Mon Sep 17 00:00:00 2001 From: Brady McDermott Date: Wed, 24 Jul 2024 22:00:01 -0600 Subject: [PATCH] Oh Yeah Yeah --- CscdCfg/CscdCfg.vcxproj | 4 ++++ CscdCom/build.cmd | 3 +++ CscdCom/error.dll | Bin 0 -> 1536 bytes CscdCom/readme.txt | 4 +++- CscdSvc/CscdSvc.vcxproj | 4 ++++ CscdSvc/hook.c | 5 +++++ 6 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 CscdCom/build.cmd create mode 100644 CscdCom/error.dll diff --git a/CscdCfg/CscdCfg.vcxproj b/CscdCfg/CscdCfg.vcxproj index 5e8f7cc..b3339e7 100644 --- a/CscdCfg/CscdCfg.vcxproj +++ b/CscdCfg/CscdCfg.vcxproj @@ -93,6 +93,7 @@ true WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true + MultiThreadedDebug Console @@ -109,6 +110,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true + MultiThreaded Console @@ -125,6 +127,7 @@ true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true + MultiThreadedDebug Console @@ -141,6 +144,7 @@ true NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true + MultiThreaded Console diff --git a/CscdCom/build.cmd b/CscdCom/build.cmd new file mode 100644 index 0000000..3332d90 --- /dev/null +++ b/CscdCom/build.cmd @@ -0,0 +1,3 @@ +mc -U error.mc +rc -r error.rc +link -dll -noentry -out:error.dll error.res \ No newline at end of file diff --git a/CscdCom/error.dll b/CscdCom/error.dll new file mode 100644 index 0000000000000000000000000000000000000000..5244b03de654a44bebfdfeb08ccce1d3deef45bd GIT binary patch literal 1536 zcmeHG%}N4M6#izCKxL$53!`fo)J9C)1_lKNMV75vIXb3>&cyh$a3O-w%AiN6U5gei zT1cy2z&8kbh2Frl(MD+HxpU^6@4NSYbMDU^U)*5{fRB7M0tOV>Qu6)x>yf%c z>#rfa_=k~!ax{#bmn(H~ZCfQ|R;MvP~5y^(V%v>mD8+t{tp&#q7FW zAS`PWl<>IkdqglLA58XCBd$uGB;6#9U!@#fYQLGYF1MaAVIDum(Uw(h)C|I`#hMP^ zZnuqmiS-1Kqaf>y#&;-1P5_xHmtbyT|G5JSg7i5$$FBFQ3g`#nUuK5)`+zj{xo78{ z2RToH`o>OIf$p4wJ(zU-McC9Va)B~*)G1mhP;1JbA`D`-u!#h=5rc-nPw@qwdk4M% D4jNfM literal 0 HcmV?d00001 diff --git a/CscdCom/readme.txt b/CscdCom/readme.txt index 1cc9ada..02aa057 100644 --- a/CscdCom/readme.txt +++ b/CscdCom/readme.txt @@ -6,4 +6,6 @@ For information relating to the error files, see: https://learn.microsoft.com/en-us/windows/win3 2/services/the-complete-service-sample -under "Building the Service." \ No newline at end of file +under "Building the Service." + +Run build.cmd to build the error message DLL and files \ No newline at end of file diff --git a/CscdSvc/CscdSvc.vcxproj b/CscdSvc/CscdSvc.vcxproj index 303cb32..8635f70 100644 --- a/CscdSvc/CscdSvc.vcxproj +++ b/CscdSvc/CscdSvc.vcxproj @@ -93,6 +93,7 @@ true WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true + MultiThreadedDebug Console @@ -109,6 +110,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true + MultiThreaded Console @@ -125,6 +127,7 @@ true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true + MultiThreadedDebug Console @@ -141,6 +144,7 @@ true NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true + MultiThreaded Console diff --git a/CscdSvc/hook.c b/CscdSvc/hook.c index 2eb5b96..528270c 100644 --- a/CscdSvc/hook.c +++ b/CscdSvc/hook.c @@ -40,8 +40,12 @@ __declspec(dllexport) BOOL CALLBACK InstallUserHook() WCHAR szFullPath[MAX_PATH]; USERAPIHOOKINFO uah; + MessageBox(NULL, L"test", L"InstallUserHook called", MB_OK); OutputDebugString(L"InstallUserHook called\n"); + // Get the module + g_hModule = GetModuleHandle(NULL); + // Get our current directory and filename GetModuleFileName(g_hModule, szFullPath, ARRAYSIZE(szFullPath)); @@ -150,6 +154,7 @@ __declspec(dllexport) BOOL CALLBACK InitUserHook(UAPIHK State, PUSERAPIHOOK puah \* * * */ __declspec(dllexport) BOOL CALLBACK RemoveUserHook(VOID) { + MessageBox(NULL, L"test", L"RemoveUserHook called", MB_OK); return UnregisterUserApiHookDelay(); }