Detect file 'COPY' operation in Windows

后端 未结 5 789
慢半拍i
慢半拍i 2020-12-15 14:13

Say I want to be informed whenever a file copy is launched on my system and get the file name, the destination where it is being copied or moved and the time of copy.

<
5条回答
  •  一生所求
    2020-12-15 14:45

    As Andrew says a filter driver is the way to go.

    There is no foolproof way of detecting a file copy as different programs copy files in different ways (some may use the CopyFile API, others may just read one file and write out the contents to another themselves). You could try calculating a hash in your filter driver of any file opened for reading, and then do the same after a program finishes writing to a file. If the hashes match you know you have a file copy. However this technique may be slow. If you just hook the CopyFile API you will miss file copies made without that API. Java programs (to name but one) have no access to the CopyFile API.

提交回复
热议问题