Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Apr 11, 2021
1 parent c30ea51 commit 6c62da0
Show file tree
Hide file tree
Showing 23 changed files with 616 additions and 193 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ This project adheres to [Semantic Versioning](http://semver.org/).



## [0.7.4 / 5.49.7] - 2021-04-12

### Added
- added option to disable file migration prompt
- added UI options for variouse security isolation features
- added missing functionality to set template values in the plus UI

### Changed
- Align default settings of AutoRecover and Favorites to the Plus version (thanks isaak654)
- list of email clients and browsers is now centralized on Dll_GetImageType

### Fixed
- fixed minor issue with logging internet blocks
- fixed issue with file recovery when located on a network share
- fixed ui issue with CallTrace
- fixed crated sandbox links gettign double extension
- fixed misplaced labels in the classic ui (thanks isaak654)
- fixed separator line in Sbiectrl (thanks isaak654)



## [0.7.3 / 5.49.5] - 2021-03-27

Expand Down
6 changes: 3 additions & 3 deletions Sandboxie/apps/control/Box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void CBox::SetDefaultSettings()

if (ok)
{
ok = ini.SetBool(m_name, _AutoRecover, FALSE);
//ok = ini.SetBool(m_name, _AutoRecover, TRUE);
ok = ini.SetBool(m_name, L"BlockNetworkFiles", TRUE);
}

Expand All @@ -268,8 +268,8 @@ void CBox::SetDefaultSettings()

if (ok)
ok = AddOrRemoveQuickRecoveryFolder(L"%Desktop%", TRUE);
if (ok)
ok = AddOrRemoveQuickRecoveryFolder(L"%Favorites%", FALSE);
//if (ok)
// ok = AddOrRemoveQuickRecoveryFolder(L"%Favorites%", TRUE);
if (ok)
ok = AddOrRemoveQuickRecoveryFolder(L"%Personal%", TRUE);
if (ok && CMyApp::m_WindowsVista) {
Expand Down
4 changes: 2 additions & 2 deletions Sandboxie/common/my_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#ifndef _MY_VERSION_H
#define _MY_VERSION_H

#define MY_VERSION_BINARY 5,49,5
#define MY_VERSION_STRING "5.49.5"
#define MY_VERSION_BINARY 5,49,7
#define MY_VERSION_STRING "5.49.7"
#define MY_VERSION_COMPAT "5.49.0" // this refers to the driver ABI compatibility

// These #defines are used by either Resource Compiler, or by NSIC installer
Expand Down
4 changes: 4 additions & 0 deletions Sandboxie/core/dll/dll.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ enum {
DLL_IMAGE_OFFICE_EXCEL,
DLL_IMAGE_FLASH_PLAYER_SANDBOX,
DLL_IMAGE_PLUGIN_CONTAINER,
DLL_IMAGE_OTHER_WEB_BROWSER,
DLL_IMAGE_OTHER_MAIL_CLIENT,
DLL_IMAGE_LAST
};

Expand Down Expand Up @@ -367,6 +369,8 @@ ULONG SbieDll_MatchPath2(WCHAR path_code, const WCHAR *path, BOOLEAN bCheckObjec

void Dll_InitExeEntry(void);

ULONG Dll_GetImageType(const WCHAR* ImageName);

int Dll_NlsStrCmp(const WCHAR *s1, const WCHAR *s2, ULONG len);

void *Dll_SidStringToSid(const WCHAR *SidString);
Expand Down
58 changes: 46 additions & 12 deletions Sandboxie/core/dll/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,14 @@ _FX void Dll_InitExeEntry(void)


//---------------------------------------------------------------------------
// Dll_SelectImageType
// Dll_GetImageType
//---------------------------------------------------------------------------


_FX void Dll_SelectImageType(void)
_FX ULONG Dll_GetImageType(const WCHAR *ImageName)
{
ULONG ImageType = DLL_IMAGE_UNSPECIFIED;

//
// check for custom configured special images
//
Expand All @@ -521,14 +523,18 @@ _FX void Dll_SelectImageType(void)

*ptr++ = L'\0';

if (_wcsicmp(Dll_ImageName, ptr) == 0) {
if (_wcsicmp(ImageName, ptr) == 0) {

if (_wcsicmp(L"chrome", buf) == 0)
Dll_ImageType = DLL_IMAGE_GOOGLE_CHROME;
ImageType = DLL_IMAGE_GOOGLE_CHROME;
else if (_wcsicmp(L"firefox", buf) == 0)
Dll_ImageType = DLL_IMAGE_MOZILLA_FIREFOX;
ImageType = DLL_IMAGE_MOZILLA_FIREFOX;
else if (_wcsicmp(L"browser", buf) == 0)
ImageType = DLL_IMAGE_OTHER_WEB_BROWSER;
else if (_wcsicmp(L"mail", buf) == 0)
ImageType = DLL_IMAGE_OTHER_MAIL_CLIENT;
else
Dll_ImageType = DLL_IMAGE_LAST; // invalid type set place holder such that we keep this image uncustomized
ImageType = DLL_IMAGE_LAST; // invalid type set place holder such that we keep this image uncustomized

break;
}
Expand Down Expand Up @@ -562,7 +568,7 @@ _FX void Dll_SelectImageType(void)
L"palemoon.exe", (WCHAR *)DLL_IMAGE_MOZILLA_FIREFOX,
L"basilisk.exe", (WCHAR *)DLL_IMAGE_MOZILLA_FIREFOX,
L"seamonkey.exe", (WCHAR *)DLL_IMAGE_MOZILLA_FIREFOX,
L"k-meleon.exe", (WCHAR *)DLL_IMAGE_MOZILLA_FIREFOX,
L"k-meleon.exe", (WCHAR *)DLL_IMAGE_MOZILLA_FIREFOX,

L"wmplayer.exe", (WCHAR *)DLL_IMAGE_WINDOWS_MEDIA_PLAYER,
L"winamp.exe", (WCHAR *)DLL_IMAGE_NULLSOFT_WINAMP,
Expand All @@ -575,31 +581,59 @@ _FX void Dll_SelectImageType(void)
L"dragon.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME,
L"chrome.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME,
L"opera.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME,
L"neon.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME,
L"maxthon.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME,
L"vivaldi.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME,
L"brave.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME,
L"browser.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME,
L"msedge.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME,
L"browser.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME, // Yandex Browser
L"msedge.exe", (WCHAR *)DLL_IMAGE_GOOGLE_CHROME, // Modern Edge is Chromium-based
L"GoogleUpdate.exe", (WCHAR *)DLL_IMAGE_GOOGLE_UPDATE,

L"PuffinSecureBrowser.exe", (WCHAR *)DLL_IMAGE_OTHER_WEB_BROWSER,

L"AcroRd32.exe", (WCHAR *)DLL_IMAGE_ACROBAT_READER,
L"Acrobat.exe", (WCHAR *)DLL_IMAGE_ACROBAT_READER,
L"plugin-container.exe", (WCHAR *)DLL_IMAGE_PLUGIN_CONTAINER,
L"Outlook.exe", (WCHAR *)DLL_IMAGE_OFFICE_OUTLOOK,
L"Excel.exe", (WCHAR *)DLL_IMAGE_OFFICE_EXCEL,

L"thunderbird.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,
L"winmail.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,
L"IncMail.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,
L"eudora.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,
L"thebat32.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,
L"thebat64.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,
L"Foxmail.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,
L"Mailbird.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,
L"MailClient.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,
L"postbox.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,
L"Inky.exe", (WCHAR *)DLL_IMAGE_OTHER_MAIL_CLIENT,

NULL, NULL
};

if (Dll_ImageType == DLL_IMAGE_UNSPECIFIED) {
if (ImageType == DLL_IMAGE_UNSPECIFIED) {

for (int i = 0; _ImageNames[i]; i += 2) {
if (_wcsicmp(Dll_ImageName, _ImageNames[i]) == 0) {
Dll_ImageType = (ULONG)(ULONG_PTR)_ImageNames[i + 1];
if (_wcsicmp(ImageName, _ImageNames[i]) == 0) {
ImageType = (ULONG)(ULONG_PTR)_ImageNames[i + 1];
break;
}
}
}

return ImageType;
}

//---------------------------------------------------------------------------
// Dll_SelectImageType
//---------------------------------------------------------------------------


_FX void Dll_SelectImageType(void)
{
Dll_ImageType = Dll_GetImageType(Dll_ImageName);

if (Dll_ImageType == DLL_IMAGE_UNSPECIFIED &&
_wcsnicmp(Dll_ImageName, L"FlashPlayerPlugin_", 18) == 0)
Dll_ImageType = DLL_IMAGE_FLASH_PLAYER_SANDBOX;
Expand Down
12 changes: 8 additions & 4 deletions Sandboxie/core/dll/file_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,15 @@ _FX ULONG File_MigrateFile_GetMode(const WCHAR* TruePath, ULONGLONG file_size)
MAN_FILE_MIGRATION_RPL* rpl = NULL;
BOOLEAN ok = FALSE;

req.msgid = MAN_FILE_MIGRATION;
req.file_size = file_size;
wcscpy(req.file_path, TruePath);
if (SbieApi_QueryConfBool(NULL, L"PromptForFileMigration", TRUE))
{
req.msgid = MAN_FILE_MIGRATION;
req.file_size = file_size;
wcscpy(req.file_path, TruePath);

rpl = SbieDll_CallServerQueue(INTERACTIVE_QUEUE_NAME, &req, sizeof(req), sizeof(*rpl));
}

rpl = SbieDll_CallServerQueue(INTERACTIVE_QUEUE_NAME, &req, sizeof(req), sizeof(*rpl));
if (rpl)
{
ok = rpl->retval != 0;
Expand Down
2 changes: 1 addition & 1 deletion Sandboxie/core/dll/file_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ _FX const BOOLEAN File_InternetBlockade_ManualBypass()
Dll_Free(rpl);
}
else if(SbieApi_QueryConfBool(NULL, L"NotifyInternetAccessDenied", TRUE))
SbieApi_Log(1307, L"%s [%s]", Dll_ImageName, Dll_BoxName);
SbieApi_Log(1307, L"%S [%S]", Dll_ImageName, Dll_BoxName);

//
// Note: the granting process must notify the driver about the exemption
Expand Down
2 changes: 1 addition & 1 deletion Sandboxie/core/dll/ldr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ _FX NTSTATUS Ldr_NtLoadDriver(UNICODE_STRING *RegistryPath)
}

if (DriverName)
SbieApi_Log(2103, L"%S [%S]", DriverName, Dll_BoxName);
SbieApi_Log(2103, L"%S [%S] (NtLoadDriver)", DriverName, Dll_BoxName);
}

return status;
Expand Down
49 changes: 14 additions & 35 deletions Sandboxie/core/dll/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
// Functions
//---------------------------------------------------------------------------


static BOOL Proc_CreateProcessInternalW(
HANDLE hToken,
const WCHAR *lpApplicationName,
Expand Down Expand Up @@ -2150,6 +2149,7 @@ _FX BOOLEAN Proc_CheckMailer(const WCHAR *ImagePath, BOOLEAN IsBoxedPath)
BOOLEAN ok;
WCHAR *tmp;
const WCHAR *imgName;
ULONG imgType;

BOOLEAN should_check_openfilepath = FALSE;

Expand All @@ -2162,23 +2162,15 @@ _FX BOOLEAN Proc_CheckMailer(const WCHAR *ImagePath, BOOLEAN IsBoxedPath)
else
imgName = ImagePath;

imgType = Dll_GetImageType(imgName);

//
// check if image name matches a well-known email program
//

if (_wcsicmp(imgName, L"thunderbird.exe") == 0 ||
_wcsicmp(imgName, L"outlook.exe") == 0 ||
_wcsicmp(imgName, L"winmail.exe") == 0 ||
_wcsicmp(imgName, L"wlmail.exe") == 0 ||
_wcsicmp(imgName, L"IncMail.exe") == 0 ||
_wcsicmp(imgName, L"eudora.exe") == 0 ||
_wcsicmp(imgName, L"thebat32.exe") == 0 ||
_wcsicmp(imgName, L"thebat64.exe") == 0 ||
_wcsicmp(imgName, L"Foxmail.exe") == 0 ||
_wcsicmp(imgName, L"Mailbird.exe") == 0 ||
_wcsicmp(imgName, L"MailClient.exe") == 0 ||
_wcsicmp(imgName, L"postbox.exe") == 0 ||
_wcsicmp(imgName, L"Inky.exe") == 0 ||
if (imgType == DLL_IMAGE_OFFICE_OUTLOOK ||
imgType == DLL_IMAGE_WINDOWS_LIVE_MAIL ||
imgType == DLL_IMAGE_OTHER_MAIL_CLIENT ||
0)
{
should_check_openfilepath = TRUE;
Expand Down Expand Up @@ -2214,31 +2206,18 @@ _FX BOOLEAN Proc_CheckMailer(const WCHAR *ImagePath, BOOLEAN IsBoxedPath)
// ignore rundll32.exe, because Windows Live Mail sets
// it as the default mail program.
//
// ignore seamonkey.exe and vivaldi.exe, because they may
// only be used for browsing and not email
// ignore opera.exe, because Opera may only be used for
// browsing and not email
//
// ignore other common browsers
//

if (_wcsicmp(imgName, L"rundll32.exe") == 0 ||
_wcsicmp(imgName, L"opera.exe") == 0 ||
_wcsicmp(imgName, L"iexplore.exe") == 0 ||
_wcsicmp(imgName, L"msedge.exe") == 0 ||
_wcsicmp(imgName, L"firefox.exe") == 0 ||
_wcsicmp(imgName, L"waterfox.exe") == 0 ||
_wcsicmp(imgName, L"palemoon.exe") == 0 ||
_wcsicmp(imgName, L"basilisk.exe") == 0 ||
_wcsicmp(imgName, L"seamonkey.exe") == 0 ||
_wcsicmp(imgName, L"k-meleon.exe") == 0 ||
_wcsicmp(imgName, L"chrome.exe") == 0 ||
_wcsicmp(imgName, L"iron.exe") == 0 ||
_wcsicmp(imgName, L"dragon.exe") == 0 ||
_wcsicmp(imgName, L"maxthon.exe") == 0 ||
_wcsicmp(imgName, L"vivaldi.exe") == 0 ||
_wcsicmp(imgName, L"brave.exe") == 0 ||
_wcsicmp(imgName, L"browser.exe") == 0 ||
_wcsicmp(imgName, L"PuffinSecureBrowser.exe") == 0 ||
0 ) {
if (_wcsicmp(imgName, L"rundll32.exe") == 0 ||
imgType == DLL_IMAGE_INTERNET_EXPLORER ||
imgType == DLL_IMAGE_MOZILLA_FIREFOX ||
imgType == DLL_IMAGE_GOOGLE_CHROME ||
imgType == DLL_IMAGE_OTHER_WEB_BROWSER ||
0) {

should_check_openfilepath = FALSE;
}
Expand Down
2 changes: 1 addition & 1 deletion Sandboxie/core/dll/scm_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ _FX BOOL SbieDll_StartBoxedService(const WCHAR *ServiceName, BOOLEAN WithAdd)

if (rpl->service_status.dwServiceType & SERVICE_DRIVER) {

SbieApi_Log(2103, L"%S [%S]", ServiceName, Dll_BoxName);
SbieApi_Log(2103, L"%S [%S] (StartService)", ServiceName, Dll_BoxName);
Dll_Free(rpl);
SetLastError(ERROR_ACCESS_DENIED);
return FALSE;
Expand Down
4 changes: 3 additions & 1 deletion Sandboxie/core/drv/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,10 @@ _FX NTSTATUS Api_LogMessage(PROCESS *proc, ULONG64 *parms)
msgid = msgid - 2301 + MSG_2301;
else if (msgid == 1314)
msgid = MSG_1314;
else if (msgid == 1307)
msgid = MSG_1307;
else
msgid = MSG_2301;
msgid = MSG_2301; // unknown message

msgtext = args->msgtext.val;
if (! msgtext)
Expand Down
1 change: 1 addition & 0 deletions Sandboxie/install/Templates.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2857,6 +2857,7 @@ OpenIpcPath=*\BaseNamedObjects*\{034DBD6D-6784-4CB3-97D8-749947D01F72}
Tmpl.Title=#4305,JAWS, NVDA, Window-Eyes, System Access
Tmpl.Class=Misc
Tmpl.Scan=i
Tmpl.Hide=y
OpenIpcPath=\RPC Control\epmapper
OpenIpcPath=\RPC Control\OLE*
OpenIpcPath=\RPC Control\LRPC*
Expand Down
38 changes: 38 additions & 0 deletions SandboxiePlus/MiscHelpers/Common/CollapsibleGroupBox.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef COLLAPSIBLEGROUPBOX_H
#define COLLAPSIBLEGROUPBOX_H

#include <QGroupBox>
#include <QMap>
#include <QMargins>
#include <QPair>

class QResizeEvent;
class CollapseExpandButton;
class QSpacerItem;

class CollapsibleGroupBox : public QGroupBox
{
public:
explicit CollapsibleGroupBox(QWidget *parent = nullptr);

protected:
void resizeEvent(QResizeEvent *);

private:
void resizeCollapseButton();
void collapseLayout(QLayout *layout);
void collapseSpacer(QSpacerItem *spacer);
void expandLayout(QLayout *layout);
void expandSpacer(QSpacerItem *spacer);

CollapseExpandButton *m_clExpButton;
QMap<const void *, QMargins> m_layoutMargins;
QMap<const void *, QPair<QSize, QSizePolicy>> m_spacerSizes;

private slots:
void onScreenChanged();
void onVisibilityChanged();

};

#endif // COLLAPSIBLEGROUPBOX_H
7 changes: 5 additions & 2 deletions SandboxiePlus/MiscHelpers/Common/SettingsWidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ void CPathEdit::Browse()
QString FilePath = m_bDirs
? QFileDialog::getExistingDirectory(this, tr("Select Directory"))
: QFileDialog::getOpenFileName(0, tr("Browse"), "", QString("Any File (*.*)"));
if(!FilePath.isEmpty())
SetText(FilePath);
if (FilePath.isEmpty())
return;
if (m_bWinPath)
FilePath.replace("/", "\\");
SetText(FilePath);
}

///////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit 6c62da0

Please sign in to comment.