powerbit
驱动牛犊
驱动牛犊
  • 注册日期2005-01-12
  • 最后登录2005-06-01
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:2158回复:15

如何编程实现windows用户无法进入安全模式

楼主#
更多 发布于:2005-01-17 11:52
如题
不要求代码
能给提示也行
谢谢各位大虾!

最新喜欢:

aasa2aasa2
飞翔的感觉
Leonsoft
驱动小牛
驱动小牛
  • 注册日期2003-05-08
  • 最后登录2012-08-11
  • 粉丝1
  • 关注0
  • 积分21分
  • 威望281点
  • 贡献值1点
  • 好评度103点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2005-01-17 20:09
估计要修改NTLTD吧。当然这只是我的推测。
I will do the best with what the God gave me.
hongdou
驱动牛犊
驱动牛犊
  • 注册日期2004-06-15
  • 最后登录2006-03-10
  • 粉丝0
  • 关注0
  • 积分5分
  • 威望1点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2005-01-17 20:19
注册表safeboot项下面是安全模式下要启动的服务和驱动,写个程序,系统启动时检测safeboot下的一个变量,可以知道是不是安全模式

两种模式下观察一下safeboot项就很清楚了
水来啊
powerbit
驱动牛犊
驱动牛犊
  • 注册日期2005-01-12
  • 最后登录2005-06-01
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2005-01-18 09:42
谢谢回复 不过有个问题我还是想问一下
hongdou
你认为那种在系统启动之前,就能检测注册表的程序应该怎么写
写一个服务程序还是驱动程序?
我要用的这个程序可是在系统启动大部分服务和驱动程序之前运行!
盼望大虾们的回复!
飞翔的感觉
aasa2
驱动中牛
驱动中牛
  • 注册日期2004-04-01
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分525分
  • 威望339点
  • 贡献值0点
  • 好评度106点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2005-01-18 09:51
关注
技术交流:aasa2@21cn.com QQ群:10863699
powerbit
驱动牛犊
驱动牛犊
  • 注册日期2005-01-12
  • 最后登录2005-06-01
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2005-01-19 16:32
高手呀,你快点出来呀
飞翔的感觉
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2005-01-19 19:34
extern PULONG InitSafeBootMode;
...........
if(*InitSafeBootMode > 0)
{
    KeBugCheck(0);
}
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
bmyyyud
驱动老牛
驱动老牛
  • 注册日期2002-02-22
  • 最后登录2010-01-21
  • 粉丝0
  • 关注0
  • 积分1000分
  • 威望130点
  • 贡献值0点
  • 好评度106点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2005-01-20 10:21
extern PULONG InitSafeBootMode;
...........
if(*InitSafeBootMode > 0)
{
    KeBugCheck(0);
}
 

似乎很明白,理所当然,但该怎么用,用在哪里,晕!!
滚滚长江东逝水 浪花淘尽英雄 是非成败转头空 青山依旧在 几度夕阳红 白发渔樵江渚上 惯看秋月春风 一壶浊酒喜相逢 古今多少事 尽付笑谈中
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2005-01-20 11:30
[quote]extern PULONG InitSafeBootMode;
...........
if(*InitSafeBootMode > 0)
{
    KeBugCheck(0);
}
 

似乎很明白,理所当然,但该怎么用,用在哪里,晕!! [/quote]

DriverEntry


But with this code, nobody can enter safe-mode and there is always a blue-screen or reboot when it's booting into safe-mode :D

Check your design carefully to avoid this
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
powerbit
驱动牛犊
驱动牛犊
  • 注册日期2005-01-12
  • 最后登录2005-06-01
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
9楼#
发布于:2005-01-20 15:25
对于斑竹大人的敬仰有如滔滔江水,连绵不绝
黄河泛滥,一发不可收拾!
受小弟一拜
飞翔的感觉
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
10楼#
发布于:2005-01-20 19:54
How to determine whether the system is running in Safe Mode from a device driver
SUMMARY
This article describes how to determine whether the system is running in Safe Mode from a device driver.
MORE INFORMATION
The Windows OS kernel exports a pointer to a ULONG variable that is named InitSafeBootMode. This variable contains the Safe Mode settings.

A device driver can determine whether the system is running in Safe Mode by the value of the InitSafeBootMode variable. A value of 0 means that the system is not running in Safe Mode.

The following table lists the modes for other values.Value  Mode
1  SAFEBOOT_MINIMAL
2  SAFEBOOT_NETWORK
3*  SAFEBOOT_DSREPAIR
*Note The value of 3 applies to Windows domain controllers only.

You must declare the following in your driver. extern PULONG InitSafeBootMode;

You must check the value of InitSafeBootMode to determine whether the system is running in Safe Mode.if (*InitSafeBootMode > 0){

     // The system is in Safe Mode.
     // Take appropriate action.
     //
}
For example, to prevent a driver from working in Safe Mode, use one of the following methods: • Function drivers

