MiroKaku / ucxxrt

The Universal C++ RunTime library, supporting kernel-mode C++ exception-handler and STL.
MIT License
399 stars 97 forks source link

Can't use kernel function #4

Closed lwl4613615 closed 3 years ago

lwl4613615 commented 3 years ago

image

include

include

EXTERN_C ULONGLONG KeQueryInterruptTime(); EXTERN_C NTSTATUS DriverMain(PDRIVER_OBJECT aDriverObject, PUNICODE_STRING /aRegistry/) { aDriverObject->DriverUnload = {

    return;
};
auto speed= KeQueryInterruptTime();
KdPrintEx((77, 0, "%llx \n", speed));
return STATUS_SUCCESS;

}

MiroKaku commented 3 years ago
  1. 在系统头文件之前定义 #define _KERNEL_MODE __KERNEL_MODE
  2. 不要自己定义 KeQueryInterruptTime,他是个宏,没有实体函数
lwl4613615 commented 3 years ago

成功了,吊