首页
社区
课程
招聘
[求助]CreateFile打开驱动创建的符号链接 DeviceIoControl下发irp。
发表于: 2007-11-4 14:53 11124

[求助]CreateFile打开驱动创建的符号链接 DeviceIoControl下发irp。

2007-11-4 14:53
11124
我的那个文件是D:\MyDrivers\driver1\objchk\i386\driver1.sys
怎么调用嘛。小弟我真菜哦。
小弟我特地从东北跑来地。是为了请教一个问题地。
就是写一个驱动地。显示出"hello world!"地。
请大虾帮忙地。
斑竹也要帮忙地。
谢谢地。

[课程]Linux pwn 探索篇!

收藏
免费 0
支持
分享
最新回复 (9)
雪    币: 145
活跃值: (85)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
2
补充一点,用Easy那个程序生成的driver1.sys,一点没动地。
我在MFC里怎么写地?
2007-11-4 14:55
0
雪    币: 796
活跃值: (370)
能力值: ( LV9,RANK:380 )
在线值:
发帖
回帖
粉丝
3
用服务启动 driver1.sys
2007-11-4 14:58
0
雪    币: 145
活跃值: (85)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
4
详细一点摸。我是个新手。
2007-11-4 15:01
0
雪    币: 796
活跃值: (370)
能力值: ( LV9,RANK:380 )
在线值:
发帖
回帖
粉丝
5
编译下面代码,然后把编译好的exe和你的sys放同一目录下,然后用你的鼠标双击一下exe,就运行了sys

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;
;  scp.asm
;
;  Service Control Program for beeper.sys driver
;
;  Written by Four-F (four-f@mail.ru)
;
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

.386
.model flat, stdcall
option casemap:none

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;                                  I N C L U D E   F I L E S                                       
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

include \masm32\include\windows.inc

include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
include \masm32\include\advapi32.inc

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\advapi32.lib

include \masm32\Macros\Strings.mac

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;                                         C O D E                                                   
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

.code

start proc

local hSCManager:HANDLE
local hService:HANDLE
local acDriverPath[MAX_PATH]:CHAR

        ; Open a handle to the SC Manager database
        invoke OpenSCManager, NULL, NULL, SC_MANAGER_CREATE_SERVICE
        .if eax != NULL
                mov hSCManager, eax

                push eax
                invoke GetFullPathName, $CTA0("driver1.sys"), sizeof acDriverPath, addr acDriverPath, esp
            pop eax

                ; Register driver in SCM active database
                invoke CreateService, hSCManager, $CTA0("test"), $CTA0("test"), \
                                SERVICE_START + DELETE, SERVICE_KERNEL_DRIVER, SERVICE_DEMAND_START, \
                                SERVICE_ERROR_IGNORE, addr acDriverPath, NULL, NULL, NULL, NULL, NULL
                .if eax != NULL
                        mov hService, eax
                        invoke StartService, hService, 0, NULL
                        ; Here driver beeper.sys plays its nice melody
                        ; and reports error to be removed from memory
                        ; Remove driver from SCM database
                        invoke DeleteService, hService
                        invoke CloseServiceHandle, hService
                .else
                        invoke MessageBox, NULL, $CTA0("Can't register driver."), NULL, MB_ICONSTOP
                .endif
                invoke CloseServiceHandle, hSCManager
        .else
                invoke MessageBox, NULL, $CTA0("Can't connect to Service Control Manager."), \
                                                        NULL, MB_ICONSTOP
        .endif

        invoke ExitProcess, 0

start endp

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;                                                                                                   
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

end start
2007-11-4 15:02
0
雪    币: 145
活跃值: (85)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
6
有没有VC++启动的方法呀?斑竹地出来。帮帮我。
2007-11-4 15:16
0
雪    币: 145
活跃值: (85)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
7
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987.  All rights reserved.

Object filename [c.OBJ]:
Source listing  [NUL.LST]:
Cross-reference [NUL.CRF]:
Include file \masm32\include\windows.inc  not found
2007-11-4 15:20
0
雪    币: 145
活跃值: (85)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
8
C:\masm32\examples\c.asm(29) : fatal error A1000: cannot open file : \masm32\Macros\Strings.mac
这个错误怎么弄?》
2007-11-4 15:47
0
雪    币: 66
活跃值: (16)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
9
------
上传的附件:
2007-11-4 16:46
0
雪    币: 145
活跃值: (85)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
10
谢谢楼上的哥哥分享地。
可惜小弟实在笨到家地。
这个.h怎么用地。
是不是要include地?
如果include地。那么掉用什么函数地?函数参数是怎么写地?
2007-11-4 16:52
0
游客
登录 | 注册 方可回帖
返回
//