diff --git a/CHANGELOG.md b/CHANGELOG.md index 11867785..f1422699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). - fixed issue creating shortcuts introduced in a recent build [#1471](https://github.com/sandboxie-plus/Sandboxie/issues/1471) - fixed access issues in privacy enhanced boxes +### Removed +- removed obsolete SkyNetRootKit detection from 32 bit build + + ## [1.0.5 / 5.55.5] - 2021-12-25 diff --git a/Sandboxie/apps/com/BITS/bits.c b/Sandboxie/apps/com/BITS/bits.c index f455d22b..4099889e 100644 --- a/Sandboxie/apps/com/BITS/bits.c +++ b/Sandboxie/apps/com/BITS/bits.c @@ -129,8 +129,6 @@ int __stdcall WinMain( Check_Windows_7(); - SetupExceptionHandler(); - HOOK_WIN32(CoImpersonateClient); HOOK_WIN32(LogonUserW); diff --git a/Sandboxie/apps/com/Crypto/crypto.c b/Sandboxie/apps/com/Crypto/crypto.c index d1cba02d..2d7bad9d 100644 --- a/Sandboxie/apps/com/Crypto/crypto.c +++ b/Sandboxie/apps/com/Crypto/crypto.c @@ -204,8 +204,6 @@ int __stdcall WinMain( Check_Windows_7(); - SetupExceptionHandler(); - HOOK_WIN32(DuplicateHandle); HOOK_WIN32(CreateFileW); diff --git a/Sandboxie/apps/com/DcomLaunch/dcomlaunch.c b/Sandboxie/apps/com/DcomLaunch/dcomlaunch.c index bab92885..f5902938 100644 --- a/Sandboxie/apps/com/DcomLaunch/dcomlaunch.c +++ b/Sandboxie/apps/com/DcomLaunch/dcomlaunch.c @@ -127,8 +127,6 @@ int __stdcall WinMain( BOOL ok; HANDLE hThreadEvent; - SetupExceptionHandler(); - Check_Windows_7(); // pretend we are the SCM diff --git a/Sandboxie/apps/com/RpcSs/linger.c b/Sandboxie/apps/com/RpcSs/linger.c index 604fe9a5..49f60556 100644 --- a/Sandboxie/apps/com/RpcSs/linger.c +++ b/Sandboxie/apps/com/RpcSs/linger.c @@ -102,8 +102,8 @@ void RemovePid(ULONG myPid) { MONITOR_PID monitorPid; if (map_take(&pidMap, (void*)myPid, &monitorPid, sizeof(monitorPid))) { - CloseHandle(monitorPid.hProcHandle); UnregisterWait(monitorPid.hProcWait); + CloseHandle(monitorPid.hProcHandle); } } diff --git a/Sandboxie/apps/com/RpcSs/rpcss.c b/Sandboxie/apps/com/RpcSs/rpcss.c index 02ca8ecc..5f9f7e51 100644 --- a/Sandboxie/apps/com/RpcSs/rpcss.c +++ b/Sandboxie/apps/com/RpcSs/rpcss.c @@ -399,8 +399,6 @@ _FX int __stdcall WinMain( return STATUS_LICENSE_QUOTA_EXCEEDED; } - SetupExceptionHandler(); - if (1) { ULONG idThread; HANDLE hThread = CreateThread( diff --git a/Sandboxie/apps/com/WUAU/wuau.c b/Sandboxie/apps/com/WUAU/wuau.c index 0f6d56be..4960a2c5 100644 --- a/Sandboxie/apps/com/WUAU/wuau.c +++ b/Sandboxie/apps/com/WUAU/wuau.c @@ -198,8 +198,6 @@ int __stdcall WinMain( Check_Windows_7(); - SetupExceptionHandler(); - HOOK_WIN32(CreateProcessW); memzero(&osvi, sizeof(OSVERSIONINFO)); diff --git a/Sandboxie/apps/com/common.h b/Sandboxie/apps/com/common.h index 7de137a8..8ab3f638 100644 --- a/Sandboxie/apps/com/common.h +++ b/Sandboxie/apps/com/common.h @@ -806,71 +806,6 @@ BOOL Service_Start_ServiceMain(WCHAR *SvcName, const WCHAR *SvcDllName, const UC } -//--------------------------------------------------------------------------- -// VectoredExceptionHandler -//--------------------------------------------------------------------------- - - -_FX LONG VectoredExceptionHandler(EXCEPTION_POINTERS *ExceptionInfo) -{ - static ULONG LastExcCode = -1; - WCHAR txt[256]; - - // - // SkyNetRootKit crashes SandboxieRpcSs with an exception address - // beyond user space, so indicate this special condition - // - - if (LastExcCode != ExceptionInfo->ExceptionRecord->ExceptionCode) { - - ULONG_PTR ExceptionAddress = - (ULONG_PTR)ExceptionInfo->ExceptionRecord->ExceptionAddress; - - LastExcCode = ExceptionInfo->ExceptionRecord->ExceptionCode; - - if ((ExceptionAddress & 0xF0000000) >= 0x80000000) { - - swprintf(txt, L"%s (%08X)", ServiceTitle, LastExcCode); - SbieApi_Log(2204, txt); - - wsprintf(txt, - L"SBIE2398 Service suffers exception %08X at address %08X." - L" Last checkpoint was %d\n", - ExceptionInfo->ExceptionRecord->ExceptionCode, - ExceptionInfo->ExceptionRecord->ExceptionAddress, - ServiceStatus_CheckPoint); - ErrorMessageBox(txt); - } - } - - return EXCEPTION_CONTINUE_SEARCH; -} - - -//--------------------------------------------------------------------------- -// Setup -//--------------------------------------------------------------------------- - - -_FX void SetupExceptionHandler(void) -{ -#ifndef _WIN64 - - typedef void *(*P_AddVectoredExceptionHandler)( - ULONG FirstHandler, - PVECTORED_EXCEPTION_HANDLER VectoredHandler); - - HMODULE kernel32 = GetModuleHandle(L"kernel32.dll"); - void *ptr = GetProcAddress(kernel32, "AddVectoredExceptionHandler"); - if (!ptr) - return; - - ((P_AddVectoredExceptionHandler)ptr)(1, VectoredExceptionHandler); - -#endif _WIN64 -} - - //--------------------------------------------------------------------------- // SuspendMainThread //--------------------------------------------------------------------------- diff --git a/Sandboxie/common/map.c b/Sandboxie/common/map.c index 5fbb6018..1f3ce3c9 100644 --- a/Sandboxie/common/map.c +++ b/Sandboxie/common/map.c @@ -379,4 +379,18 @@ BOOLEAN map_next(map_base_t* m, map_iter_t* iter) #else printf("\r\n\r\nBucket usage %d/%d (%d%%), average nodes per used bucket %.2f\r\n", used, used+empty, 100*used/(used+empty), (double)m->nnodes/used); #endif -}*/ \ No newline at end of file +}*/ + +BOOLEAN str_map_match(const void* key1, const void* key2) { + const wchar_t** str1 = (const wchar_t**)key1; + const wchar_t** str2 = (const wchar_t**)key2; + return _wcsicmp(*str1, *str2) == 0; +} + +unsigned int str_map_hash(const void* key, size_t size) { + const wchar_t** str = (const wchar_t**)key; + unsigned int hash = 5381; + for (unsigned short* ptr = (unsigned short*)*str; *ptr != 0; ptr++) + hash = ((hash << 5) + hash) ^ *ptr; + return hash; +} \ No newline at end of file diff --git a/Sandboxie/common/map.h b/Sandboxie/common/map.h index 4ceece4b..d4a1df45 100644 --- a/Sandboxie/common/map.h +++ b/Sandboxie/common/map.h @@ -70,6 +70,9 @@ BOOLEAN map_next(map_base_t *m, map_iter_t *iter); //void map_dump(map_base_t *m); +BOOLEAN str_map_match(const void* key1, const void* key2); +unsigned int str_map_hash(const void* key, size_t size); + #ifdef __cplusplus } #endif diff --git a/Sandboxie/core/drv/conf.c b/Sandboxie/core/drv/conf.c index 7f5ecd21..908af4d8 100644 --- a/Sandboxie/core/drv/conf.c +++ b/Sandboxie/core/drv/conf.c @@ -134,20 +134,6 @@ static const WCHAR *Conf_Get_Setting_Name( //--------------------------------------------------------------------------- -static BOOLEAN str_map_match(const void* key1, const void* key2) { - const wchar_t** str1 = (const wchar_t**)key1; - const wchar_t** str2 = (const wchar_t**)key2; - return _wcsicmp(*str1, *str2) == 0; -} - -static unsigned int str_map_hash(const void* key, size_t size) { - const wchar_t** str = (const wchar_t**)key; - unsigned int hash = 5381; - for (unsigned short* ptr = (unsigned short*)*str; *ptr != 0; ptr++) - hash = ((hash << 5) + hash) ^ *ptr; - return hash; -} - //--------------------------------------------------------------------------- diff --git a/Sandboxie/core/svc/ProcessServer.cpp b/Sandboxie/core/svc/ProcessServer.cpp index 41310f4d..031dfb5a 100644 --- a/Sandboxie/core/svc/ProcessServer.cpp +++ b/Sandboxie/core/svc/ProcessServer.cpp @@ -46,8 +46,6 @@ ProcessServer::ProcessServer(PipeServer *pipeServer) { - InitializeCriticalSection(&m_RunSandboxed_CritSec); - pipeServer->Register(MSGID_PROCESS, this, Handler); } diff --git a/Sandboxie/core/svc/ProcessServer.h b/Sandboxie/core/svc/ProcessServer.h index 6e9aadf2..5d9c0e5c 100644 --- a/Sandboxie/core/svc/ProcessServer.h +++ b/Sandboxie/core/svc/ProcessServer.h @@ -76,9 +76,6 @@ protected: HANDLE CallerProcessHandle, ULONG crflags, PROCESS_INFORMATION *piInput, PROCESS_INFORMATION *piReply); -protected: - - CRITICAL_SECTION m_RunSandboxed_CritSec; };