运行自定义WIN内核驱动程序

问题描述:

第一次建设驱动程序,我已经建立了this驱动程序,我得到.sys和其他文件,但我无法设法运行它,我注册与驱动程序加载器或sc.exe,我看到它在注册表,但在SC启动命令我得到错误运行自定义WIN内核驱动程序

该驱动程序已经加载阻止

机是Win7的X64,但我建立驱动程序作为32位

再次

,初学者关于司机,希望有人有一些解决方案吨O此,

感谢

编辑:

,如果我尝试建立64位版本,我有这样的错误,我不知道如何解决:

BUILD: Compiling and Linking c:\winddk\7600.16385.1\src\hades directory 

     Configuring OACR for 'WDKSamples:amd64chk' - <OACR on> 
     Compiling - hades.c 
     1>errors in directory c:\winddk\7600.16385.1\src\hades 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(44): error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(46): error C2065: 'push' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(46): error C2146: syntax error : missing ';' before identifier 'eax' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(47): error C2065: 'eax' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(47): error C2146: syntax error : missing ';' before identifier 'mov' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(47): error C2065: 'mov' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(47): error C2146: syntax error : missing ';' before identifier 'eax' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(47): error C2065: 'eax' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(48): error C2065: 'edx' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(48): error C2146: syntax error : missing ';' before identifier 'mov' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(48): error C2065: 'mov' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(48): error C2146: syntax error : missing ';' before identifier 'gORIG_ESP' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(50): error C2065: 'eax' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(50): error C2146: syntax error : missing ';' before identifier 'sub' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(50): error C2065: 'sub' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(50): error C2146: syntax error : missing ';' before identifier 'eax' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(50): error C2065: 'eax' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(51): error C2146: syntax error : missing ';' before identifier 'mov' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(51): error C2065: 'mov' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(51): error C2146: syntax error : missing ';' before identifier 'eax' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(51): error C2065: 'eax' : undeclared identifier 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(51): error C2059: syntax error : '[' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(96): error C2143: syntax error : missing ';' before 'type' 
    1>c:\winddk\7600.16385.1\src\hades\hades.c(176): error C4013: 'hook_syscalls' undefined; assuming extern returning int 
     Compiling - support.c 
     Compiling - debugger.c 
    1>c:\winddk\7600.16385.1\src\hades\debugger.c(52): error C2485: 'naked' : unrecognized extended attribute 
    1>c:\winddk\7600.16385.1\src\hades\debugger.c(54): error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture 
... ETC 

您不能运行32 64位机器上的位驱动程序。

您需要构建64位版本的驱动程序sign it with a testsigning certificate并将您的机器配置为start in testsigning mode。只有这样你才能启动你的驱动程序。

一个忠告,但。如果您不想因第一个驱动程序中的错误而频繁发生蓝屏死机,请考虑安装虚拟机应用程序,如VirtualBox并从那里测试驱动程序。

+0

感谢您的答案和链接,道歉的最新回复,但如果尝试构建64位问题升级,我更新了我的问题... – 2012-04-04 11:16:43

第一个答案对您的第一个问题是正确的。编译错误是由于64位版本不支持内联汇编,因此需要将汇编语言例程放在单独的.ASM模块中。

+0

感谢您的答案,我会看到它... – 2012-04-04 13:20:09