Skip to content

Commit 3570809

Browse files
committed
submit 5.5.1.1
1 parent cc0ce35 commit 3570809

40 files changed

+772
-149
lines changed

Diff for: AutoEncryptDemo.exe

504 Bytes
Binary file not shown.

Diff for: AutoFileCryptTool.exe

-8 Bytes
Binary file not shown.

Diff for: Bin/arm64/FilterAPI.dll

-16 Bytes
Binary file not shown.

Diff for: Bin/win32/EaseFlt.sys

2.02 KB
Binary file not shown.

Diff for: Bin/win32/FilterAPI.dll

-16 Bytes
Binary file not shown.

Diff for: Bin/win32/FilterAPI.lib

1.59 KB
Binary file not shown.

Diff for: Bin/x64/EaseFlt.sys

3.48 KB
Binary file not shown.

Diff for: Bin/x64/FilterAPI.dll

1.99 KB
Binary file not shown.

Diff for: Bin/x64/FilterAPI.lib

1.56 KB
Binary file not shown.

Diff for: CommonObjects.dll

1016 Bytes
Binary file not shown.

Diff for: Demo_Source_Code/CPlusPlusDemo/CPlusPlusDemo.cpp

+40-28
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ int _tmain(int argc, _TCHAR* argv[])
194194
allPostIO |= POST_SET_INFORMATION|POST_DIRECTORY|POST_QUERY_SECURITY|POST_SET_SECURITY|POST_CLEANUP|POST_CLOSE;
195195

196196
WCHAR* fileFilterMask = L"c:\\test\\*";
197-
ULONG ioCallbackClass = allPostIO;
197+
ULONGLONG ioCallbackClass = allPostIO;
198198
ULONG accessFlag = ALLOW_MAX_RIGHT_ACCESS;
199199

200200
if (argc >= 3)
@@ -244,7 +244,8 @@ int _tmain(int argc, _TCHAR* argv[])
244244
fileFilterRule.ControlFileIOEventFilter = ioCallbackClass;
245245

246246
//You can allow/block the file rename/delete in the callback handler by register PRE_RENAME_FILE|PRE_DELETE_FILE.
247-
//fileFilterRule.ControlFileIOEventFilter = PRE_CREATE|PRE_RENAME_FILE|PRE_DELETE_FILE;
247+
//ULONGLONG preIOCallbackClass = PRE_RENAME_FILE|PRE_DELETE_FILE;
248+
//fileFilterRule.ControlFileIOEventFilter = preIOCallbackClass;
248249

249250
//disable the file being renamed, deleted and written access rights.
250251
ULONG processAccessRights = accessFlag & (~(ALLOW_FILE_RENAME|ALLOW_FILE_DELETE|ALLOW_WRITE_ACCESS));
@@ -258,7 +259,7 @@ int _tmain(int argc, _TCHAR* argv[])
258259

259260
//Register the volume event notification with volume control setting.
260261
//you can block the USB read with flag BLOCK_USB_READ or write with flag BLOCK_USB_WRITE.
261-
filterControl->VolumeControlSettings = BLOCK_USB_READ|BLOCK_USB_WRITE;
262+
//filterControl->VolumeControlSettings = BLOCK_USB_READ|BLOCK_USB_WRITE;
262263

263264
//you can get the block message notification by the access flag with below setting.
264265
//set global boolean config
@@ -284,7 +285,7 @@ int _tmain(int argc, _TCHAR* argv[])
284285

285286
getchar();
286287

287-
//the process can be termiated now.
288+
//the process can be terminated now.
288289
//RemoveProtectedProcessId(GetCurrentProcessId());
289290

290291
break;
@@ -295,47 +296,58 @@ int _tmain(int argc, _TCHAR* argv[])
295296

296297
UnInstallDriver();
297298
Sleep(2000);
298-
299-
ret = InstallDriver();
300-
if( !ret )
299+
300+
ret = InstallDriver();
301+
if (!ret)
301302
{
302-
PrintLastErrorMessage( L"InstallDriver failed.");
303+
PrintLastErrorMessage(L"InstallDriver failed.");
303304
break;
304305
}
305306

306307
WCHAR* fileFilterMask = L"c:\\test\\*";
307-
ULONG ioRegistration = 0;
308-
ULONG accessFlag = ALLOW_MAX_RIGHT_ACCESS|ENABLE_FILE_ENCRYPTION_RULE;
309-
310-
filterType = FILE_SYSTEM_ENCRYPTION;
311308

