2012-04-01 28 views
0

第一次建設驅動程序,我已經建立了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 

回答

2

您不能運行32 64位機器上的位驅動程序。

您需要構建64位版本的驅動程序sign it with a testsigning certificate並將您的機器配置爲start in testsigning mode。只有這樣你才能啓動你的驅動程序。

一個忠告,但。如果您不想因第一個驅動程序中的錯誤而頻繁發生藍屏死機,請考慮安裝虛擬機應用程序,如VirtualBox並從那裏測試驅動程序。

+0

感謝您的答案和鏈接,道歉的最新回覆,但如果嘗試構建64位問題升級,我更新了我的問題... – 2012-04-04 11:16:43

2

第一個答案對您的第一個問題是正確的。編譯錯誤是由於64位版本不支持內聯彙編,因此需要將彙編語言例程放在單獨的.ASM模塊中。

+0

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