Solved

Catching data written to file by another app

Posted on 1998-12-30
3
155 Views
Last Modified: 2013-11-20
I’m using an application that asks for a filename and then writes a large amount of data to that file over the course of a day.

I would like to intercept this data and send it to another file, as it is written (essentially, creating a up-to-the-minute backup).

(This is under Windows NT.)

I've used memory-mapped files (via MFC) to do this kind of thing in the past but, in this case, I don't have access to the source code of the "originating" app.
0
Comment
Question by:sberger
  • 2
3 Comments
 

Author Comment

by:sberger
ID: 1327006
Edited text of question
0
 

Author Comment

by:sberger
ID: 1327007
Edited text of question
0
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 1327008
It is possible by hooking the 'WriteFile()' API for the originating app and intercepting the data. This can be done by creating a DLL that is mapped into the address space of the process writing to the file (see injlib.exe 'ftp://ftp.microsoft.com/softlib/mslfiles/INJLIB.EXE') and MS Systems Jounal May '94 'Load Your 32-bit DLL into Another Process's Address Space Using INJLIB' at http://www.microsoft.com/msj') and patching the function tables so that the 'WriteFile()' API call is redirected to one of your functions before you pass it through to the original function.
Feel free to ask if you need an example on how to do that and i'll send you the code (way too much to post it here... ;-)
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question