1.0.2
This commit is contained in:
parent
e06fe65d7d
commit
6c79c433e8
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file.
|
|||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.0.2 / 5.55.2] - 2021-12-??
|
||||
|
||||
### Added
|
||||
|
||||
### Fixed
|
||||
- fixed recovery window not refreshing count on reload [#1402](https://github.com/sandboxie-plus/Sandboxie/issues/1402)
|
||||
- fixed printing issue introdudec in 1.0.1 [#1397](https://github.com/sandboxie-plus/Sandboxie/issues/1397)
|
||||
- fixed issues with create process [#1408](https://github.com/sandboxie-plus/Sandboxie/issues/1408)
|
||||
|
||||
|
||||
|
||||
## [1.0.1 / 5.55.1] - 2021-12-06
|
||||
|
||||
### Added
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
#ifndef _MY_VERSION_H
|
||||
#define _MY_VERSION_H
|
||||
|
||||
#define MY_VERSION_BINARY 5,55,1
|
||||
#define MY_VERSION_STRING "5.55.1"
|
||||
#define MY_VERSION_BINARY 5,55,2
|
||||
#define MY_VERSION_STRING "5.55.2"
|
||||
#define MY_VERSION_COMPAT "5.55.0" // this refers to the driver ABI compatibility
|
||||
|
||||
// These #defines are used by either Resource Compiler, or by NSIC installer
|
||||
|
|
|
@ -2311,6 +2311,117 @@ __declspec(dllimport) NTSTATUS RtlCreateProcessParameters(
|
|||
UNICODE_STRING *ShellInfo,
|
||||
UNICODE_STRING *RuntimeData);
|
||||
|
||||
|
||||
// windows-internals-book:"Chapter 5"
|
||||
typedef enum _PS_CREATE_STATE
|
||||
{
|
||||
PsCreateInitialState,
|
||||
PsCreateFailOnFileOpen,
|
||||
PsCreateFailOnSectionCreate,
|
||||
PsCreateFailExeFormat,
|
||||
PsCreateFailMachineMismatch,
|
||||
PsCreateFailExeName, // Debugger specified
|
||||
PsCreateSuccess,
|
||||
PsCreateMaximumStates
|
||||
} PS_CREATE_STATE;
|
||||
|
||||
|
||||
typedef struct _PS_CREATE_INFO
|
||||
{
|
||||
SIZE_T Size;
|
||||
PS_CREATE_STATE State;
|
||||
union
|
||||
{
|
||||
// PsCreateInitialState
|
||||
struct
|
||||
{
|
||||
union
|
||||
{
|
||||
ULONG InitFlags;
|
||||
struct
|
||||
{
|
||||
UCHAR WriteOutputOnExit : 1;
|
||||
UCHAR DetectManifest : 1;
|
||||
UCHAR IFEOSkipDebugger : 1;
|
||||
UCHAR IFEODoNotPropagateKeyState : 1;
|
||||
UCHAR SpareBits1 : 4;
|
||||
UCHAR SpareBits2 : 8;
|
||||
USHORT ProhibitedImageCharacteristics : 16;
|
||||
};
|
||||
};
|
||||
ACCESS_MASK AdditionalFileAccess;
|
||||
} InitState;
|
||||
|
||||
// PsCreateFailOnSectionCreate
|
||||
struct
|
||||
{
|
||||
HANDLE FileHandle;
|
||||
} FailSection;
|
||||
|
||||
// PsCreateFailExeFormat
|
||||
struct
|
||||
{
|
||||
USHORT DllCharacteristics;
|
||||
} ExeFormat;
|
||||
|
||||
// PsCreateFailExeName
|
||||
struct
|
||||
{
|
||||
HANDLE IFEOKey;
|
||||
} ExeName;
|
||||
|
||||
// PsCreateSuccess
|
||||
struct
|
||||
{
|
||||
union
|
||||
{
|
||||
ULONG OutputFlags;
|
||||
struct
|
||||
{
|
||||
UCHAR ProtectedProcess : 1;
|
||||
UCHAR AddressSpaceOverride : 1;
|
||||
UCHAR DevOverrideEnabled : 1; // from Image File Execution Options
|
||||
UCHAR ManifestDetected : 1;
|
||||
UCHAR ProtectedProcessLight : 1;
|
||||
UCHAR SpareBits1 : 3;
|
||||
UCHAR SpareBits2 : 8;
|
||||
USHORT SpareBits3 : 16;
|
||||
};
|
||||
};
|
||||
HANDLE FileHandle;
|
||||
HANDLE SectionHandle;
|
||||
ULONGLONG UserProcessParametersNative;
|
||||
ULONG UserProcessParametersWow64;
|
||||
ULONG CurrentParameterFlags;
|
||||
ULONGLONG PebAddressNative;
|
||||
ULONG PebAddressWow64;
|
||||
ULONGLONG ManifestAddress;
|
||||
ULONG ManifestSize;
|
||||
} SuccessState;
|
||||
};
|
||||
} PS_CREATE_INFO, *PPS_CREATE_INFO;
|
||||
|
||||
|
||||
|
||||
typedef struct _PS_ATTRIBUTE
|
||||
{
|
||||
ULONG_PTR Attribute;
|
||||
SIZE_T Size;
|
||||
union
|
||||
{
|
||||
ULONG_PTR Value;
|
||||
PVOID ValuePtr;
|
||||
};
|
||||
PSIZE_T ReturnLength;
|
||||
} PS_ATTRIBUTE, *PPS_ATTRIBUTE;
|
||||
|
||||
typedef struct _PS_ATTRIBUTE_LIST
|
||||
{
|
||||
SIZE_T TotalLength;
|
||||
PS_ATTRIBUTE Attributes[1];
|
||||
} PS_ATTRIBUTE_LIST, *PPS_ATTRIBUTE_LIST;
|
||||
|
||||
|
||||
__declspec(dllimport) NTSTATUS __stdcall NtCreateJobObject(
|
||||
OUT PHANDLE JobHandle,
|
||||
IN ACCESS_MASK DesiredAccess,
|
||||
|
|
|
@ -411,6 +411,7 @@
|
|||
<ClInclude Include="..\..\common\pool.h" />
|
||||
<ClInclude Include="..\..\common\rbtree.h" />
|
||||
<ClInclude Include="..\..\common\stream.h" />
|
||||
<ClInclude Include="..\..\common\win32_ntddk.h" />
|
||||
<ClInclude Include="advapi.h" />
|
||||
<ClInclude Include="debug.h" />
|
||||
<ClInclude Include="dll.h" />
|
||||
|
|
|
@ -280,6 +280,9 @@
|
|||
<ClInclude Include="..\..\common\ntproto.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\common\win32_ntddk.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="resource.rc" />
|
||||
|
|
|
@ -593,7 +593,7 @@ _FX ULONG SbieDll_MatchPath2(WCHAR path_code, const WCHAR *path, BOOLEAN bCheckO
|
|||
//if (patsrc) *patsrc = curpat;
|
||||
|
||||
mp_flags = 0;
|
||||
if (!use_rule_specificity) goto finish;
|
||||
// dont goto finish as open can overwrite this
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -610,7 +610,6 @@ _FX ULONG SbieDll_MatchPath2(WCHAR path_code, const WCHAR *path, BOOLEAN bCheckO
|
|||
//if (patsrc) *patsrc = curpat;
|
||||
|
||||
mp_flags = PATH_OPEN_FLAG;
|
||||
if (!use_rule_specificity) goto finish;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -99,6 +99,19 @@ static NTSTATUS Proc_RtlCreateProcessParametersEx(
|
|||
UNICODE_STRING *RuntimeData,
|
||||
void *UnknownParameter11);
|
||||
|
||||
static NTSTATUS Proc_NtCreateUserProcess(
|
||||
_Out_ PHANDLE ProcessHandle,
|
||||
_Out_ PHANDLE ThreadHandle,
|
||||
_In_ ACCESS_MASK ProcessDesiredAccess,
|
||||
_In_ ACCESS_MASK ThreadDesiredAccess,
|
||||
_In_opt_ POBJECT_ATTRIBUTES ProcessObjectAttributes,
|
||||
_In_opt_ POBJECT_ATTRIBUTES ThreadObjectAttributes,
|
||||
_In_ ULONG ProcessFlags, // PROCESS_CREATE_FLAGS_*
|
||||
_In_ ULONG ThreadFlags, // THREAD_CREATE_FLAGS_*
|
||||
_In_opt_ PVOID ProcessParameters, // PRTL_USER_PROCESS_PARAMETERS
|
||||
_Inout_ PPS_CREATE_INFO CreateInfo,
|
||||
_In_opt_ PPS_ATTRIBUTE_LIST AttributeList);
|
||||
|
||||
static BOOL Proc_CreateProcessWithTokenW(
|
||||
HANDLE hToken,
|
||||
ULONG dwLogonFlags,
|
||||
|
@ -196,6 +209,19 @@ typedef NTSTATUS (*P_RtlCreateProcessParametersEx)(
|
|||
UNICODE_STRING *RuntimeData,
|
||||
void *UnknownParameter11);
|
||||
|
||||
typedef NTSTATUS (*P_NtCreateUserProcess)(
|
||||
_Out_ PHANDLE ProcessHandle,
|
||||
_Out_ PHANDLE ThreadHandle,
|
||||
_In_ ACCESS_MASK ProcessDesiredAccess,
|
||||
_In_ ACCESS_MASK ThreadDesiredAccess,
|
||||
_In_opt_ POBJECT_ATTRIBUTES ProcessObjectAttributes,
|
||||
_In_opt_ POBJECT_ATTRIBUTES ThreadObjectAttributes,
|
||||
_In_ ULONG ProcessFlags, // PROCESS_CREATE_FLAGS_*
|
||||
_In_ ULONG ThreadFlags, // THREAD_CREATE_FLAGS_*
|
||||
_In_opt_ PVOID ProcessParameters, // PRTL_USER_PROCESS_PARAMETERS
|
||||
_Inout_ PPS_CREATE_INFO CreateInfo,
|
||||
_In_opt_ PPS_ATTRIBUTE_LIST AttributeList);
|
||||
|
||||
typedef void (*P_ExitProcess)(UINT ExitCode);
|
||||
|
||||
typedef UINT (*P_WinExec)(LPCSTR lpCmdLine, UINT uCmdShow);
|
||||
|
@ -254,7 +280,9 @@ static P_CreateProcessInternal __sys_CreateProcessInternalW = NULL;
|
|||
static P_CreateProcessWithTokenW __sys_CreateProcessWithTokenW = NULL;
|
||||
|
||||
static P_RtlCreateProcessParametersEx
|
||||
__sys_RtlCreateProcessParametersEx = NULL;
|
||||
__sys_RtlCreateProcessParametersEx = NULL;
|
||||
|
||||
static P_NtCreateUserProcess __sys_NtCreateUserProcess = NULL;
|
||||
|
||||
static P_ExitProcess __sys_ExitProcess = NULL;
|
||||
|
||||
|
@ -323,8 +351,12 @@ _FX BOOLEAN Proc_Init(void)
|
|||
P_RtlCreateProcessParametersEx RtlCreateProcessParametersEx =
|
||||
(P_RtlCreateProcessParametersEx) GetProcAddress(
|
||||
Dll_Ntdll, "RtlCreateProcessParametersEx");
|
||||
|
||||
SBIEDLL_HOOK(Proc_,RtlCreateProcessParametersEx);
|
||||
|
||||
P_NtCreateUserProcess NtCreateUserProcess =
|
||||
(P_NtCreateUserProcess) GetProcAddress(
|
||||
Dll_Ntdll, "NtCreateUserProcess");
|
||||
SBIEDLL_HOOK(Proc_,NtCreateUserProcess);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1733,6 +1765,96 @@ _FX NTSTATUS Proc_RtlCreateProcessParametersEx(
|
|||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Proc_NtCreateUserProcess
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
_FX NTSTATUS Proc_NtCreateUserProcess(
|
||||
_Out_ PHANDLE ProcessHandle,
|
||||
_Out_ PHANDLE ThreadHandle,
|
||||
_In_ ACCESS_MASK ProcessDesiredAccess,
|
||||
_In_ ACCESS_MASK ThreadDesiredAccess,
|
||||
_In_opt_ POBJECT_ATTRIBUTES ProcessObjectAttributes,
|
||||
_In_opt_ POBJECT_ATTRIBUTES ThreadObjectAttributes,
|
||||
_In_ ULONG ProcessFlags, // PROCESS_CREATE_FLAGS_*
|
||||
_In_ ULONG ThreadFlags, // THREAD_CREATE_FLAGS_*
|
||||
_In_opt_ PVOID ProcessParameters, // PRTL_USER_PROCESS_PARAMETERS
|
||||
_Inout_ PPS_CREATE_INFO CreateInfo,
|
||||
_In_opt_ PPS_ATTRIBUTE_LIST AttributeList)
|
||||
{
|
||||
NTSTATUS status;
|
||||
UNICODE_STRING objname;
|
||||
|
||||
ULONG ImageNameIndex = -1;
|
||||
for (SIZE_T i = 0; i < AttributeList->TotalLength; i++) {
|
||||
if (AttributeList->Attributes[i].Attribute == 0x00020005) { // PsAttributeValue(PsAttributeImageName, FALSE, TRUE, FALSE);
|
||||
ImageNameIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ImageNameIndex != -1) {
|
||||
|
||||
objname.Buffer = (WCHAR*)AttributeList->Attributes[ImageNameIndex].Value;
|
||||
objname.Length = (USHORT)AttributeList->Attributes[ImageNameIndex].Size;
|
||||
objname.MaximumLength = objname.Length + sizeof(wchar_t);
|
||||
|
||||
WCHAR *TruePath;
|
||||
WCHAR *CopyPath;
|
||||
ULONG FileFlags;
|
||||
if (NT_SUCCESS(File_GetName(NULL, &objname, &TruePath, &CopyPath, &FileFlags))) {
|
||||
|
||||
HANDLE FileHandle;
|
||||
OBJECT_ATTRIBUTES objattrs;
|
||||
UNICODE_STRING objname2;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
|
||||
RtlInitUnicodeString(&objname2, CopyPath);
|
||||
InitializeObjectAttributes(
|
||||
&objattrs, &objname2, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
||||
|
||||
extern P_NtCreateFile __sys_NtCreateFile;
|
||||
status = __sys_NtCreateFile(
|
||||
&FileHandle, FILE_GENERIC_READ, &objattrs,
|
||||
&IoStatusBlock, NULL, 0, FILE_SHARE_READ,
|
||||
FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0);
|
||||
|
||||
if (NT_SUCCESS(status)) {
|
||||
|
||||
if (SbieDll_TranslateNtToDosPath(CopyPath)) {
|
||||
wmemmove(CopyPath + 4, CopyPath, wcslen(CopyPath) + sizeof(WCHAR));
|
||||
wmemcpy(CopyPath, L"\\??\\", 4);
|
||||
|
||||
AttributeList->Attributes[ImageNameIndex].Value = CopyPath;
|
||||
AttributeList->Attributes[ImageNameIndex].Size = wcslen(CopyPath) * sizeof(WCHAR);
|
||||
}
|
||||
|
||||
NtClose(FileHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
status = __sys_NtCreateUserProcess(ProcessHandle,
|
||||
ThreadHandle,
|
||||
ProcessDesiredAccess,
|
||||
ThreadDesiredAccess,
|
||||
ProcessObjectAttributes,
|
||||
ThreadObjectAttributes,
|
||||
ProcessFlags,
|
||||
ThreadFlags,
|
||||
ProcessParameters,
|
||||
CreateInfo,
|
||||
AttributeList);
|
||||
|
||||
if (ImageNameIndex != -1) {
|
||||
AttributeList->Attributes[ImageNameIndex].Value = objname.Buffer;
|
||||
AttributeList->Attributes[ImageNameIndex].Size = objname.Length;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Proc_CreateProcessWithTokenW
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -381,10 +381,10 @@ _FX NTSTATUS Process_Api_QueryInfo(PROCESS *proc, ULONG64 *parms)
|
|||
if (proc->open_all_win_classes)
|
||||
flags |= SBIE_FLAG_OPEN_ALL_WIN_CLASS;
|
||||
|
||||
if (proc->use_rule_specificity)
|
||||
flags |= SBIE_FLAG_RULE_SPECIFICITY;
|
||||
if (proc->use_privacy_mode)
|
||||
flags |= SBIE_FLAG_PRIVACY_MODE;
|
||||
//if (proc->use_rule_specificity)
|
||||
// flags |= SBIE_FLAG_RULE_SPECIFICITY;
|
||||
//if (proc->use_privacy_mode)
|
||||
// flags |= SBIE_FLAG_PRIVACY_MODE;
|
||||
if (proc->bAppCompartment)
|
||||
flags |= SBIE_FLAG_APP_COMPARTMENT;
|
||||
}
|
||||
|
|
|
@ -893,7 +893,7 @@ _FX int Process_MatchPathList(
|
|||
// Process_MatchPathEx
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifdef USE_MATCH_PATH_EX
|
||||
_FX ULONG Process_MatchPathEx(
|
||||
PROCESS *proc, const WCHAR *path, ULONG path_len, WCHAR path_code,
|
||||
LIST *normal_list,
|
||||
|
@ -1038,7 +1038,7 @@ _FX ULONG Process_MatchPathEx(
|
|||
if (patsrc) *patsrc = curpat;
|
||||
|
||||
mp_flags = TRUE_PATH_READ_FLAG | COPY_PATH_OPEN_FLAG;
|
||||
if (!proc->use_rule_specificity) goto finish;
|
||||
// dont goto finish as open can overwrite this
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1056,7 +1056,6 @@ _FX ULONG Process_MatchPathEx(
|
|||
if (patsrc) *patsrc = curpat;
|
||||
|
||||
mp_flags = TRUE_PATH_OPEN_FLAG;
|
||||
if (!proc->use_rule_specificity) goto finish;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1066,7 +1065,7 @@ finish:
|
|||
|
||||
return mp_flags;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Process_GetProcessName
|
||||
|
|
|
@ -20,7 +20,7 @@ CRecoveryWindow::CRecoveryWindow(const CSandBoxPtr& pBox, QWidget *parent)
|
|||
flags |= Qt::CustomizeWindowHint;
|
||||
//flags &= ~Qt::WindowContextHelpButtonHint;
|
||||
//flags &= ~Qt::WindowSystemMenuHint;
|
||||
//flags &= ~Qt::WindowMinMaxButtonsHint;
|
||||
flags |= Qt::WindowMinMaxButtonsHint;
|
||||
flags |= Qt::WindowMinimizeButtonHint;
|
||||
//flags &= ~Qt::WindowCloseButtonHint;
|
||||
setWindowFlags(flags);
|
||||
|
@ -459,6 +459,8 @@ void CRecoveryWindow::RecoverFiles(bool bBrowse, QString RecoveryFolder)
|
|||
void CRecoveryWindow::OnCount(quint32 fileCount, quint32 folderCount, quint64 totalSize)
|
||||
{
|
||||
ui.lblInfo->setText(tr("There are %1 files and %2 folders in the sandbox, occupying %3 of disk space.").arg(fileCount).arg(folderCount).arg(FormatSize(totalSize)));
|
||||
m_pCounter->deleteLater();
|
||||
m_pCounter = NULL;
|
||||
}
|
||||
|
||||
void CRecoveryWindow::OnCloseUntil()
|
||||
|
@ -500,7 +502,7 @@ void CRecoveryCounter::run()
|
|||
}
|
||||
}
|
||||
|
||||
emit Count(fileCount, folderCount, totalSize);
|
||||
|
||||
} while (!Folders.isEmpty());
|
||||
|
||||
emit Count(fileCount, folderCount, totalSize);
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#define VERSION_MJR 1
|
||||
#define VERSION_MIN 0
|
||||
#define VERSION_REV 1
|
||||
#define VERSION_REV 2
|
||||
#define VERSION_UPD 0
|
||||
|
||||
#ifndef STR
|
||||
|
|
Loading…
Reference in New Issue