Solved

Catching data written to file by another app

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

18 Experts available now in Live!

Get 1:1 Help Now