添加保护 - VipProtectAddProtect
函数简介
添加保护。(高级版功能,普通版无法使用)
接口名称
VipProtectAddProtect
DLL调用
int32_t VipProtectAddProtect(int64_t instance, int64_t pid, string path, int32_t mode, int32_t permission);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| pid | 长整数型 | 需要保护的进程ID。 |
| path | 字符串 | 需要保护的文件或文件夹路径。 |
| mode | 整数型 | 保护模式:1-允许白名单进程访问,2-禁止全部访问,3-禁止黑名单进程访问,4-允许白名单文件路径访问,5-禁止黑名单文件路径访问。 |
| permission | 整数型 | 保护权限:位标志组合,0x01-阻止打开,0x02-隐藏信息,0x04-阻止内存访问,0x08-阻止窗口操作。 |
示例
int64_t instance = CreateCOLAPlugInterFace();
// 添加保护:进程ID 1234,模式1(允许白名单进程访问),权限:阻止打开和隐藏信息
int32_t permission = 0x01 | 0x02;
int32_t ok = VipProtectAddProtect(instance, 1234, "C:\\Important\\file.txt", 1, permission);
printf("VipProtectAddProtect: %d\n", ok);
DestroyCOLAPlugInterFace(instance);
返回值
1 成功,0 失败。
注意事项
- 需要驱动支持与管理员权限。
- 需要先调用 VipProtectEnableDriver 开启高级保护。
- permission 参数可以使用位或运算符组合多个权限。
