我的意思就是想做一种很像防火墙程序那样,检测到一个未知程序运行之前,可以弹出提示框,如果用户选择允许,那么进程继续运行,如果不允许,那么就不让程序运行,以前有查过这样的资料,好像要用PsSetCreateProcessNotifyRoutine这样的函数,但是不知道怎么用,哪位高手能给个实例代码,最好有详细注释的

解决方案 »

  1.   

    应用层hook CreateProcess或驱动层hook ZwCreateSection
      

  2.   

    PsSetCreateProcessNotifyRoutine(...ProcessNotifyRoutine...);...ProcessNotifyRoutine(...)
    {
    ZwSuspendThread(.....);
    // ask ring3 whether should block or pass?
    // if pass, ZwResumeThread
    // else, terminate the process.
    }
      

  3.   

    ...ProcessNotifyRoutine(...)
    {
    ZwSuspendThread(.....);
    }...ProcessTheProcessProc(...)
    {
    // ask ring3 whether should block or pass?
    // if pass, ZwResumeThread
    // else, terminate the process.
    }
      

  4.   

    利用SSDT HOOK替换掉系统的ZwCreateProcess,在自己的哦MyZwCreateProcess函数中做判断,允许还是禁止创建,如果禁止创建,返回空句柄,允许的话,调用原来的ZwCreateProcess函数
      

  5.   

    PsSetCreateProcessNotifyRoutine(...ProcessNotifyRoutine...);...ProcessNotifyRoutine(...)
    {
    ZwSuspendThread(.....);
    // ask ring3 whether should block or pass?
    // if pass, ZwResumeThread
    // else, terminate the process.
    }或者映像劫持,替换成你的程序,检查之后再放行