This commit is contained in:
DavidXanatos 2021-12-27 12:42:37 +01:00
parent e4933a83df
commit 3386c33fec
13 changed files with 23 additions and 96 deletions

View File

@ -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

View File

@ -129,8 +129,6 @@ int __stdcall WinMain(
Check_Windows_7();
SetupExceptionHandler();
HOOK_WIN32(CoImpersonateClient);
HOOK_WIN32(LogonUserW);

View File

@ -204,8 +204,6 @@ int __stdcall WinMain(
Check_Windows_7();
SetupExceptionHandler();
HOOK_WIN32(DuplicateHandle);
HOOK_WIN32(CreateFileW);

View File

@ -127,8 +127,6 @@ int __stdcall WinMain(
BOOL ok;
HANDLE hThreadEvent;
SetupExceptionHandler();
Check_Windows_7();
// pretend we are the SCM

View File

@ -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);
}
}

View File

@ -399,8 +399,6 @@ _FX int __stdcall WinMain(
return STATUS_LICENSE_QUOTA_EXCEEDED;
}
SetupExceptionHandler();
if (1) {
ULONG idThread;
HANDLE hThread = CreateThread(

View File

@ -198,8 +198,6 @@ int __stdcall WinMain(
Check_Windows_7();
SetupExceptionHandler();
HOOK_WIN32(CreateProcessW);
memzero(&osvi, sizeof(OSVERSIONINFO));

View File

@ -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
//---------------------------------------------------------------------------

View File

@ -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
}*/
}*/
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;
}

View File

@ -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

View File

@ -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;
}
//---------------------------------------------------------------------------

View File

@ -46,8 +46,6 @@
ProcessServer::ProcessServer(PipeServer *pipeServer)
{
InitializeCriticalSection(&m_RunSandboxed_CritSec);
pipeServer->Register(MSGID_PROCESS, this, Handler);
}

View File

@ -76,9 +76,6 @@ protected:
HANDLE CallerProcessHandle, ULONG crflags,
PROCESS_INFORMATION *piInput, PROCESS_INFORMATION *piReply);
protected:
CRITICAL_SECTION m_RunSandboxed_CritSec;
};