From 8f2e3ac6abc699499136566dbd008de83dfc31de Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Sun, 12 Feb 2023 13:47:05 +0100 Subject: [PATCH] 1.7.3 --- Sandboxie/apps/control/AppPage.cpp | 22 ++++++++++++++++++++ Sandboxie/apps/control/AppPage.h | 1 + Sandboxie/apps/control/Box.cpp | 11 +++++++--- SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp | 11 ++++++++-- SandboxiePlus/QSbieAPI/SbieTrace.cpp | 11 ++++++++-- 5 files changed, 49 insertions(+), 7 deletions(-) diff --git a/Sandboxie/apps/control/AppPage.cpp b/Sandboxie/apps/control/AppPage.cpp index 48d96c7d..10d04327 100644 --- a/Sandboxie/apps/control/AppPage.cpp +++ b/Sandboxie/apps/control/AppPage.cpp @@ -1539,6 +1539,7 @@ void CAppPage::SetDefaultTemplates7(CBox &box) SetDefaultTemplates8(box); } + //--------------------------------------------------------------------------- // SetDefaultTemplates8 //--------------------------------------------------------------------------- @@ -1551,6 +1552,7 @@ void CAppPage::SetDefaultTemplates8(CBox& box) SetDefaultTemplates9(box); } + //--------------------------------------------------------------------------- // SetDefaultTemplates9 //--------------------------------------------------------------------------- @@ -1575,4 +1577,24 @@ void CAppPage::SetDefaultTemplates9(CBox& box) box.EnableTemplate(L"OpenBluetooth", TRUE); box.EnableTemplate(L"OpenSmartCard", TRUE); } + + SetDefaultTemplates10(box); +} + + +//--------------------------------------------------------------------------- +// SetDefaultTemplates10 +//--------------------------------------------------------------------------- + + +void CAppPage::SetDefaultTemplates10(CBox& box) +{ + CSbieIni &ini = CSbieIni::GetInstance(); + + BOOL bOpenProtectedStorage = FALSE; + ini.GetBool(box.GetName(), L"OpenProtectedStorage", bOpenProtectedStorage, FALSE); + if (bOpenProtectedStorage) { + ini.DelText(box.GetName(), L"OpenProtectedStorage", L"y"); + box.EnableTemplate(L"OpenProtectedStorage", TRUE); + } } diff --git a/Sandboxie/apps/control/AppPage.h b/Sandboxie/apps/control/AppPage.h index 7e0be6c0..bcd2701c 100644 --- a/Sandboxie/apps/control/AppPage.h +++ b/Sandboxie/apps/control/AppPage.h @@ -128,6 +128,7 @@ public: static void SetDefaultTemplates7(CBox &box); static void SetDefaultTemplates8(CBox& box); static void SetDefaultTemplates9(CBox& box); + static void SetDefaultTemplates10(CBox& box); }; diff --git a/Sandboxie/apps/control/Box.cpp b/Sandboxie/apps/control/Box.cpp index e8fafb7d..36b262b4 100644 --- a/Sandboxie/apps/control/Box.cpp +++ b/Sandboxie/apps/control/Box.cpp @@ -226,18 +226,23 @@ void CBox::SetDefaultSettings() int cfglvl; ini.GetNum(m_name, _ConfigLevel, cfglvl); - if (cfglvl >= 9) + if (cfglvl >= 10) return; BOOL ok = TRUE; if (cfglvl >= 1) { - ok = ini.SetNum(m_name, _ConfigLevel, 9); + ok = ini.SetNum(m_name, _ConfigLevel, 10); if (ok) { - if (cfglvl == 8) { + if (cfglvl == 9) { + + CAppPage::SetDefaultTemplates10(*this); + + } + else if (cfglvl == 8) { CAppPage::SetDefaultTemplates9(*this); diff --git a/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp b/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp index db96aab2..9bda61b7 100644 --- a/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp +++ b/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp @@ -47,7 +47,7 @@ CSandBox::CSandBox(const QString& BoxName, class CSbieAPI* pAPI) : CSbieIni(BoxN // when loading a sandbox that is not initialized, initialize it int cfglvl = GetNum("ConfigLevel"); - if (cfglvl >= 9) + if (cfglvl >= 10) return; if (cfglvl == 0) @@ -106,7 +106,14 @@ CSandBox::CSandBox(const QString& BoxName, class CSbieAPI* pAPI) : CSbieIni(BoxN } } - SetNum("ConfigLevel", 9); + if (cfglvl < 10) + { + // starting with 5.62.3 OpenProtectedStorage is a template + if(GetBool("OpenProtectedStorage")) + InsertText("Template", "OpenProtectedStorage"); + } + + SetNum("ConfigLevel", 10); } CSandBox::~CSandBox() diff --git a/SandboxiePlus/QSbieAPI/SbieTrace.cpp b/SandboxiePlus/QSbieAPI/SbieTrace.cpp index 6ac2f302..c60ae74a 100644 --- a/SandboxiePlus/QSbieAPI/SbieTrace.cpp +++ b/SandboxiePlus/QSbieAPI/SbieTrace.cpp @@ -69,6 +69,11 @@ CTraceEntry::CTraceEntry(quint64 Timestamp, quint32 ProcessId, quint32 ThreadId, m_SubType = LogData.length() > 2 ? LogData.at(2) : QString(); m_Type.Flags = Type; + if (m_Type.Type == MONITOR_SYSCALL && !m_SubType.isEmpty()) { + m_Message += ", name=" + m_SubType; + m_SubType.clear(); + } + m_TimeStamp = Timestamp ? Timestamp : QDateTime::currentDateTime().toMSecsSinceEpoch(); m_BoxPtr = 0; @@ -144,9 +149,11 @@ QString CTraceEntry::GetTypeStr() const Type.append(" / " + m_SubType); if (m_Type.User) - Type.append(" (U)"); + Type.append(" (U)"); // user mode (sbiedll.dll) + //else if (m_Type.Agent) + // Type.append(" (S)"); // system mode (sbiesvc.exe) else - Type.append(" (D)"); + Type.append(" (K)"); // kernel mode (sbiedrv.sys) return Type; }