阅读:1218回复:10
在内核驱动中能否实现对给定文件的MD5哈希?
如题?
有没有人做过呢? |
|
沙发#
发布于:2005-02-21 18:25
为什么不可以,这只是算法问题,不涉及系统东西,只需要操作系统中的文件操作函数就可以了。我做过其它算法的加密,不是用MD5做hash,但我想除了算法差别外没什么其他的。
|
|
|
板凳#
发布于:2005-02-21 19:34
完全可以,没问题.....
|
|
|
地板#
发布于:2005-02-21 20:36
可不可以给个sample看看?在驱动中文件如何加载啊?
|
|
地下室#
发布于:2005-02-21 22:22
zwcreatefile,zwreadfile,zwwritefile,zwclose
zwsetinformationfile ...... |
|
|
5楼#
发布于:2005-02-22 09:40
而且,以前的帖子中还讨论过文件读写没有移动文件当前指针的函数,因为zwreadfile,zwwritefile,有一个参数ByteOffset便是从什么位置开始读写。
|
|
|
6楼#
发布于:2005-02-22 09:57
你的意思是通过ByteOffset来记录文件的读写位置?
|
|
7楼#
发布于:2005-02-22 10:05
你的意思是通过ByteOffset来记录文件的读写位置? 不是,每次读写,你可以任意指定开始位置,根本没有文件当前读写位置的概念,每次从调用该函数时你给定的ByteOffset处开始读写 |
|
|
8楼#
发布于:2005-02-22 14:50
这不是很头疼啊,我怎么知道文件什么时候结束呢?有没有简单的驱动中读文件的例子给我一个参考一下啊,非常感谢!
|
|
9楼#
发布于:2005-02-22 15:05
这不是很头疼啊,我怎么知道文件什么时候结束呢?有没有简单的驱动中读文件的例子给我一个参考一下啊,非常感谢! 用ZwQueryInformationFile带FilePositionInformation可取得文件当前位置,再说文件结束时ZwReadFile在文件结束时会自动停止 看如下 ZwReadFile begins reading from the given ByteOffset or the current file position into the given Buffer. It terminates the read operation under one of the following conditions: The buffer is full because the number of bytes specified by the Length parameter has been read. Therefore, no more data can be placed into the buffer without an overflow. The end of file is reached during the read operation, so there is no more data in the file to be transferred into the buffer. |
|
|
10楼#
发布于:2005-02-22 20:18
我可给了分了。下回再来啊!
|
|