Dear all,
I’m writing a kernel mode encryption/decryption filter. I first try to implement it by
modifying filespy sample in DDK samples. It works fine when file is small even
using notepad. However, there is something wrong to deal with file over 4096
bytes or so. Although I’m still trying to solving this problem, I start to rewrite
the whole program based on the architecture of minifilter.
I implement it by modifying the swapbuffers sample in DDK. It works well to
deal with big file. However, I find that it can not decrypt data for applications
(like notepad) using memory mapped io.
I have use several tools. I find that IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION
packets will be received before I try to read a file through notepad. If I complete the
request directly with error status, the notepad will not show any words. Therefore,
I believe that it is a critical point. Because my filespy version works well to deal with
small files in notepad, I guess there are three possible solutions:
-
I may miss some read requests. It may come from the following two reason:
a) I decide whether or not to encrypt/decrypt a file by name. However, memory
mapped file may request by handle ID.
b) I may only hook selective IRPs in simrep, minispy, and swapbuffers example.
There may be other IRPs. -
I found that when I first open a file with notepad. The messages is decrypted.
However, notepad only shows the orignal data. Maybe I should copy data to other
place different from original swapbuffers sample. -
Maybe I can modify the response of IRP_CREATE to reject the mapped io request
or force it to go through other path.
Would you please tell me what solution would be right and how to solve it? I know
the solution would be buy OSR data modification kit. However, I am an assistant
professor. It’s a POC experiment to my encryption algorithm.
Thank you very much,
p.s. I find that OSR will hold a seminar about minifilter. Can I obtain the solution in
the seminar?
CSC