我在网上找了个 NDIS-HOOK 驱动程序,
一共两个文件. 一个 .h 文件, 一个 .c 文件作者说必须在 DDK 下编译, 可我不知道如何编译.另外, 我想在系统启动时挂上我的钩子, 应该怎么办?

解决方案 »

  1.   

    装好VC之后再装DDK,然后从开始菜单之Development Kits的
    Checked Build Environment
    或Free Build Environment进入相关目录build即可
    或者你用driver studio工具
      

  2.   

    写个SOURCE文件,MAKEFILE是DDK里已经写好了的
    然后用build就可以编译了
      

  3.   

    我从网上找的驱动只有两个文件, 没有 SOURCE 文件 , 也没有 MAKEFILE .
    而我又不会写, 真不知道应该如何入手.
      

  4.   

    www.vckbase.com/document/viewdoc/?id=901
      

  5.   

    source文件:
    !IF 0Copyright (c) 1989  Microsoft CorporationModule Name:    sources.Abstract:    This file specifies the target component being built and the list of
        sources files needed to build that component.  Also specifies optional
        compiler switches and libraries that are unique for the component being
        built.
    Author:
    NOTE:   Commented description of this file is in \nt\bak\bin\sources.tpl!ENDIF
    TARGETNAME=SNOWTEAR
    TARGETPATH=obj
    TARGETTYPE=DRIVERTARGETLIBS=$(DDK_LIB_PATH)\ndis.lib
    C_DEFINES=$(C_DEFINES) -DNDIS40 -DNDIS_MINIPORT_DRIVER -DNDIS40_MINIPORTINCLUDES=..\..\incSOURCES= snowtear.c    \
             protocol.c    \
             miniport.c    \MSC_WARNING_LEVEL=/W3 /WXPRECOMPILED_INCLUDE=precomp.h
    PRECOMPILED_PCH=precomp.pch
    PRECOMPILED_OBJ=precomp.obj                           makefile:
    #
    # DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source
    # file to this component.  This file merely indirects to the real make file
    # that is shared by all the components of NT
    #
    !INCLUDE $(NTMAKEENV)\makefile.def我的驱动程序就是用的这个默认MAKEFILE。
    至于source文件,也是改的DDK里的
      

  6.   

    找个驱动程序,看别人的SOURCE文件和MAKEFILE文件,
    照样做两个,
    然后运行DDK的命令窗口,到你的驱动代码所在文件夹,键入:build -ceZ就可以了.
      

  7.   

    我要编译的是一个 NDIS-Hook Driver, 就两个文件:fxfilthook.h
    fxfilthook.c不知道怎么写啊!
      

  8.   

    MAKEFILE文件:
    考下去就可以用#
    # DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source
    # file to this component.  This file merely indirects to the real make file
    # that is shared by all the driver components of the Windows NT DDK
    #!INCLUDE $(NTMAKEENV)\makefile.def
      

  9.   

    TARGETNAME=xxxxxx      这里是你驱动的名字
    TARGETPATH=obj
    TARGETTYPE=DRIVER#TARGETLIBS= $(DDK_LIB_PATH)\ntdll.lib \
    # $(DDK_LIB_PATH)\ndis.lib MSC_WARNING_LEVEL=-W3 -WXMSC_OPTIMIZATION=/OdiINCLUDES=./include                              头文件路径,在同一目录下就没必要
    SOURCES = fxfilthook.c
      

  10.   

    程序已经编译成功, 结果为 ifh.sys
    但现在的问题是 ifh 启动之后并没有截下 ICMP 包.
     
    估计问题是我的驱动没有设置好正确的启动顺序.可有人知道在哪设置 驱动的启动顺序 ?调试成功一定 600 分相谢!