阅读:986回复:3
为什么读出来的仍然是明文?
SfRead里面如下处理:
if(Irp->Flags & (IRP_PAGING_IO || IRP_SYNCHRONOUS_PAGING_IO || IRP_NOCACHE)) { IoCopyCurrentIrpStackLocationToNext ( Irp ); IoSetCompletionRoutine( Irp, SfReadCompletion, 0, TRUE, TRUE, TRUE ); return IoCallDriver( pMyExtension->NLExtHeader.AttachedToDeviceObject, Irp ); } SfRead的完成函数里面如下处理: ReadLength = Irp->IoStatus.Information; if( Irp->PendingReturned ) { IoMarkIrpPending( Irp ); } if(Irp->MdlAddress) pdata = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); else pdata = Irp->UserBuffer; tmpBuf = (PCHAR)ExAllocatePool( NonPagedPool, ReadLength); RtlCopyMemory(tmpBuf, pdata, ReadLength); Decrypt(tmpBuf);//解密 Irp->MdlAddress = NULL; //build new MDL PMDL pMdl=IoAllocateMdl( tmpBuf, ReadLength, FALSE, TRUE, Irp); MmBuildMdlForNonPagedPool(pMdl); Irp->MdlAddress=pMdl; return Irp->IoStatus.Status; |
|
沙发#
发布于:2007-01-25 21:09
Decrypt(tmpBuf);//解密
多莫明显,这不产生明文,难道说产生秘文? |
|
|
板凳#
发布于:2007-01-26 00:16
谢谢斑竹,我表述有误!
读出的是秘文。 不知道为什么 |
|
地板#
发布于:2007-01-26 13:44
Cache 里面可能是密文件
在读的时候可能根本没去读read 而是 fastioread |
|