diff --git a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui index 945eb860..4ce7593c 100644 --- a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui @@ -45,7 +45,7 @@ QTabWidget::North - 0 + 10 @@ -3369,7 +3369,7 @@ The process match level has a higher priority than the specificity and describes - 0 + 5 @@ -4051,14 +4051,35 @@ Note: Forced Programs and Force Folders settings for a sandbox do not apply to - - + + - API call trace (requires LogAPI to be installed in the Sbie directory) + Network Firewall - + + + + Disable Resource Access Monitor + + + + + + + + 75 + true + true + + + + Resource Access Monitor + + + + Qt::Horizontal @@ -4071,6 +4092,33 @@ Note: Forced Programs and Force Folders settings for a sandbox do not apply to + + + + File Trace + + + + + + + Ntdll syscall Trace (creates a lot of output) + + + + + + + + 20 + 16777215 + + + + + + + @@ -4078,27 +4126,7 @@ Note: Forced Programs and Force Folders settings for a sandbox do not apply to - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Log all SetError's to Trace log (creates a lot of output) - - - - + Qt::Horizontal @@ -4138,26 +4166,32 @@ instead of "*". - - + + - Ntdll syscall Trace (creates a lot of output) + Key Trace - - + + - File Trace + COM Class Trace - - - - Disable Resource Access Monitor + + + + Qt::Vertical - + + + 20 + 40 + + + @@ -4166,40 +4200,6 @@ instead of "*". - - - - GUI Trace - - - - - - - - 75 - true - true - - - - Resource Access Monitor - - - - - - - - 20 - 16777215 - - - - - - - @@ -4214,24 +4214,17 @@ instead of "*". - - + + - COM Class Trace + Log all SetError's to Trace log (creates a lot of output) - - + + - Key Trace - - - - - - - Network Firewall + GUI Trace diff --git a/SandboxiePlus/SandMan/SbiePlusAPI.cpp b/SandboxiePlus/SandMan/SbiePlusAPI.cpp index 3512b9c0..c21ca26b 100644 --- a/SandboxiePlus/SandMan/SbiePlusAPI.cpp +++ b/SandboxiePlus/SandMan/SbiePlusAPI.cpp @@ -121,7 +121,6 @@ void CSbiePlusAPI::OnStartFinished() CSandBoxPlus::CSandBoxPlus(const QString& BoxName, class CSbieAPI* pAPI) : CSandBox(BoxName, pAPI) { - m_bLogApiFound = false; m_bINetBlocked = false; m_bINetExceptions = false; m_bSharesAllowed = false; @@ -321,16 +320,6 @@ SB_PROGRESS CSandBoxPlus::ImportBox(const QString& FileName) void CSandBoxPlus::UpdateDetails() { - //m_bLogApiFound = GetTextList("OpenPipePath", false).contains("\\Device\\NamedPipe\\LogAPI"); - m_bLogApiFound = false; - QStringList InjectDlls = GetTextList("InjectDll", false); - foreach(const QString & InjectDll, InjectDlls) { - if (InjectDll.contains("logapi", Qt::CaseInsensitive)) { - m_bLogApiFound = true; - break; - } - } - m_bINetBlocked = false; foreach(const QString& Entry, GetTextList("ClosedFilePath", false)) { if (Entry == "!,InternetAccessDevices") { @@ -703,8 +692,6 @@ QString CSandBoxPlus::GetStatusStr() const if(m_bPrivacyEnhanced) Status.append(tr("Privacy Enhanced")); - if (m_bLogApiFound) - Status.append(tr("API Log")); if (m_bINetBlocked) { if(m_bINetExceptions) Status.append(tr("No INet (with Exceptions)")); @@ -747,29 +734,6 @@ CSandBoxPlus::EBoxTypes CSandBoxPlus::GetTypeImpl() const return eDefault; } -void CSandBoxPlus::SetLogApi(bool bEnable) -{ - if (bEnable) - { - //InsertText("OpenPipePath", "\\Device\\NamedPipe\\LogAPI"); - InsertText("InjectDll", "\\LogAPI\\logapi32.dll"); - InsertText("InjectDll64", "\\LogAPI\\logapi64.dll"); -#ifdef _M_ARM64 - InsertText("InjectDllARM64", "\\LogAPI\\logapi64a.dll"); -#endif - } - else - { - //DelValue("OpenPipePath", "\\Device\\NamedPipe\\LogAPI"); - DelValue("InjectDll", "\\LogAPI\\logapi32.dll"); - DelValue("InjectDll64", "\\LogAPI\\logapi64.dll"); -#ifdef _M_ARM64 - DelValue("InjectDllARM64", "\\LogAPI\\logapi64a.dll"); -#endif - } - m_bLogApiFound = bEnable; -} - void CSandBoxPlus::SetINetBlock(bool bEnable) { if (bEnable) { diff --git a/SandboxiePlus/SandMan/SbiePlusAPI.h b/SandboxiePlus/SandMan/SbiePlusAPI.h index ccc6bf25..51d307c9 100644 --- a/SandboxiePlus/SandMan/SbiePlusAPI.h +++ b/SandboxiePlus/SandMan/SbiePlusAPI.h @@ -95,8 +95,6 @@ public: virtual QString GetStatusStr() const; - virtual void SetLogApi(bool bEnable); - virtual bool HasLogApi() const { return m_bLogApiFound; } virtual void SetINetBlock(bool bEnable); virtual bool IsINetBlocked() const { return m_bINetBlocked; } @@ -216,7 +214,6 @@ protected: QList> m_JobQueue; - bool m_bLogApiFound; bool m_bINetBlocked; bool m_bINetExceptions; bool m_bSharesAllowed; diff --git a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp index bada3a76..d506c715 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp @@ -76,7 +76,6 @@ void COptionsWindow::CreateAdvanced() connect(ui.chkGuiTrace, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkComTrace, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkNetFwTrace, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); - connect(ui.chkApiTrace, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkDbgTrace, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkErrTrace, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); @@ -154,12 +153,6 @@ void COptionsWindow::LoadAdvanced() ReadAdvancedCheck("NetFwTrace", ui.chkNetFwTrace, "*"); ui.chkDbgTrace->setChecked(m_pBox->GetBool("DebugTrace", false)); ui.chkErrTrace->setChecked(m_pBox->GetBool("ErrorTrace", false)); - QSharedPointer pBoxPlus = m_pBox.objectCast(); - if (pBoxPlus) { - QString logApiPath = theAPI->GetSbiePath() + "\\LogAPI\\logapi32.dll"; - ui.chkApiTrace->setVisible(QFile::exists(logApiPath)); - ui.chkApiTrace->setChecked(pBoxPlus->HasLogApi()); - } // triggers ui.treeTriggers->clear(); @@ -294,9 +287,6 @@ void COptionsWindow::SaveAdvanced() WriteAdvancedCheck(ui.chkNetFwTrace, "NetFwTrace", "*"); WriteAdvancedCheck(ui.chkDbgTrace, "DebugTrace", "y"); WriteAdvancedCheck(ui.chkErrTrace, "ErrorTrace", "y"); - QSharedPointer pBoxPlus = m_pBox.objectCast(); - if (pBoxPlus && ui.chkApiTrace->isVisible()) - pBoxPlus->SetLogApi(ui.chkApiTrace->isChecked()); // triggers QStringList StartProgram; diff --git a/SandboxieTools/Common/helpers.cpp b/SandboxieTools/Common/helpers.cpp index 6fdd35ab..7bc03aa6 100644 --- a/SandboxieTools/Common/helpers.cpp +++ b/SandboxieTools/Common/helpers.cpp @@ -88,6 +88,29 @@ std::wstring hexStr(unsigned char* data, int len) return s; } + +std::wstring MkLower(std::wstring Str) +{ + for(std::wstring::size_type i = 0; i < Str.size(); i++) + { + std::wstring::value_type &Char = Str.at(i); + if((Char >= L'A') && (Char <= L'Z')) + Char += 32; + } + return Str; +} + +std::wstring MkUpper(std::wstring Str) +{ + for(std::wstring::size_type i = 0; i < Str.size(); i++) + { + std::wstring::value_type &Char = Str.at(i); + if((Char >= L'a') && (Char <= L'z')) + Char -= 32; + } + return Str; +} + bool FileExists(const wchar_t* path) { if (GetFileAttributes(path) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND) diff --git a/SandboxieTools/Common/helpers.h b/SandboxieTools/Common/helpers.h index 1dbd5f29..3970f113 100644 --- a/SandboxieTools/Common/helpers.h +++ b/SandboxieTools/Common/helpers.h @@ -38,6 +38,8 @@ extern std::wstring_convert> g_str_conv; bool ListDir(std::wstring Path, std::vector& Entries); std::wstring hexStr(unsigned char* data, int len); +std::wstring MkLower(std::wstring Str); +std::wstring MkUpper(std::wstring Str); template T Trimmx(const T& String, const T& Blank) diff --git a/SandboxieTools/UpdUtil/UpdUtil.cpp b/SandboxieTools/UpdUtil/UpdUtil.cpp index 013537b8..f56aad91 100644 --- a/SandboxieTools/UpdUtil/UpdUtil.cpp +++ b/SandboxieTools/UpdUtil/UpdUtil.cpp @@ -817,7 +817,7 @@ std::shared_ptr ReadAddons(const JSONObject& jsonObject, const std::w std::shared_ptr pAddon = ReadAddon(addon, core_arch, agent_arch, framework); - (*pAddons)[pAddon->Id] = pAddon; + (*pAddons)[MkLower(pAddon->Id)] = pAddon; } } @@ -1470,7 +1470,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, for (auto I = add_addons.begin(); I != add_addons.end(); ++I) { - auto F = pAddons->find(*I); + auto F = pAddons->find(MkLower(*I)); if (F != pAddons->end()) { std::wcout << L"Downloading addon " << *I << std::endl; ret = DownloadAddon(F->second, step, temp_dir, base_dir); @@ -1482,7 +1482,12 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, if (ret >= 0 && (step.empty() || step == L"apply")) { - std::wcout << L"Installing addon " << *I << std::endl; + std::shared_ptr pAddon = LoadAddon(base_dir, *I); + if (pAddon && !pAddon->InstallPath.empty()) { + std::wcout << L"Updating addon " << *I << std::endl; + RemoveAddon(pAddon, base_dir); + } else + std::wcout << L"Installing addon " << *I << std::endl; ret = InstallAddon(F->second, temp_dir, base_dir); // register addon