Solved

Catching data written to file by another app

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Detect CR LF to each line 12 161
EvenOdd challenge 10 108
Unix Command -- Challenging  question 7 90
Updating statistics with error notification email in SQL server 4 95
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 …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

777 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