已经把相关的.h和.lib包含,但编译时候还出现下面错误
hookndis.obj() : error LNK2001: unresolved external symbol "__declspec(dllimport) long __stdcall ZwQuerySystemInformation(unsigned long,void *,unsigned long,unsigned long *)" (__imp_?ZwQuerySystemInformation@@YGJKPAXKPAK@Z)
objchk\i386\sys.sys() : error LNK1120: 1 unresolved externals什么原因?如何解决? 
谢谢

解决方案 »

  1.   

    you can LoadLibrary("ntdll.dll")
    then GetProcAddress("ZwQuerySysemInformation"...)
      

  2.   

    #pragma comment(lib, "ntdll.lib")
    //ntdll.lib可以在Windows 2000 DDK中找到
      

  3.   

    lib库中没有ZwQuerySystemInformation这个函数。
      

  4.   

    哪你看看MSDN这个函数在哪个LIB里!!!
      

  5.   

    这是微软没有公开的函数!!!!
    在ntdll.lib里面有,利用他可以hook系统核心的apimasterz,你的方法不行,我已经把这些库包含进去了~~
    对了,是系统的函数都用不了,都有这种错误~~~
      

  6.   

    the following program can be build and run on my computer. 
    #include <windows.h>
    #include <stdio.h>#define NTAPI __stdcalltypedef LONG NTSTATUS;
    typedef LONG KPRIORITY;#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)#define STATUS_INFO_LENGTH_MISMATCH      ((NTSTATUS)0xC0000004L)
    #define SystemTimeInformation 3typedef struct _SYSTEM_TIME_INFORMATION
    {
    LARGE_INTEGER liKeBootTime;
    LARGE_INTEGER liKeSystemTime;
    LARGE_INTEGER liExpTimeZoneBias;
    ULONG uCurrentTimeZoneId;
    DWORD dwReserved;
    } SYSTEM_TIME_INFORMATION;extern "C"
    NTSYSAPI
    NTSTATUS
    NTAPI
    ZwQuerySystemInformation(
        IN     UINT SystemInformationClass,
        IN OUT  PVOID SystemInformation,
        IN     ULONG SystemInformationLength,
        OUT     PULONG ReturnLength OPTIONAL
        );#pragma comment(lib, "ntdll.lib")void main(int argc,char * argv[])
    {
    SYSTEM_TIME_INFORMATION Sti;
    NTSTATUS Status;
    FILETIME                ftSystemBoot;
    SYSTEMTIME              stSystemBoot; Status = ZwQuerySystemInformation(SystemTimeInformation,&Sti,sizeof(Sti),0);
    if (Status!=NO_ERROR)
    return; ftSystemBoot = *(FILETIME *)&(Sti.liKeBootTime); FileTimeToLocalFileTime(&ftSystemBoot,&ftSystemBoot);
    FileTimeToSystemTime(&ftSystemBoot,&stSystemBoot); printf("System Reboot Date: %02d-%02d-%04d\nTime: %02d:%02d:%02d\n",
             stSystemBoot.wMonth,stSystemBoot.wDay,stSystemBoot.wYear,
             stSystemBoot.wHour,stSystemBoot.wMinute,stSystemBoot.wSecond);

    }
      

  7.   

    请问一下heavyd(heavyd) :
    用这个函数怎么hook系统api?
      

  8.   

    通过ZwQuerySystemInformation得到.sys地址,再替换.sys中api的地址为自己函数地址