OpenKext function

打开指定内核模块进程


Parameters:

  • (LPCSTR) lpcKextService:内核扩展服务名

Return value:

  • Type:int
  • Text:成功返回内核扩展服务句柄号,失败返回 NULL
  • Error:执行失败会设置 GetErrorInfo

Remarks:

  1. 当调用 OpenKext function 时,目标内核扩展服务会收到 KEXT_FLAGS_OPENSERVICE 通知例程,如以 KEXT_RETURN_ERROR 标志响应,则拒绝访问
  2. 当前扩展程序进程 Token 应具有 TOKEN_PRIVILEGE_USER 特权
  3. 当前扩展程序进程 Token 应具有 TOKEN_FLAGS_KEXT 许可标志

C++ code:

#include <h.studio>
#include <h.kext>

int hello(){
    int hKextService=OpenKext("mykit.kextes");
     // There is no decision on whether the operation was successful
    output("Operation completed, the service handle number is:"+tolpcstr(hKextService));
    return RETEXT_NULL;
}

results matching ""

    No results matching ""