Solved

Catching data written to file by another app

Posted on 1998-12-30
3
156 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 55
mixString challenge 36 134
unable to delete all specified values regedit 38 695
Problem to event 3 112
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

680 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