ring0中的OriginalDesiredAccess操作

时间:2014-06-03 21:26:12

标签: windows winapi kernel hook wdm

简单的问题。我编写了驱动程序(WDM),它使用回调函数挂钩并拦截虚拟内存函数,终止,暂停结束等(我想建立一点自卫)。并且..如果我尝试通过标准应用程序终止我的应用程序(没有管理员权限) - 我不能这样做,但如果我通过具有调试权限的应用程序尝试相同的事情 - 程序成功终止。我的错误在哪里?

方法检测WriteMemoryProcess:

if ((OperationInformation->Parameters->CreateHandleInformation.OriginalDesiredAccess & PROCESS_VM_WRITE) == PROCESS_VM_WRITE)
{
    OperationInformation->Parameters->CreateHandleInformation.DesiredAccess &= ~PROCESS_VM_WRITE;
}

回拨注册:

RegisterOperation.ObjectType = PsProcessType;
RegisterOperation.Operations = OB_OPERATION_HANDLE_CREATE;
RegisterOperation.PreOperation = ObjectPreCallback;
RegisterOperation.PostOperation = ObjectPostCallback;
RegisterCallBack.Version = OB_FLT_REGISTRATION_VERSION;
RegisterCallBack.OperationRegistrationCount = registrationCount;
RtlInitUnicodeString(&Altitude, L"XXXXXXX");
RegisterCallBack.Altitude = Altitude;
RegisterCallBack.RegistrationContext = &RegistrationContext;
RegisterCallBack.OperationRegistration = &RegisterOperation;

感谢您的建议!

0 个答案:

没有答案