简体   繁体   English

在Windows 7 32位VM上安装SSDT挂钩会返回系统错误2

[英]Installing SSDT hook on Windows 7 32-bit VM returns system error 2

I use the following code to create a driver that hooks Win7-32bit SSDT table. 我使用以下代码创建一个挂钩Win7-32​​bit SSDT表的驱动程序。 It is taken straight from Greg & Jamie's book. 它直接取自Greg&Jamie的书。 Please note that I don't even call the hooking code from main: 请注意,我什至不从main调用挂钩代码:

main.c http://pastebin.com/Ck8FSVbv main.c http://pastebin.com/Ck8FSVbv

SSDT_Hook.h http://pastebin.com/y1ssD1ni SSDT_Hook.h http://pastebin.com/y1ssD1ni

When I try to load it, sc.exe returns error 2. 当我尝试加载它时,sc.exe返回错误2。

But I can't figure out why. 但我不知道为什么。 Couldn't find answers is similar questions. 找不到答案是类似的问题。

It seems that system cannot find your driver file. 看来系统找不到您的驱动程序文件。 You probably specified bad full path when installing the service. 安装服务时,您可能指定了错误的完整路径。 Look to the service registry key 查看服务注册表项

HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\services\\<your_service_name>

for the ImagePath value. ImagePath值。 This value must contain full path to your driver file, either relative to the system root (usually C:\\Windows ), or "totally" absolute – starting with the \\??\\X: prefix ( X is the drive letter, \\??\\ makes the path absolute from the Object Manager point of view). 此值必须包含驱动程序文件的完整路径,相对于系统根目录(通常是C:\\Windows ),或者是“完全”绝对值-以\\??\\X:前缀开头( X是驱动器号\\??\\从对象管理器的角度来看, \\??\\使路径绝对)。

I assume you grabbed the code from the Rootkits: Subverting the Windows Kernel book. 我假设您从Rootkits中获取了代码:颠覆Windows内核手册。 It's a great book, howerver, keep in mind the following: 但是,这是一本很棒的书,请牢记以下几点:

1) it is kinda old and many of its codes do not work on multiprocessor machines, 1)它有点旧,并且它的许多代码在多处理器计算机上不起作用,

2) it is a hacker book which means it does not tell you how to do things nicely, it just tells you how to make a code working somewhat. 2)这是一本黑客书籍,这意味着它不会告诉您如何做得很好,而只是告诉您如何使代码工作。 A code based on it may work but may be full of errors if you lack knowledge about Windows driver development. 如果您缺乏有关Windows驱动程序开发的知识,则基于该代码的代码可能会起作用,但可能会充满错误。

That does not mean it is a bad book. 那并不意味着它是一本坏书。 It just is not a guide how you should write Windows drivers. 它只是不能指导您如何编写Windows驱动程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM