From 9b50cbca0dbdd169eb43c52527fc5264d8bb79a7 Mon Sep 17 00:00:00 2001
From: nkh0472 <67589323+nkh0472@users.noreply.github.com>
Date: Tue, 1 Oct 2024 15:30:03 +0800
Subject: [PATCH 1/6] Update sandman_zh_CN.ts
---
SandboxiePlus/SandMan/sandman_zh_CN.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SandboxiePlus/SandMan/sandman_zh_CN.ts b/SandboxiePlus/SandMan/sandman_zh_CN.ts
index 9d527fc3c9..8eaf868382 100644
--- a/SandboxiePlus/SandMan/sandman_zh_CN.ts
+++ b/SandboxiePlus/SandMan/sandman_zh_CN.ts
@@ -7363,7 +7363,7 @@ If you are a great patreaon supporter already, sandboxie can check online for an
-
+ 不加密导入
From 23f4078fd38a90d41ea9eaf335d922c912d77585 Mon Sep 17 00:00:00 2001
From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com>
Date: Tue, 1 Oct 2024 10:59:15 +0200
Subject: [PATCH 2/6] 1.14.10
---
Sandboxie/core/dll/guimisc.c | 5 ++++-
Sandboxie/core/svc/GuiServer.cpp | 12 +++++-------
Sandboxie/core/svc/GuiWire.h | 1 -
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/Sandboxie/core/dll/guimisc.c b/Sandboxie/core/dll/guimisc.c
index 5f7336a117..5331796094 100644
--- a/Sandboxie/core/dll/guimisc.c
+++ b/Sandboxie/core/dll/guimisc.c
@@ -1348,13 +1348,16 @@ _FX LONG Gui_GetRawInputDeviceInfo_impl(
req->uiCommand = uiCommand;
req->unicode = bUnicode;
req->hasData = !!pData;
- req->hasSize = !!pcbSize;
if (lenData)
memcpy(reqData, pData, lenData);
+ // GetRawInputDeviceInfoA accesses pcbSize without testing it for being not NULL
+ // hence if the caller passes NULL we use a dummy value so that we dont crash the helper service
if (pcbSize)
req->cbSize = *pcbSize;
+ else
+ req->cbSize = 0;
rpl = Gui_CallProxy(req, reqSize, sizeof(*rpl));
diff --git a/Sandboxie/core/svc/GuiServer.cpp b/Sandboxie/core/svc/GuiServer.cpp
index 97904923d5..c373287e5c 100644
--- a/Sandboxie/core/svc/GuiServer.cpp
+++ b/Sandboxie/core/svc/GuiServer.cpp
@@ -3532,11 +3532,10 @@ ULONG GuiServer::GetRawInputDeviceInfoSlave(SlaveArgs *args)
return STATUS_INFO_LENGTH_MISMATCH;
LPVOID reqData = req->hasData ? (BYTE*)req + sizeof(GUI_GET_RAW_INPUT_DEVICE_INFO_REQ) : NULL;
- PUINT pcbSize = req->hasSize ? &req->cbSize : NULL;
ULONG lenData = 0;
- if (reqData && pcbSize) {
- lenData = *pcbSize;
+ if (reqData && req->cbSize > 0) {
+ lenData = req->cbSize;
if (req->uiCommand == RIDI_DEVICENAME && req->unicode) {
lenData *= sizeof(WCHAR);
}
@@ -3544,15 +3543,14 @@ ULONG GuiServer::GetRawInputDeviceInfoSlave(SlaveArgs *args)
SetLastError(ERROR_SUCCESS);
if (req->unicode) {
- rpl->retval = GetRawInputDeviceInfoW((HANDLE)req->hDevice, req->uiCommand, reqData, pcbSize);
+ rpl->retval = GetRawInputDeviceInfoW((HANDLE)req->hDevice, req->uiCommand, reqData, &req->cbSize);
}
else {
- rpl->retval = GetRawInputDeviceInfoA((HANDLE)req->hDevice, req->uiCommand, reqData, pcbSize);
+ rpl->retval = GetRawInputDeviceInfoA((HANDLE)req->hDevice, req->uiCommand, reqData, &req->cbSize);
}
rpl->error = GetLastError();
- if (pcbSize)
- rpl->cbSize = *pcbSize;
+ rpl->cbSize = req->cbSize;
if (lenData) {
rpl->hasData = TRUE;
diff --git a/Sandboxie/core/svc/GuiWire.h b/Sandboxie/core/svc/GuiWire.h
index 0dcef76cf5..8ba10f8815 100644
--- a/Sandboxie/core/svc/GuiWire.h
+++ b/Sandboxie/core/svc/GuiWire.h
@@ -697,7 +697,6 @@ struct tagGUI_GET_RAW_INPUT_DEVICE_INFO_REQ
UINT uiCommand;
BOOLEAN unicode;
BOOLEAN hasData;
- BOOLEAN hasSize;
UINT cbSize;
};
From aa93b8758e04f1004c7eee9db26adbe6b913b0ea Mon Sep 17 00:00:00 2001
From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com>
Date: Tue, 1 Oct 2024 13:22:56 +0200
Subject: [PATCH 3/6] 1.14.10
---
CHANGELOG.md | 3 ++
Sandboxie/core/dll/callsvc.c | 74 +++++++++++++++++++++++--
Sandboxie/core/svc/GuiServer.cpp | 47 ++++++++++++++++
Sandboxie/core/svc/GuiServer.h | 2 +
Sandboxie/core/svc/msgids.h | 1 +
Sandboxie/core/svc/queueserver.cpp | 87 ++++++++++++++++++++++++++++++
Sandboxie/core/svc/queueserver.h | 2 +
7 files changed, 213 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 69b26e6bb7..00a78818d4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- added Ability to import encrypted archive files directly [#4255](https://github.com/sandboxie-plus/Sandboxie/issues/4255)
+### Changed
+- when the sbiesvc.exe worker crashes it now can automatically be restarted.
+
### Fixed
- fixed issue with sandbox path entry combo boxes
- fixed Proxy for GetRawInputDeviceInfoW() causes a buffer overflow [#4267](https://github.com/sandboxie-plus/Sandboxie/issues/4267) (thanks marti4d)
diff --git a/Sandboxie/core/dll/callsvc.c b/Sandboxie/core/dll/callsvc.c
index c14f192315..c9cef604f7 100644
--- a/Sandboxie/core/dll/callsvc.c
+++ b/Sandboxie/core/dll/callsvc.c
@@ -1,6 +1,6 @@
/*
* Copyright 2004-2020 Sandboxie Holdings, LLC
- * Copyright 2020 David Xanatos, xanasoft.com
+ * Copyright 2020-2024 David Xanatos, xanasoft.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -572,11 +572,11 @@ _FX ULONG SbieDll_QueuePutRpl(const WCHAR *QueueName,
//---------------------------------------------------------------------------
-// SbieDll_QueuePutReq
+// SbieDll_QueuePutReqImpl
//---------------------------------------------------------------------------
-_FX ULONG SbieDll_QueuePutReq(const WCHAR *QueueName,
+_FX ULONG SbieDll_QueuePutReqImpl(const WCHAR *QueueName,
void *DataPtr,
ULONG DataLen,
ULONG *out_RequestId,
@@ -623,6 +623,9 @@ _FX ULONG SbieDll_QueuePutReq(const WCHAR *QueueName,
if (! NT_SUCCESS(status)) {
+ if(req->event_handle)
+ CloseHandle((HANDLE)req->event_handle);
+
if (out_RequestId)
*out_RequestId = 0;
if (out_EventHandle)
@@ -633,6 +636,71 @@ _FX ULONG SbieDll_QueuePutReq(const WCHAR *QueueName,
}
+//---------------------------------------------------------------------------
+// SbieDll_StartProxy
+//---------------------------------------------------------------------------
+
+
+_FX ULONG SbieDll_StartProxy(const WCHAR *QueueName)
+{
+ NTSTATUS status;
+ QUEUE_CREATE_REQ req;
+ QUEUE_CREATE_RPL *rpl;
+
+ req.h.length = sizeof(QUEUE_CREATE_REQ);
+ req.h.msgid = MSGID_QUEUE_STARTUP;
+ wcscpy(req.queue_name, QueueName);
+ req.event_handle =
+ (ULONG64)(ULONG_PTR)CreateEvent(NULL, FALSE, FALSE, NULL);
+
+ if (! req.event_handle)
+ status = STATUS_UNSUCCESSFUL;
+ else {
+
+ rpl = (QUEUE_CREATE_RPL *)SbieDll_CallServer(&req.h);
+ if (! rpl)
+ status = STATUS_SERVER_DISABLED;
+ else {
+ status = rpl->h.status;
+ Dll_Free(rpl);
+ }
+
+ if (NT_SUCCESS(status)) {
+
+ if (WaitForSingleObject((HANDLE)(ULONG_PTR)req.event_handle, 10 * 1000) != 0)
+ status = STATUS_TIMEOUT;
+ }
+
+ CloseHandle((HANDLE)(ULONG_PTR)req.event_handle);
+ }
+
+ return status;
+}
+
+
+//---------------------------------------------------------------------------
+// SbieDll_QueuePutReq
+//---------------------------------------------------------------------------
+
+
+_FX ULONG SbieDll_QueuePutReq(const WCHAR *QueueName,
+ void *DataPtr,
+ ULONG DataLen,
+ ULONG *out_RequestId,
+ HANDLE *out_EventHandle)
+{
+ NTSTATUS status = SbieDll_QueuePutReqImpl(QueueName, DataPtr, DataLen, out_RequestId, out_EventHandle);
+ if (status == STATUS_OBJECT_NAME_NOT_FOUND) {
+
+ if (NT_SUCCESS(SbieDll_StartProxy(QueueName))) {
+
+ status = SbieDll_QueuePutReqImpl(QueueName, DataPtr, DataLen, out_RequestId, out_EventHandle);
+ }
+ }
+ return status;
+}
+
+
//---------------------------------------------------------------------------
// SbieDll_QueueGetRpl
//---------------------------------------------------------------------------
diff --git a/Sandboxie/core/svc/GuiServer.cpp b/Sandboxie/core/svc/GuiServer.cpp
index c373287e5c..c82f467d60 100644
--- a/Sandboxie/core/svc/GuiServer.cpp
+++ b/Sandboxie/core/svc/GuiServer.cpp
@@ -4670,3 +4670,50 @@ ULONG GuiServer::KillJob(SlaveArgs* args)
return STATUS_SUCCESS;
}
+
+
+//---------------------------------------------------------------------------
+// StartAsync
+//---------------------------------------------------------------------------
+
+struct SStartupParam
+{
+ ULONG session_id;
+ HANDLE hEvent;
+};
+
+ULONG GuiServer__StartupWorker(void* _Param)
+{
+ SStartupParam* pParam = (SStartupParam*)_Param;
+
+ //
+ // thart the proxy process
+ //
+
+ GuiServer::GetInstance()->StartSlave(pParam->session_id);
+
+ //
+ // notify the requesting party that the server is now up and running
+ //
+
+ SetEvent(pParam->hEvent);
+
+ HeapFree(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, pParam);
+ return 0;
+}
+
+ULONG GuiServer::StartAsync(ULONG session_id, HANDLE hEvent)
+{
+ SStartupParam* pParam = (SStartupParam*)HeapAlloc(GetProcessHeap(), 0, sizeof(SStartupParam));
+ pParam->session_id = session_id;
+ pParam->hEvent = hEvent;
+
+ HANDLE hThread = CreateThread(NULL, 0, GuiServer__StartupWorker, (void *)pParam, 0, NULL);
+ if (!hThread) {
+ HeapFree(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, pParam);
+ return STATUS_UNSUCCESSFUL;
+ }
+ CloseHandle(hThread);
+ return STATUS_SUCCESS;
+}
+
diff --git a/Sandboxie/core/svc/GuiServer.h b/Sandboxie/core/svc/GuiServer.h
index 49993d23cf..0b1fbc4119 100644
--- a/Sandboxie/core/svc/GuiServer.h
+++ b/Sandboxie/core/svc/GuiServer.h
@@ -34,6 +34,8 @@ class GuiServer
static GuiServer *GetInstance();
+ ULONG StartAsync(ULONG session_id, HANDLE hEvent);
+
bool InitProcess(HANDLE hProcess, ULONG process_id, ULONG session_id,
BOOLEAN add_to_job);
diff --git a/Sandboxie/core/svc/msgids.h b/Sandboxie/core/svc/msgids.h
index 1cc1613199..918f68c82a 100644
--- a/Sandboxie/core/svc/msgids.h
+++ b/Sandboxie/core/svc/msgids.h
@@ -143,6 +143,7 @@
#define MSGID_QUEUE_PUTRPL 0x1E03
#define MSGID_QUEUE_PUTREQ 0x1E04
#define MSGID_QUEUE_GETRPL 0x1E05
+#define MSGID_QUEUE_STARTUP 0x1E10
#define MSGID_QUEUE_NOTIFICATION 0x1EFF
#define MSGID_EPMAPPER 0x1F00
diff --git a/Sandboxie/core/svc/queueserver.cpp b/Sandboxie/core/svc/queueserver.cpp
index aaa0e01e41..60e2ce974d 100644
--- a/Sandboxie/core/svc/queueserver.cpp
+++ b/Sandboxie/core/svc/queueserver.cpp
@@ -24,6 +24,7 @@
#include "queueserver.h"
#include "queuewire.h"
#include "core/dll/sbieapi.h"
+#include "GuiServer.h"
//---------------------------------------------------------------------------
@@ -111,6 +112,10 @@ MSG_HEADER *QueueServer::Handler(void *_this, MSG_HEADER *msg)
HANDLE idProcess = (HANDLE)(ULONG_PTR)PipeServer::GetCallerProcessId();
+ if (msg->msgid == MSGID_QUEUE_STARTUP) {
+ return pThis->StartupHandler(msg, idProcess);
+ }
+
if (msg->msgid == MSGID_QUEUE_NOTIFICATION) {
pThis->NotifyHandler(idProcess);
return NULL;
@@ -952,3 +957,85 @@ void QueueServer::DeleteRequestObj(LIST *RequestsList, void *_RequestObj)
List_Remove(RequestsList, RequestObj);
HeapFree(m_heap, 0, RequestObj);
}
+
+
+//---------------------------------------------------------------------------
+// StartupHandler
+//---------------------------------------------------------------------------
+
+
+MSG_HEADER *QueueServer::StartupHandler(MSG_HEADER *msg, HANDLE idProcess)
+{
+ WCHAR *QueueName = NULL;
+ HANDLE hProcess = NULL;
+ HANDLE hEvent = NULL;
+ ULONG status;
+
+ EnterCriticalSection(&m_lock);
+
+ QUEUE_CREATE_REQ *req = (QUEUE_CREATE_REQ *)msg;
+ if (req->h.length < sizeof(QUEUE_CREATE_REQ)) {
+ status = STATUS_INVALID_PARAMETER;
+ goto finish;
+ }
+
+ //
+ //
+ //
+
+ QueueName = MakeQueueName(idProcess, req->queue_name, &status);
+ if (! QueueName)
+ goto finish;
+
+ QUEUE_OBJ *QueueObj = (QUEUE_OBJ *)FindQueueObj(QueueName);
+ if (QueueObj) { // already exists
+ status = STATUS_SUCCESS;
+ goto finish;
+ }
+
+ status = OpenProcess(idProcess, &hProcess,
+ PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION);
+ if (! NT_SUCCESS(status))
+ goto finish;
+
+ status = DuplicateEvent(hProcess, req->event_handle, &hEvent);
+ if (! NT_SUCCESS(status))
+ goto finish;
+
+ //
+ //
+ //
+
+ ULONG session_id;
+ if (!NT_SUCCESS(SbieApi_QueryProcess(idProcess, NULL, NULL, NULL, &session_id))) {
+ status = STATUS_ACCESS_DENIED;
+ goto finish;
+ }
+
+ if (_wcsnicmp(req->queue_name, L"*GUIPROXY", 9) == 0) {
+
+ status = GuiServer::GetInstance()->StartAsync(session_id, hEvent);
+ }
+ else {
+
+ status = STATUS_INVALID_PARAMETER;
+ }
+
+ if (NT_SUCCESS(status))
+ hEvent = NULL;
+
+finish:
+
+ LeaveCriticalSection(&m_lock);
+
+ if (hEvent)
+ CloseHandle(hEvent);
+
+ if (hProcess)
+ CloseHandle(hProcess);
+
+ if (QueueName)
+ HeapFree(m_heap, 0, QueueName);
+
+ return SHORT_REPLY(status);
+}
diff --git a/Sandboxie/core/svc/queueserver.h b/Sandboxie/core/svc/queueserver.h
index be7f0cb249..67a4392aa6 100644
--- a/Sandboxie/core/svc/queueserver.h
+++ b/Sandboxie/core/svc/queueserver.h
@@ -51,6 +51,8 @@ class QueueServer
MSG_HEADER *GetRplHandler(MSG_HEADER *msg, HANDLE idProcess);
+ MSG_HEADER *StartupHandler(MSG_HEADER *msg, HANDLE idProcess);
+
void NotifyHandler(HANDLE idProcess);
LONG OpenProcess(HANDLE idProcess, HANDLE *out_hProcess,
From ec549d8dbfba2c2c2a49a13901398b33b14b4f96 Mon Sep 17 00:00:00 2001
From: Michael <33252157+APMichael@users.noreply.github.com>
Date: Tue, 1 Oct 2024 13:54:52 +0200
Subject: [PATCH 4/6] Update sandman_de.ts
- Added new translation.
---
SandboxiePlus/SandMan/sandman_de.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SandboxiePlus/SandMan/sandman_de.ts b/SandboxiePlus/SandMan/sandman_de.ts
index ff9fb1ef90..6978bf9386 100644
--- a/SandboxiePlus/SandMan/sandman_de.ts
+++ b/SandboxiePlus/SandMan/sandman_de.ts
@@ -6843,7 +6843,7 @@ Wenn Sie bereits ein Great Supporter auf Patreon sind, kann Sandboxie online nac
-
+ Ohne Verschlüsselung importieren
From 80daf9fb763468244e88dece30ed16d9facf3f74 Mon Sep 17 00:00:00 2001
From: Michael <33252157+APMichael@users.noreply.github.com>
Date: Tue, 1 Oct 2024 13:56:16 +0200
Subject: [PATCH 5/6] Update TRANSLATING.md
---
TRANSLATING.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TRANSLATING.md b/TRANSLATING.md
index d87b170311..fcc894ab08 100644
--- a/TRANSLATING.md
+++ b/TRANSLATING.md
@@ -21,7 +21,7 @@ To achieve this goal, Sandboxie has established a translation program that enabl
|Farsi|Yes|No|No|
|Finnish|Yes|No|No|
|French|Yes - Sep 11, 2023|Yes - Jun 20, 2024|No|
-|German|Yes - May 21, 2024|Yes - Sep 19, 2024|Yes - Jun 25, 2024|
+|German|Yes - May 21, 2024|Yes - Oct 01, 2024|Yes - Jun 25, 2024|
|Greek|Yes|No|No|
|Hebrew|Yes|No|No|
|Hungarian|Yes|Yes - Mar 30, 2023|No|
From 76799404c0478877f04102476a96100aa1f074da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?VenusGirl=E2=9D=A4?=
Date: Wed, 2 Oct 2024 02:42:34 +0900
Subject: [PATCH 6/6] Update sandman_ko.ts
---
SandboxiePlus/SandMan/sandman_ko.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SandboxiePlus/SandMan/sandman_ko.ts b/SandboxiePlus/SandMan/sandman_ko.ts
index f33d68a84b..8c98e8d595 100644
--- a/SandboxiePlus/SandMan/sandman_ko.ts
+++ b/SandboxiePlus/SandMan/sandman_ko.ts
@@ -7466,7 +7466,7 @@ If you are a great patreaon supporter already, sandboxie can check online for an
-
+ 암호화 없이 가져오기