Build 0.8.7

This commit is contained in:
DavidXanatos 2021-07-10 10:42:39 +02:00
parent 531f1100af
commit 2c97b50868
39 changed files with 217 additions and 314 deletions

View File

@ -3,6 +3,28 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [0.8.7 / 5.50.7] - 2021-07-10
### Added
- added option to always auto pick the DefautlBox sandbox [959](https://github.com/sandboxie-plus/Sandboxie/issues/959)
-- when this option is enabled the normal behavioure with a box selection dialog can be achived holding down CTRL
### Changed
- changed default terminate all boxed processes key from Ctrl+Break to Ctrl+Alt+Break [#974](https://github.com/sandboxie-plus/Sandboxie/issues/974)
- start.exe does no longer link in all that unused MFC code reduced file size form over 2.5MB to below 250KB
- updated the main sandman and tray icon [#963](https://github.com/sandboxie-plus/Sandboxie/issues/963)
### Fixed
- added additional delay and retryes to kmdutill.exe to mitigate issues when unloading the driver [#968](https://github.com/sandboxie-plus/Sandboxie/issues/968)
- fixed issue with sbiectrl not being properly started after setup [#969](https://github.com/sandboxie-plus/Sandboxie/issues/969)
- fixed issue with explore sandboxed shell option [#972](https://github.com/sandboxie-plus/Sandboxie/issues/972)
- fixed issue when running sandman elevated [#932](https://github.com/sandboxie-plus/Sandboxie/issues/932)
### Removed
- removed Online Armor support as this product is deprecated since 2016
## [0.8.6 / 5.50.6] - 2021-07-07
### Added

View File

@ -24,24 +24,6 @@
#define _MY_COMMONUTILS_H
//---------------------------------------------------------------------------
// Functions (c++)
//---------------------------------------------------------------------------
#ifdef __cplusplus
#include <afxcmn.h>
void Common_RunStartExe(const CString &cmd, const CString &box,
BOOL wait = FALSE, BOOL inherit = FALSE);
#endif __cplusplus
//---------------------------------------------------------------------------
// Functions (c)
//---------------------------------------------------------------------------

View File

@ -19,7 +19,7 @@
// Common Utility Functions
//---------------------------------------------------------------------------
#include <windows.h>
#include "CommonUtils.h"

View File

@ -24,6 +24,7 @@
#include "RunBrowser.h"
#include "CommonUtils.h"
#include "RunStartExe.h"
#include "MyMsg.h"
#include "core/dll/sbiedll.h"

View File

@ -0,0 +1,22 @@
#ifndef _MY_RUNSTARTEXE_H
#define _MY_RUNSTARTEXE_H
//---------------------------------------------------------------------------
// Functions (c++)
//---------------------------------------------------------------------------
#ifdef __cplusplus
#include <afxcmn.h>
void Common_RunStartExe(const CString &cmd, const CString &box,
BOOL wait = FALSE, BOOL inherit = FALSE);
#endif __cplusplus
#endif //_MY_RUNSTARTEXE_H

View File

@ -298,11 +298,13 @@
<ClInclude Include="..\..\common\json\JSONValue.h" />
<ClInclude Include="..\..\common\my_version.h" />
<ClInclude Include="..\common\BoxOrder.h" />
<ClInclude Include="..\common\CommonUtils.h" />
<ClInclude Include="..\common\FontStore.h" />
<ClInclude Include="..\common\Layout.h" />
<ClInclude Include="..\common\MyGdi.h" />
<ClInclude Include="..\common\MyMsg.h" />
<ClInclude Include="..\common\RunBrowser.h" />
<ClInclude Include="..\common\RunStartExe.h" />
<ClInclude Include="AboutDialog.h" />
<ClInclude Include="AlertDialog.h" />
<ClInclude Include="AnimatedBitmap.h" />

View File

@ -166,6 +166,12 @@
</ClInclude>
<ClInclude Include="UpdateDialog.h" />
<ClInclude Include="Updater.h" />
<ClInclude Include="..\common\CommonUtils.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\common\RunStartExe.h">
<Filter>common</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="SbieControl.rc" />

View File

@ -34,6 +34,7 @@
#include "apps/common/MyMsgBox.h"
#include "apps/common/MyGdi.h"
#include "apps/common/CommonUtils.h"
#include "apps/common/RunStartExe.h"
#include "common/win32_ntddk.h"
#include "common/my_version.h"
#include "core/drv/api_defs.h"

View File

@ -34,7 +34,7 @@ BEGIN
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", MY_COMPANY_NAME_STRING "\0"
VALUE "FileDescription", MY_PRODUCT_NAME_STRING " configuration file utility\0"
VALUE "FileDescription", MY_PRODUCT_NAME_STRING " Loader\0"
VALUE "FileVersion", MY_VERSION_STRING "\0"
OPTIONAL_VALUE("InternalName", "SbieLdr\0")
VALUE "LegalCopyright", MY_COPYRIGHT_STRING "\0"

View File

@ -193,6 +193,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
<ClInclude Include="stdafx.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc" />

View File

@ -32,6 +32,7 @@
#include "common/my_version.h"
#define INITGUID
#include <guiddef.h>
#include <commdlg.h>
//---------------------------------------------------------------------------

View File

@ -46,7 +46,6 @@
void List_Process_Ids(void);
int Terminate_All_Processes(BOOL all_boxes);
BOOLEAN Register_Process(void);
extern WCHAR *DoRunDialog(HINSTANCE hInstance);
extern WCHAR *DoBoxDialog(void);
@ -74,7 +73,6 @@ BOOL auto_select_default_box = FALSE;
WCHAR *StartMenuSectionName = NULL;
BOOL run_silent = FALSE;
BOOL dont_start_sbie_ctrl = FALSE;
BOOL process_was_registered = FALSE;
BOOL hide_window = FALSE;
BOOL wait_for_process = FALSE;
BOOLEAN layout_rtl = FALSE;
@ -607,7 +605,7 @@ BOOL Parse_Command_Line(void)
disable_force_on_this_program = TRUE;
//
// Command line switch /elevate
// Command line switch /hide_window
//
} else if (_wcsnicmp(cmd, L"hide_window", 11) == 0) {
@ -990,22 +988,6 @@ int Program_Start(void)
}
}
//
// if Online Armor is part of the process, then invoke Start.exe
// recursively, that somehow fixes the problem
//
if (process_was_registered && GetModuleHandle(L"oawatch.dll")) {
if (SbieDll_RunFromHome(START_EXE, cmdline, &si, &pi)) {
ok = TRUE;
err = 0;
break;
}
}
//
// make sure AppHelp.dll is loaded, so third party software like
// EMET which relies on injection through ShimEng/AppHelp can work.
@ -1045,8 +1027,7 @@ int Program_Start(void)
// Start.exe which will then open the document normally
//
if ((! ok) && (err == ERROR_NO_ASSOCIATION) &&
process_was_registered && run_elevated_2) {
/*if ((! ok) && (err == ERROR_NO_ASSOCIATION) && run_elevated_2) {
WCHAR *start_exe = MyHeapAlloc((MAX_PATH + 8) * sizeof(WCHAR));
@ -1060,7 +1041,7 @@ int Program_Start(void)
shExecInfo.lpFile = cmdline;
shExecInfo.lpParameters = NULL;
}
}*/
//
// handle a possible DDE error by retrying without the DDE option

View File

@ -21,11 +21,14 @@
#pragma once
#include "ntstatus.h"
#include <ntstatus.h>
#define WIN32_NO_STATUS
typedef long NTSTATUS;
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <shellapi.h>
#include <shlwapi.h>
#include <Shlobj.h>
#include <objbase.h>

View File

@ -21,8 +21,8 @@
#ifndef _MY_VERSION_H
#define _MY_VERSION_H
#define MY_VERSION_BINARY 5,50,6
#define MY_VERSION_STRING "5.50.6"
#define MY_VERSION_BINARY 5,50,7
#define MY_VERSION_STRING "5.50.7"
#define MY_VERSION_COMPAT "5.50.0" // this refers to the driver ABI compatibility
// These #defines are used by either Resource Compiler, or by NSIC installer

View File

@ -375,19 +375,6 @@ next_zwxxx:
return FALSE;
}
//
// workaround for Online Armor driver
//
#ifndef _WIN64
if (1) {
extern void Syscall_HandleOADriver(void);
Syscall_HandleOADriver();
}
#endif ! _WIN64
return TRUE;
}

View File

@ -34,8 +34,6 @@ __declspec(dllimport) KeAddSystemServiceTable(PVOID, PVOID, PVOID, PVOID, PVOID)
//---------------------------------------------------------------------------
static void *Syscall_HandleOADriver_2(void *ntos_func);
ULONG findFlagOffset(UCHAR *ptr)
{
ULONG offset = 0;
@ -296,136 +294,3 @@ _FX BOOLEAN Syscall_GetKernelAddr(
return FALSE;
}
//---------------------------------------------------------------------------
// Syscall_HandleOADriver
//---------------------------------------------------------------------------
_FX void Syscall_HandleOADriver(void)
{
//
// conflict with Online Armor firewall software and workaround:
//
// OADriver kernel driver replaces service descriptor table pointers
// (i.e. hooks NT syscalls), and some of the replacement routines
// incorrectly enter an infinite wait, in the context of a process
// in the sandbox under Sandboxie v4.
//
// to work around this, we Syscall_HandleOADriver_2 try to extract
// the address of the saved descriptor table pointer, so our
// Syscall_Invoke function can bypass the problematic OA routines
//
// this workaround is not required on 64-bit Windows.
//
if (Driver_CheckThirdParty(L"OADevice", SERVICE_FILE_SYSTEM_DRIVER)) {
/*UCHAR *OADriverApisToFix[] = {
"AllocateVirtualMemory", "CreateFile", "CreateKey", "CreatePort",
"CreateProcess", "CreateProcessEx", "CreateSection",
"CreateThread", "DebugActiveProcess", "DuplicateObject",
"LoadDriver", "OpenFile", "OpenProcess", "OpenSection",
"OpenThread", "ConnectPort", "SecureConnectPort",
NULL
};*/
UCHAR *OADriverApisToFix[] = {
"OpenSection", "ConnectPort", "SecureConnectPort",
NULL
};
ULONG i;
for (i = 0; OADriverApisToFix[i]; ++i) {
SYSCALL_ENTRY *entry = Syscall_GetByName(OADriverApisToFix[i]);
if (entry) {
void *new_ntos_func =
Syscall_HandleOADriver_2(entry->ntos_func);
if (new_ntos_func) {
// DbgPrint("Name = %s Old = %08X New = %08X\n", OADriverApisToFix[i], entry->ntos_func, new_ntos_func);
entry->ntos_func = new_ntos_func;
}
}
}
}
}
//---------------------------------------------------------------------------
// Syscall_HandleOADriver_2
//---------------------------------------------------------------------------
_FX void *Syscall_HandleOADriver_2(void *ntos_func)
{
UCHAR *code = ntos_func;
ULONG i;
ULONG jump_target_1 = 0;
ULONG jump_target_2 = 0;
//
// the function begins with two comparisons and two conditional jumps
// which go to the same address
//
for (i = 0; i < 48; ++i) {
USHORT *code2 = (USHORT *)(code + i);
UCHAR *jump_inst;
if (*code2 == 0x3539) // cmp dword ptr [xx], esi
jump_inst = code + i + 6;
else if (*code2 == 0x1D39) // cmp dword ptr [xx], ebx
jump_inst = code + i + 6;
else if (*code2 == 0x3D83) // cmp dword ptr [xx], nnn
jump_inst = code + i + 7;
else
jump_inst = NULL;
if (jump_inst && *(USHORT *)jump_inst == 0x840F) { // je
//
// calculate the target address of the jump instructions
//
ULONG jump_target = *(ULONG *)(jump_inst + 2)
+ (ULONG)jump_inst + 6;
if (! jump_target_1)
jump_target_1 = jump_target;
else {
if (! jump_target_2)
jump_target_2 = jump_target;
break;
}
}
}
//
// the two jump instructions must go to the same address
//
if ((! jump_target_1) || (jump_target_1 != jump_target_2))
return NULL;
code = (UCHAR *)jump_target_1;
//
// extract the address for the original SSDT routine
//
for (i = 0; i < 48; ++i) {
USHORT *call_1 = (USHORT *)(code + i);
if (*call_1 == 0x15FF) { // call dword ptr [xx]
UCHAR *call2 = code + i + 6;
if (call2[0] == 0xE8 && call2[5] == 0xC2) { // call xx ; ret xx
void ***orig_syscall_ptr = (void ***)(call_1 + 1);
return **orig_syscall_ptr;
}
}
}
return NULL;
}

View File

@ -1663,7 +1663,7 @@ MSG_HEADER *SbieIniServer::RunSbieCtrl(HANDLE idProcess, bool isSandboxed)
NTSTATUS status = STATUS_UNSUCCESSFUL;
HANDLE hToken = NULL;
BOOL ok = TRUE;
WCHAR ctrlName[64];
WCHAR ctrlName[64] = { 0 };
//
// get token from caller session or caller process. note that on

View File

@ -660,8 +660,10 @@ BOOL Kmd_Stop_Service(
return TRUE;
if ((GetLastError() == ERROR_SERVICE_REQUEST_TIMEOUT ||
GetLastError() == ERROR_PIPE_BUSY) && retries < 3)
continue;
GetLastError() == ERROR_PIPE_BUSY) && retries < 5) {
Sleep(2500);
continue;
}
Display_Error(L"ControlService Interrogate", 0);
return FALSE;
@ -674,8 +676,10 @@ BOOL Kmd_Stop_Service(
SERVICE_CONTROL_STOP, &service_status)) {
if ((GetLastError() == ERROR_SERVICE_REQUEST_TIMEOUT ||
GetLastError() == ERROR_PIPE_BUSY) && retries < 3)
continue;
GetLastError() == ERROR_PIPE_BUSY) && retries < 5) {
Sleep(2500);
continue;
}
Display_Error(L"ControlService Stop", 0);
return FALSE;

View File

@ -982,7 +982,15 @@ SB_STATUS CSbieAPI::RunStart(const QString& BoxName, const QString& Command, QPr
if (m_SbiePath.isEmpty())
return SB_ERR(SB_PathFail);
QString StartCmd = "\"" + GetStartPath() + "\"" + (Elevated ? " /elevated" : "" ) + " /box:" + BoxName + " " + Command;
//bool bStart = (Command == "run_dialog" || Command == "default_browser" || Command == "mail_agent" || Command.left(10) == "start_menu");
QString StartCmd = "\"" + GetStartPath() + "\"" + (Elevated ? " /elevated" : "");
if (!BoxName.isEmpty())
StartCmd += " /box:" + BoxName + " ";
else
StartCmd += " /disable_force ";
StartCmd += Command;
if (pProcess)
pProcess->start(StartCmd);
else

View File

@ -15,6 +15,8 @@
#define SBIESVC L"SbieSvc"
#define SBIESVC_EXE L"SbieSvc.exe"
#define SBIELDR_EXE L"SbieLdr.exe"
#define SBIESTART_EXE L"Start.exe"
#define SBIEMSG_DLL L"SbieMsg.dll"

View File

@ -114,10 +114,10 @@ SB_STATUS CSbieUtils::Install(EComponent Component)
void CSbieUtils::Install(EComponent Component, QStringList& Ops)
{
QString HomePath = QCoreApplication::applicationDirPath().replace("/", "\\"); // "C:\\Program Files\\Sandboxie "
if ((Component & eDriver) != 0 && GetServiceStatus(SBIEDRV) == 0) // todo: why when we are admin we need \??\ and else not and why knd util from console as admin also does not need that???
Ops.append(QString::fromWCharArray(L"kmdutil.exe|install|" SBIEDRV L"|") + "\"\\??\\" + HomePath + "\\" + QString::fromWCharArray(SBIEDRV_SYS) + "\"" + "|type=kernel|start=demand|altitude=86900");
if ((Component & eDriver) != 0 && GetServiceStatus(SBIEDRV) == 0)
Ops.append(QString::fromWCharArray(L"kmdutil.exe|install|" SBIEDRV L"|") + HomePath + "\\" + QString::fromWCharArray(SBIEDRV_SYS) + "|type=kernel|start=demand|altitude=86900");
if ((Component & eService) != 0 && GetServiceStatus(SBIESVC) == 0) {
Ops.append(QString::fromWCharArray(L"kmdutil.exe|install|" SBIESVC L"|") + "\"" + HomePath + "\\" + QString::fromWCharArray(SBIESVC_EXE) + "\"" + "|type=own|start=auto|display=\"Sandboxie Service\"|group=UIGroup");
Ops.append(QString::fromWCharArray(L"kmdutil.exe|install|" SBIESVC L"|") + HomePath + "\\" + QString::fromWCharArray(SBIESVC_EXE) + "|type=own|start=auto|display=\"Sandboxie Service\"|group=UIGroup");
Ops.append("reg.exe|ADD|HKLM\\SYSTEM\\ControlSet001\\Services\\SbieSvc|/v|PreferExternalManifest|/t|REG_DWORD|/d|1|/f");
}
}
@ -156,7 +156,7 @@ SB_STATUS CSbieUtils::ElevateOps(const QStringList& Ops)
return ExecOps(Ops);
wstring path = QCoreApplication::applicationFilePath().toStdWString();
wstring params = L"-assist " + Ops.join(" ").toStdWString();
wstring params = L"-assist \"" + Ops.join("\" \"").toStdWString() + L"\"";
SHELLEXECUTEINFO shex;
memset(&shex, 0, sizeof(SHELLEXECUTEINFO));

View File

@ -54,30 +54,10 @@
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="2">
<widget class="QLabel" name="label">
<item row="7" column="1" colspan="2">
<widget class="QCheckBox" name="chkShowRecovery">
<property name="text">
<string>Restart required (!)</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="chkAutoStart">
<property name="text">
<string>Start UI with Windows</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QCheckBox" name="chkNotifications">
<property name="text">
<string>Show Notifications for relevant log Messages</string>
</property>
<property name="checked">
<bool>false</bool>
<string>Show first recovery window when emptying sandboxes</string>
</property>
</widget>
</item>
@ -91,30 +71,20 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="uiLang"/>
</item>
<item row="8" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="chkPanic">
<property name="text">
<string>Hot-Key for terminating all boxed processes:</string>
</property>
</widget>
</item>
<item>
<widget class="QKeySequenceEdit" name="keyPanic"/>
</item>
</layout>
</item>
<item row="11" column="1">
<widget class="QComboBox" name="onClose"/>
</item>
<item row="7" column="1" colspan="2">
<widget class="QCheckBox" name="chkShowRecovery">
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="chkSvcStart">
<property name="text">
<string>Show first recovery window when emptying sandboxes</string>
<string>Start UI when a sandboxed process is started</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>On main window close:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
@ -128,6 +98,36 @@
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="chkShowTray">
<property name="text">
<string>Show Sys-Tray</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Tray options</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label">
<property name="text">
<string>Restart required (!)</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="12" column="2">
<spacer name="horizontalSpacer_8">
<property name="orientation">
@ -141,26 +141,28 @@
</property>
</spacer>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="chkShowTray">
<item row="5" column="1" colspan="2">
<widget class="QCheckBox" name="chkNotifications">
<property name="text">
<string>Show Sys-Tray</string>
<string>Show Notifications for relevant log Messages</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QCheckBox" name="chkShellMenu">
<item row="2" column="1">
<widget class="QCheckBox" name="chkAutoStart">
<property name="text">
<string>Add 'Run Sandboxed' to the explorer context menu</string>
<string>Start UI with Windows</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="chkSvcStart">
<property name="text">
<string>Start UI when a sandboxed process is started</string>
</property>
</widget>
<item row="0" column="1">
<widget class="QComboBox" name="uiLang"/>
</item>
<item row="11" column="1">
<widget class="QComboBox" name="onClose"/>
</item>
<item row="12" column="1">
<spacer name="verticalSpacer_4">
@ -175,26 +177,31 @@
</property>
</spacer>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<item row="4" column="1" colspan="2">
<widget class="QCheckBox" name="chkShellMenu">
<property name="text">
<string>Tray options</string>
<string>Add 'Run Sandboxed' to the explorer context menu</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_18">
<item row="8" column="1" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="chkPanic">
<property name="text">
<string>Hot-Key for terminating all boxed processes:</string>
</property>
</widget>
</item>
<item>
<widget class="QKeySequenceEdit" name="keyPanic"/>
</item>
</layout>
</item>
<item row="4" column="3">
<widget class="QCheckBox" name="chkAlwaysDefault">
<property name="text">
<string>On main window close:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string>Always use DefaultBox</string>
</property>
</widget>
</item>

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -1,12 +1,9 @@
<RCC>
<qresource prefix="/">
<file>SandMan.png</file>
<file alias="BoxEmpty">sandbox-empty.png</file>
<file alias="BoxInUse">sandbox-full.png</file>
<file alias="dllIcon32">dll32.png</file>
<file alias="exeIcon32">exe32.png</file>
<file>close.png</file>
<file>SandMan2.png</file>
<file>Actions/Internet.png</file>
<file>Actions/Keep.png</file>
<file>Actions/ReloadIni.png</file>
@ -43,14 +40,16 @@
<file>Actions/Box.png</file>
<file>Actions/Template.png</file>
<file>Actions/Stop.png</file>
<file>SandMan2N.png</file>
<file>SandManN.png</file>
<file>Actions/finder.png</file>
<file>Actions/Tree.png</file>
<file>Actions/Support.png</file>
<file>HelpingHand.png</file>
<file>Actions/RegEdit.png</file>
<file>Actions/Software.png</file>
<file>IconEmpty.png</file>
<file>IconEmptyD.png</file>
<file>IconFull.png</file>
<file>IconFullD.png</file>
</qresource>
<qresource prefix="/Boxes">
<file alias="Empty3">Boxes/sandbox-b-empty.png</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -189,7 +189,7 @@ CSandMan::CSandMan(QWidget *parent)
// Tray
QIcon Icon;
Icon.addFile(":/SandMan.png");
Icon.addFile(":/IconEmpty.png");
m_pTrayIcon = new QSystemTrayIcon(Icon, this);
m_pTrayIcon->setToolTip("Sandboxie-Plus");
connect(m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(OnSysTray(QSystemTrayIcon::ActivationReason)));
@ -516,7 +516,7 @@ QIcon CSandMan::GetBoxIcon(bool inUse, int boxType)
EBoxColors color = eYelow;
switch (boxType) {
case CSandBoxPlus::eHardened: color = eOrang; break;
case CSandBoxPlus::eHasLogApi: color = eRed; break;
//case CSandBoxPlus::eHasLogApi: color = eRed; break;
case CSandBoxPlus::eInsecure: color = eMagenta; break;
}
return inUse ? m_BoxIcons[color].second : m_BoxIcons[color].first;
@ -544,7 +544,11 @@ void CSandMan::OnMessage(const QString& Message)
{
QString CmdLine = Message.mid(4);
RunSandboxed(QStringList(CmdLine));
if (theConf->GetBool("Options/RunInDefaultBox", false) && (QGuiApplication::queryKeyboardModifiers() & Qt::ControlModifier) == 0) {
theAPI->RunStart("DefaultBox", CmdLine);
}
else
RunSandboxed(QStringList(CmdLine));
}
else if (Message.left(6) == "Status")
{
@ -629,11 +633,13 @@ void CSandMan::timerEvent(QTimerEvent* pEvent)
m_bIconEmpty = (theAPI->TotalProcesses() == 0);
m_bIconDisabled = bForceProcessDisabled;
QString IconFile = ":/SandMan";
QString IconFile;
if (m_bIconEmpty)
IconFile += "2";
IconFile += ":/IconEmpty";
else
IconFile += ":/IconFull";
if(m_bIconDisabled)
IconFile += "N";
IconFile += "D";
QIcon Icon;
Icon.addFile(IconFile + ".png");
@ -898,7 +904,7 @@ void CSandMan::SetupHotKeys()
m_pHotkeyManager->unregisterAllHotkeys();
if (theConf->GetBool("Options/EnablePanicKey", false))
m_pHotkeyManager->registerHotkey(theConf->GetString("Options/PanicKeySequence", "Ctrl+Cancel"), HK_PANIC);
m_pHotkeyManager->registerHotkey(theConf->GetString("Options/PanicKeySequence", "Ctrl+Alt+Cancel"), HK_PANIC);
}
void CSandMan::OnHotKey(size_t id)
@ -1131,7 +1137,7 @@ void CSandMan::OnDisableForce2()
SB_STATUS CSandMan::ConnectSbie()
{
SB_STATUS Status;
bool bJustStarted = false;
if (!CSbieUtils::IsRunning(CSbieUtils::eAll))
{
if (!CSbieUtils::IsInstalled(CSbieUtils::eAll))
@ -1151,6 +1157,7 @@ SB_STATUS CSandMan::ConnectSbie()
return SB_OK;
}
bJustStarted = true;
Status = CSbieUtils::Start(CSbieUtils::eAll);
}
@ -1158,10 +1165,16 @@ SB_STATUS CSandMan::ConnectSbie()
m_bConnectPending = true;
return SB_OK;
}
else if (!Status.IsError())
Status = ConnectSbieImpl();
return Status;
if (Status.IsError())
return Status;
if (bJustStarted) {
QTimer::singleShot(1000, [this]() {
this->ConnectSbieImpl();
});
return SB_OK;
}
return ConnectSbieImpl();
}
SB_STATUS CSandMan::ConnectSbieImpl()
@ -1622,7 +1635,7 @@ void CSandMan::OpenUrl(const QUrl& url)
if(bCheck) theConf->SetValue("Options/OpenUrlsSandboxed", iSandboxed);
}
if (iSandboxed) theAPI->RunStart("__ask__", url.toString());
if (iSandboxed) RunSandboxed(QStringList(url.toString()));
else ShellExecute(MainWndHandle, NULL, url.toString().toStdWString().c_str(), NULL, NULL, SW_SHOWNORMAL);
}