312-
if( argc >= 3 )
309+
if (argc >= 3)
313310
{
314311
fileFilterMask = argv[2];
315-
}
316-
312+
}
313+
314+
//by default all users/processes will get the raw encrypted data
315+
//it meant by default all users/processes are in blacklist
316+
ULONG accessFlag = (ALLOW_MAX_RIGHT_ACCESS | ENABLE_FILE_ENCRYPTION_RULE) & (~ALLOW_READ_ENCRYPTED_FILES);
317+
318+
//by default all users/processes will get the decrypted data
319+
//it meant by default all users/processes are in whitelist
320+
//ULONG accessFlag = (ALLOW_MAX_RIGHT_ACCESS | ENABLE_FILE_ENCRYPTION_RULE);
321+
322+
filterType = FILE_SYSTEM_ENCRYPTION | FILE_SYSTEM_PROCESS;
323+
317324
FileFilterRule fileFilterRule(fileFilterMask);
318325
fileFilterRule.AccessFlag = accessFlag;
319326

320327
//if we enable the encryption key from service, you can authorize the decryption for every file
321-
//in the callback function OnFilterRequestEncryptKey, with this flag enabled, you don't need to set the encryption key.
328+
//in the callback function OnFilterRequestEncryptKey, with this flag enabled, you don't need to set the encryption key.
322329
//fileFilterRule.BooleanConfig |= REQUEST_ENCRYPT_KEY_IV_AND_TAGDATA_FROM_SERVICE;
323330

324331
//if you have a master key, you can set it here, or if you want to get the encryption key from the callback function then don't set the key here.
325-
//256 bit,32bytes encrytpion key
326-
unsigned char key[] = {0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe,0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81,0x1f,0x35,0x2c,0x07,0x3b,0x61,0x08,0xd7,0x2d,0x98,0x10,0xa3,0x09,0x14,0xdf,0xf4};
327-
if(!fileFilterRule.set_EncryptionKey(key,sizeof(key)))
332+
//256 bit,32bytes encryption key
333+
unsigned char key[] = { 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe,0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81,0x1f,0x35,0x2c,0x07,0x3b,0x61,0x08,0xd7,0x2d,0x98,0x10,0xa3,0x09,0x14,0xdf,0xf4 };
334+
if (!fileFilterRule.set_EncryptionKey(key, sizeof(key)))
328335
{
329336
break;
330337
}
331338

332-
//get raw encrypted data access rights.
333-
ULONG rawEncryptionRights = accessFlag & (~ALLOW_READ_ENCRYPTED_FILES);
334-
//disable the explorer to read encrypted file, explorer will get the raw encrypted data.
335-
//so you can copy the encrypted file to other place in Windows explorer, the file will be kept encrypted.
336-
//this feature requires the process filter driver feature, it need to enable the process filter driver.
337-
filterType |= FILE_SYSTEM_PROCESS;
338-
fileFilterRule.AddAccessRightsToProcessName(L"explorer.exe", rawEncryptionRights);
339+
//set the blacklist of the process, if the default filter rule is whitelist to all users/processes.
340+
//ULONG rawEncryptionRights = ALLOW_MAX_RIGHT_ACCESS & (~ALLOW_READ_ENCRYPTED_FILES);
341+
//fileFilterRule.AddAccessRightsToProcessName(L"explorer.exe", rawEncryptionRights);
342+
343+
//set the whitelist for the user "AzureAD\\Alice"
344+
//fileFilterRule.AddAccessRightsToUserName(L"AzureAD\\Alice", ALLOW_MAX_RIGHT_ACCESS);
345+
346+
//set the whitelist for the process "wordpad.exe"
347+
fileFilterRule.AddAccessRightsToProcessName(L"wordpad.exe", ALLOW_MAX_RIGHT_ACCESS);
348+
349+
//set the whitelist for the process "notepad.exe"
350+
fileFilterRule.AddAccessRightsToProcessName(L"notepad.exe", ALLOW_MAX_RIGHT_ACCESS);
339351

340352
filterControl->AddFileFilter(fileFilterRule);
341353

@@ -368,7 +380,7 @@ int _tmain(int argc, _TCHAR* argv[])
368380

369381

