Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to intercept each trying to use API function in C#?

i need to block any screen capture software on the computer from taking screen shots. Since all of them are work on standard API-functions, i think i could monitor and block them. I need to use C#. All i have found is how to monitor and block them in a certain program (screen capture program). They are looking for a function in the program, then they change it address on mine function address. But how can i do it, if i haven't any certain programs? I need to block anyone which tries to take a screenshot.

like image 499
StewKlimp Avatar asked Oct 20 '25 12:10

StewKlimp


1 Answers

If your final goal is possible or not I don't know, but for the hooking the API portion I can help you out.

I have used the library EasyHook many times in the past, this will let you hook and intercept system function calls from C# code fairly easily. Just read through the PDF tutorial for setup instructions.

For actually finding the API's I recommend Rohitab's API Monitor, it's still in Alpha stages but it works really well and is free. You just hook it on to a processes and it tells you every external DLL call it makes (with the parameters it passed if you have the xml definition file for the DLL, the program comes with almost all of the windows API dll's pre-defined).

enter image description here

The combination of EasyHook and API Monitor is a great 1-2 punch for mucking with other program's calls.

like image 179
Scott Chamberlain Avatar answered Oct 23 '25 02:10

Scott Chamberlain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!