View File

@ -377,8 +377,8 @@ int CSandBoxPlus::IsLeaderProgram(const QString& ProgName)
CSandBoxPlus::EBoxTypes CSandBoxPlus::GetType() const
{
if (m_bLogApiFound)
return eHasLogApi;
//if (m_bLogApiFound)
// return eHasLogApi;
if (m_iUnsecureDebugging != 0)
return eInsecure;
if (m_bSecurityRestricted)

View File

@ -76,7 +76,7 @@ public:
{
eDefault = 0,
eHardened,
eHasLogApi,
//eHasLogApi,
eInsecure,
eUnknown = -1

View File

@ -96,15 +96,8 @@ void CSelectBoxWindow::OnRun()
//QList<SB_STATUS> Results;
foreach(const QString & Command, m_Commands)
{
QString StartCmd = "\"" + theAPI->GetStartPath() + "\"" + (ui.chkAdmin->isChecked() ? " /elevated" : "");
if (!BoxName.isEmpty())
StartCmd += " /box:" + BoxName + " ";
else
StartCmd += " /disable_force ";
StartCmd += Command;
QProcess::startDetached(StartCmd);
foreach(const QString & Command, m_Commands) {
theAPI->RunStart(BoxName, Command, NULL, ui.chkAdmin->isChecked());
}
//CSandMan::CheckResults(Results);

View File

@ -188,6 +188,7 @@ void CSettingsWindow::LoadSettings()
ui.chkSvcStart->setChecked(false);
ui.chkShellMenu->setCheckState(CSettingsWindow__IsContextMenu());
ui.chkAlwaysDefault->setChecked(theConf->GetBool("Options/RunInDefaultBox", false));
ui.chkDarkTheme->setCheckState(CSettingsWindow__Int2Chk(theConf->GetInt("Options/UseDarkTheme", 2)));
@ -198,7 +199,7 @@ void CSettingsWindow::LoadSettings()
ui.chkShowRecovery->setChecked(theConf->GetBool("Options/ShowRecovery", false));
ui.chkPanic->setChecked(theConf->GetBool("Options/EnablePanicKey", false));
ui.keyPanic->setKeySequence(QKeySequence(theConf->GetString("Options/PanicKeySequence", "Ctrl+Cancel")));
ui.keyPanic->setKeySequence(QKeySequence(theConf->GetString("Options/PanicKeySequence", "Ctrl+Alt+Cancel")));
ui.chkWatchConfig->setChecked(theConf->GetBool("Options/WatchIni", true));
@ -291,6 +292,7 @@ void CSettingsWindow::SaveSettings()
} else
CSbieUtils::RemoveContextMenu();
}
theConf->SetValue("Options/RunInDefaultBox", ui.chkAlwaysDefault->isChecked());
theConf->SetValue("Options/ShowNotifications", ui.chkNotifications->isChecked());

View File

@ -35,8 +35,9 @@ int main(int argc, char *argv[])
QStringList Args = QCoreApplication::arguments();
int BoxPos = Args.indexOf("/box:__ask__");
if (BoxPos != -1) {
CommandLine = Args[BoxPos + 1];
if(app.sendMessage("Run:" + CommandLine))
for (int i = BoxPos + 1; i < Args.count(); i++)
CommandLine += "\"" + Args[i] + "\" ";
if(app.sendMessage("Run:" + CommandLine.trimmed()))
return 0;
}
else if (app.sendMessage("ShowWnd"))

View File

@ -2,7 +2,7 @@
#define VERSION_MJR 0
#define VERSION_MIN 8
#define VERSION_REV 6
#define VERSION_REV 7
#define VERSION_UPD 0
#ifndef STR