370382
WCHAR* processFilterMask = L"*";
371-
ULONG controlFlag = PROCESS_CREATION_NOTIFICATION|PROCESS_TERMINATION_NOTIFICATION|THREAD_CREATION_NOTIFICATION|THREAD_TERMINIATION_NOTIFICATION;
383+
ULONG controlFlag = PROCESS_CREATION_NOTIFICATION|PROCESS_TERMINATION_NOTIFICATION|THREAD_CREATION_NOTIFICATION|THREAD_TERMINATION_NOTIFICATION;
372384

373385
//if you want to block the application in c:\test folder to be launched, you can use below setting:
374386
//controlFlag = DENY_NEW_PROCESS_CREATION;
@@ -448,7 +460,7 @@ int _tmain(int argc, _TCHAR* argv[])
448460
registryFilterRule.RegistryKeyNameFilterMask = keyNameFilterMask;
449461

450462
//you can block the registry key being renamed/deleted/created.
451-
controlFlag = REG_MAX_ACCESS_FLAG & (~(REG_ALLOW_RENAME_KEY | REG_ALLOW_DELETE_KEY | REG_ALLOW_CREATE_KEY));
463+
//controlFlag = REG_MAX_ACCESS_FLAG & (~(REG_ALLOW_RENAME_KEY | REG_ALLOW_DELETE_KEY | REG_ALLOW_CREATE_KEY));
452464

453465
registryFilterRule.ControlFlag = controlFlag;
454466
registryFilterRule.RegCallbackClass = Max_Reg_Callback_Class;

Diff for: Demo_Source_Code/CPlusPlusDemo/FilterAPI.h

+45-24
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
//Purchase a license key with the link: http://www.EaseFilter.com/Order.htm
1515
//Email us to request a trial key: [email protected] //free email is not accepted.
16-
#define registerKey "*****************************************"
16+
#define registerKey "**************************************"
1717

