sfilter

所属分类:Windows编程
开发工具:Visual C++
文件大小:37KB
下载次数:9
上传日期:2014-07-29 12:01:17
上 传 者isscall
说明:  一个文件系统过滤的加密例子,作为入门参考,演示了如何对文件内容加密
(Encryption example of a file system filter as introductory reference demonstrates how to encrypt the contents of the document)

文件列表:
sfilter\Sfilter.c (223564, 2014-02-24)
sfilter (0, 2014-02-24)

1.加密在SfWrite(IRP_MJ_WRITE)中,而不是完成例程, 解密在SfRead(IRP_MJ_READ)中,而不是完成例程, 3.只要处理IRP_NOCACHE|IRP_PAGING_IO|IRP_SYNCHRONOUS_PAGING_IO 2.加密简单过程: a.得到Windows传下来的Buffer Address, if (Irp->MdlAddress) { SysDataBuf = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); } else { SysDataBuf = Irp->UserBuffer; } b.保存明文SysDataBuf 在SysDataBufFirst c.用你强大的算法加密SysDataBuf -->> MyBuf d.把MyBuf Copy到 SysDataBuf, e.IoCallDriver 把密文向下传,写入HardDisk。 f.恢复内存的明文 RtlCopyMemory(SysDataBuf,SysDataBufFirst, ulWriteLen);. 3.解密的大致过程: a.IoCallDriver 读到密文 b,解密 c。IoCompleteRequest 搞定

近期下载者

相关文件


收藏者