If your function driver has a service start type of SERVICE_BOOT_START, check the value of the InitSafeBootMode variable in the AddDevice routine and return failure.

Note You must never return failure from the DriverEntry routine.
• Filter drivers

If your filter driver starts during boot time, check the value of the InitSafeBootMode variable in the AddDevice routine. Do not attach to the device stack. Return success from the AddDevice routine.
• Other drivers

For drivers that are not mentioned earlier, check the value of the InitSafeBootMode variable in the DriverEntry routine. Return failure if the system is in Safe Mode.  
花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
hongdou
驱动牛犊
驱动牛犊
  • 注册日期2004-06-15
  • 最后登录2006-03-10
  • 粉丝0
  • 关注0
  • 积分5分
  • 威望1点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
11楼#
发布于:2005-01-20 22:45
老大都说了,也没什么好说的了 :D
水来啊
AllenZh
驱动老牛
驱动老牛
  • 注册日期2001-08-19
  • 最后登录2015-11-27
  • 粉丝19
  • 关注10
  • 积分1316分
  • 威望2387点
  • 贡献值7点
  • 好评度321点
  • 原创分0分
  • 专家分0分
12楼#
发布于:2005-01-20 23:08
对按rayyang2000 的方法判断是不是安全模式,如果是就可以锁定或退出系统,这样不就OK了
1,承接Windows下驱动/应用开发 2,本人原创虚拟鼠标/键盘,触摸屏,虚拟显卡,Mirror驱动,XP无盘的SCSI虚拟磁盘驱动等 3,windows下有尝技术服务(包括BUG调试,员工培训等) 欢迎深圳和海外企业联系.msn:mfczmh@sina.com
bmyyyud
驱动老牛
驱动老牛
  • 注册日期2002-02-22
  • 最后登录2010-01-21
  • 粉丝0
  • 关注0
  • 积分1000分
  • 威望130点
  • 贡献值0点
  • 好评度106点
  • 原创分0分
  • 专家分0分
13楼#
发布于:2005-01-21 10:37
How to determine whether the system is running in Safe Mode from a device driver
SUMMARY
This article describes how to determine whether the system is running in Safe Mode from a device driver.
MORE INFORMATION
The Windows OS kernel exports a pointer to a ULONG variable that is named InitSafeBootMode. This variable contains the Safe Mode settings.

A device driver can determine whether the system is running in Safe Mode by the value of the InitSafeBootMode variable. A value of 0 means that the system is not running in Safe Mode.

The following table lists the modes for other values.Value  Mode
1  SAFEBOOT_MINIMAL
2  SAFEBOOT_NETWORK
3*  SAFEBOOT_DSREPAIR
*Note The value of 3 applies to Windows domain controllers only.

You must declare the following in your driver. extern PULONG InitSafeBootMode;

You must check the value of InitSafeBootMode to determine whether the system is running in Safe Mode.if (*InitSafeBootMode > 0){

     // The system is in Safe Mode.
     // Take appropriate action.
     //
}
For example, to prevent a driver from working in Safe Mode, use one of the following methods: • Function drivers

If your function driver has a service start type of SERVICE_BOOT_START, check the value of the InitSafeBootMode variable in the AddDevice routine and return failure.

Note You must never return failure from the DriverEntry routine.
• Filter drivers

If your filter driver starts during boot time, check the value of the InitSafeBootMode variable in the AddDevice routine. Do not attach to the device stack. Return success from the AddDevice routine.
• Other drivers

For drivers that are not mentioned earlier, check the value of the InitSafeBootMode variable in the DriverEntry routine. Return failure if the system is in Safe Mode.  
 

up
滚滚长江东逝水 浪花淘尽英雄 是非成败转头空 青山依旧在 几度夕阳红 白发渔樵江渚上 惯看秋月春风 一壶浊酒喜相逢 古今多少事 尽付笑谈中
idaxsy
驱动大牛
驱动大牛
  • 注册日期2004-12-09
  • 最后登录2006-03-17
  • 粉丝0
  • 关注0
  • 积分386分
  • 威望54点
  • 贡献值0点
  • 好评度8点
  • 原创分0分
  • 专家分0分
14楼#
发布于:2005-04-21 09:34
这个帖子很深刻啊!
[b]万水千山总是情,回个帖子行不行?[/b]
sharkmouse
禁止发言
禁止发言
  • 注册日期2003-05-05
  • 最后登录2016-04-11
  • 粉丝0
  • 关注0
  • 积分1355分
  • 威望7163点
  • 贡献值1点
  • 好评度24点
  • 原创分0分
  • 专家分0分
15楼#
发布于:2005-04-21 13:11
用户被禁言,该主题自动屏蔽!
游客

返回顶部