1818
#define MESSAGE_SEND_VERIFICATION_NUMBER 0xFF000001
1919
#define INET_ADDR_STR_LEN 22
@@ -196,23 +196,23 @@ typedef enum _FilterCommand
196196
/// </summary>
197197
FILTER_SEND_PROCESS_CREATION_INFO = 0x00010008,
198198
/// <summary>
199-
/// send the process termination ifnormation
199+
/// send the process termination information
200200
/// </summary>
201201
FILTER_SEND_PROCESS_TERMINATION_INFO = 0x00010009,
202202
/// <summary>
203203
/// send the new thread creation information
204204
/// </summary>
205205
FILTER_SEND_THREAD_CREATION_INFO = 0x0001000a,
206206
/// <summary>
207-
/// send the thread termination ifnormation
207+
/// send the thread termination information
208208
/// </summary>
209209
FILTER_SEND_THREAD_TERMINATION_INFO = 0x0001000b,
210210
/// <summary>
211211
/// send the process handle operations information
212212
/// </summary>
213213
FILTER_SEND_PROCESS_HANDLE_INFO = 0x0001000c,
214214
/// <summary>
215-
/// send the thread handle operations ifnormation
215+
/// send the thread handle operations information
216216
/// </summary>
217217
FILTER_SEND_THREAD_HANDLE_INFO = 0x0001000d,
218218
/// <summary>
@@ -519,7 +519,7 @@ typedef enum _ProcessControlFlag
519519
/// </summary>
520520
DENY_NEW_PROCESS_CREATION = 0x00000001,
521521
/// <summary>
522-
/// send the callback reqeust before the process is going to be terminated.
522+
/// send the callback request before the process is going to be terminated.
523523
/// you can block the process termination in the callback function.
524524
/// </summary>
525525
PROCESS_PRE_TERMINATION_REQUEST = 0x00000002,
@@ -528,7 +528,7 @@ typedef enum _ProcessControlFlag
528528
/// </summary>
529529
PROCESS_CREATION_NOTIFICATION = 0x00000100,
530530
/// <summary>
531-
///get a notification when a process was termiated
531+
///get a notification when a process was terminated
532532
/// </summary>
533533
PROCESS_TERMINATION_NOTIFICATION = 0x00000200,
534534
/// <summary>
@@ -541,9 +541,9 @@ typedef enum _ProcessControlFlag
541541
/// </summary>
542542
THREAD_CREATION_NOTIFICATION = 0x00000800,
543543
/// <summary>
544-
/// get a notification when a thread was termiated
544+
/// get a notification when a thread was terminated
545545
/// </summary>
546-
THREAD_TERMINIATION_NOTIFICATION = 0x00001000,
546+
THREAD_TERMINATION_NOTIFICATION = 0x00001000,
547547
/// <summary>
548548
/// get a notification for thread handle operations, when a handle for a process
549549
/// is being created or duplicated.
@@ -815,7 +815,7 @@ typedef enum _AccessFlag
815815
/// <summary>
816816
/// Allow the file open to access the file's security information.
817817
/// </summary>
818-
ALLOW_OPEN_WTIH_ACCESS_SYSTEM_SECURITY = 0x00000010,
818+
ALLOW_OPEN_WITH_ACCESS_SYSTEM_SECURITY = 0x00000010,
819819
/// <summary>
820820
/// Allow the file open for read access.
821821
/// </summary>
@@ -943,15 +943,15 @@ typedef enum _BooleanConfig
943943
/// </summary>
944944
ENABLE_ADD_MESSAGE_TO_FILE = 0x00000010,
945945
/// <summary>
946-
/// the encrypted file's meta data was embeded in the reparse point tag, it is for the previous version 5.0.
946+
/// the encrypted file's meta data was embedded in the reparse point tag, it is for the previous version 5.0.
947947
/// </summary>
948948
ENCRYPT_FILE_WITH_REPARSE_POINT_TAG = 0x00000020,
949949
/// <summary>
950950
/// for encryption rule, get the encryption key and IV from user mode for the encrypted files.
951951
/// </summary>
952952
REQUEST_ENCRYPT_KEY_AND_IV_FROM_SERVICE = 0x00000040,
953953
/// <summary>
954-
/// for control filter, if it is enabled, the control filte rulle will be applied in boot time.
954+
/// for control filter, if it is enabled, the control filter rule will be applied in boot time.
955955
/// </summary>
956956
ENABLE_PROTECTION_IN_BOOT_TIME = 0x00000080,
957957
/// <summary>
@@ -963,7 +963,7 @@ typedef enum _BooleanConfig
963963
/// </summary>
964964
ENABLE_SEND_DATA_BUFFER = 0x00000200,
965965
/// <summary>
966-
/// if it is enabled, it will reopen the file when rehydration of the stub file.
966+
/// if it is enabled, it will reopen the file during rehydration of the stub file.
967967
/// </summary>
968968
ENABLE_REOPEN_FILE_ON_REHYDRATION = 0x00000400,
969969
/// <summary>
@@ -1016,7 +1016,7 @@ typedef enum _BooleanConfig
10161016
typedef struct _MESSAGE_SEND_DATA
10171017
{
10181018
/// <summary>
1019-
///the verification number which verifiys the data structure integerity.
1019+
///the verification number which verifies the data structure integerity.
10201020
/// </summary>
10211021
ULONG VerificationNumber;
10221022
/// <summary>
@@ -1622,7 +1622,7 @@ AddUserRightsToFilterRule(WCHAR* filterMask, WCHAR* userName, ULONG accessFlags
16221622

16231623
/// <summary>
16241624
/// Get sha256 hash of the file, you need to allocate the 32 bytes array to get the sha256 hash.
1625-
/// hashBytesLength is the input byte array length, and the outpou lenght of the hash.
1625+
/// hashBytesLength is the input byte array length, and the outpout length of the hash.
16261626
/// </summary>
16271627
extern "C" __declspec(dllexport)
16281628
BOOL
@@ -1897,7 +1897,7 @@ ActivateLicense(
18971897
/// </summary>
18981898
/// <param name="processNameLength">The length of the process name string in bytes</param>
18991899
/// <param name="processName">The process name to be filtered, all processes if it is '*' </param>
1900-
/// <param name="processId">set the processId if you want filter with id instead of the process name</param>
1900+
/// <param name="processId">set the processId if you want to filter by id instead of the process name</param>
19011901
/// <param name="userNameLength">the user name length if you want to filter the user name</param>
19021902
/// <param name="userName">the user name filter mask</param>
19031903
/// <param name="registryKeyNameLength">set the registry key name filter if you want to filter by the key name</param>
@@ -1908,7 +1908,7 @@ ActivateLicense(
19081908
extern "C" __declspec(dllexport)
19091909
BOOL
19101910
AddRegistryFilterRule(
1911-
ULONG prcoessNameLength,
1911+
ULONG processNameLength,
19121912
WCHAR* processName,
19131913
ULONG processId,
19141914
ULONG userNameLength,
@@ -1954,7 +1954,7 @@ RemoveRegistryFilterRuleByProcessId(
19541954
extern "C" __declspec(dllexport)
19551955
BOOL
19561956
RemoveRegistryFilterRuleByProcessName(
1957-
ULONG prcoessNameLength,
1957+
ULONG processNameLength,
19581958
WCHAR* processName );
19591959

19601960
/// <summary>
@@ -1967,15 +1967,15 @@ RemoveRegistryFilterRuleByProcessName(
19671967
extern "C" __declspec(dllexport)
19681968
BOOL
19691969
AddProcessFilterRule(
1970-
ULONG prcoessNameMaskLength,
1970+
ULONG processNameMaskLength,
19711971
WCHAR* processNameMask,
19721972
ULONG controlFlag,
19731973
ULONG filterRuleId = 0 );
19741974

19751975
extern "C" __declspec(dllexport)
19761976
BOOL
19771977
RemoveProcessFilterRule(
1978-
ULONG prcoessNameMaskLength,
1978+
ULONG processNameMaskLength,
19791979
WCHAR* processNameMask );
19801980

19811981
/// <summary>
@@ -1989,7 +1989,7 @@ RemoveProcessFilterRule(
19891989
extern "C" __declspec(dllexport)
19901990
BOOL
19911991
AddFileControlToProcessByName(
1992-
ULONG prcoessNameMaskLength,
1992+
ULONG processNameMaskLength,
19931993
WCHAR* processNameMask,
19941994
ULONG fileNameMaskLength,
19951995
WCHAR* fileNameMask,
@@ -2010,7 +2010,7 @@ AddFileControlToProcessByName(
20102010
extern "C" __declspec(dllexport)
20112011
BOOL
20122012
AddFileCallbackIOToProcessByName(
2013-
ULONG prcoessNameMaskLength,
2013+
ULONG processNameMaskLength,
20142014
WCHAR* processNameMask,
20152015
ULONG fileNameMaskLength,
20162016
WCHAR* fileNameMask,
@@ -2023,7 +2023,7 @@ AddFileCallbackIOToProcessByName(
20232023
extern "C" __declspec(dllexport)
20242024
BOOL
20252025
RemoveFileControlFromProcessByName(
2026-
ULONG prcoessNameMaskLength,
2026+
ULONG processNameMaskLength,
20272027
WCHAR* processNameMask,
20282028
ULONG fileNameMaskLength,
20292029
WCHAR* fileNameMask);
@@ -2039,15 +2039,15 @@ RemoveFileControlFromProcessByName(
20392039
extern "C" __declspec(dllexport)
20402040
BOOL
20412041
AddFileControlToProcessById(
2042-
ULONG prcoessId,
2042+
ULONG processId,
20432043
ULONG fileNameMaskLength,
20442044
WCHAR* fileNameMask,
20452045
ULONG AccessFlag );
20462046

20472047
extern "C" __declspec(dllexport)
20482048
BOOL
20492049
RemoveFileControlFromProcessById(
2050-
ULONG prcoessId,
2050+
ULONG processId,
20512051
ULONG fileNameMaskLength,
20522052
WCHAR* fileNameMask);
20532053

@@ -2098,4 +2098,25 @@ GetAESIV(
20982098
PULONG ivSize,
20992099
BYTE* ivBuffer);
21002100

2101+
extern "C" __declspec(dllexport)
2102+
BOOL
2103+
AddExcludeProcessNameToRegistryFilterRule(WCHAR * processNameFilterMask, WCHAR * registryKeyNameFilterMask, WCHAR * excludeProcessNameFilterMask);
2104+
2105+
extern "C" __declspec(dllexport)
2106+
BOOL
2107+
AddExcludeUserNameToRegistryFilterRule(WCHAR * processNameFilterMask, WCHAR * registryKeyNameFilterMask, WCHAR * excludeUserName);
2108+
2109+
extern "C" __declspec(dllexport)
2110+
BOOL
2111+
AddExcludeKeyNameToRegistryFilterRule(WCHAR * processNameFilterMask, WCHAR * registryKeyNameFilterMask, WCHAR * excludeKeyName);
2112+
2113+
2114+
extern "C" __declspec(dllexport)
2115+
BOOL
2116+
AddExcludeProcessNameToProcessFilterRule(WCHAR * processNameFilterMask, WCHAR * processName);
2117+
2118+
extern "C" __declspec(dllexport)
2119+
BOOL
2120+
AddExcludeUserNameToProcessFilterRule(WCHAR * processNameFilterMask, WCHAR * userName);
2121+
21012122
#endif//__SHARE_TYPE_H__

0 commit comments

Comments
 (0)