Solved

Catching data written to file by another app

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

910 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now