There is a thing that has been bugging me. Actually, there is a virus in my computer. Well I tried everything to get rid of it but it seems there is a parent process creating and modifying new files and registry entries every time I try to delete the keys or the files.
So all I wanted to ask was How to monitor the windows so that I may be informed about which process is trying to create a new process or new file via C++. I mean which API or whatever..???
I already understand that there is gonna be hell of a difficult job but I want to know anyways. So please let the suggestions flow on. And thanks in advance :D
If there is a "parent" program watching for when you close the application it's probably running as a service. If you end up wanting to do this somewhere between the hard way and "WTF did I get myself into?!!!!" then pull up a command line, type
sc query > services.txt
then press enter, when it finishes type
services.txt
then enter, press Ctrl+F at the notepad or what ever and search for the name of the undesired application. This will generally (but not always) lead you to the service that is hosting it.
@ kbw: I have to respectfully disagree with you there. The last virus I couldn't remove wasn't "too advanced"; it had corrupted the boot loader. I agree that the OP is going about this in a very painful manner, but I actually did the same kind of thing when I was younger. It's how I believe I learned the most about Windows.
@webjose: Sorry, I've got Win XP. It says Win Vista minm.
@ComputerGeek01 I'm on it.
Also I'm not quite getting what I wanted (you tried webJose). I just want to know which App is creating which file and which app is creating new process.. And I WANT TO PROGRAM IT MYSELF..
Thanks in advance
The problem with your request is that Windows doesn't actually record what applications made what changes to a file, it doesn't actually care since permission\authentication is done by security token not by a list of allowed process (This changes in a few VERY specific instances with certain critical files but not until Windows Vista). So you have to do some creative programming, I don't see it yet because I just learned of the function myself but I think webJose gave you a good starting point.
There is a Microsoft library called Detours that can re-route Windows API calls. If you can re-route CreateFile() for example, you could log the calling process.
Hi
System has it self tool for watching what files are created accessed just like a log file for this thing... now I DO NOT remember what its name but is there :-) I was using it a bit my self... Just to give you a tip...