C ++ interception process and display status

Ok, so I'm slowly learning C ++. I am familiar with all the syntax of the console and everything, but now I'm moving on to Windows programming. Now, what I'm trying to do is create a DLL that I insert into the process, so it connects. All I want the C ++ application to do is have text in it that says “hooked” if it was successfully entered, and if something happened. Or even if I can do it without a DLL, just open the executable file, and when a certain process that I'm trying to connect opens, the status will change to “hooked”. I also have a safaribooksonline.com account, so if there are good readings that you would recommend, just write down. thank

+3
source share
3 answers

I think you could take a look at it back. In C / C ++, an application “pulls out” a DLL instead of having a DLL “injected” into the application. Typically, for plugins / hooks, there is some mechanism for informing the application about the availability of the DLL (often only its presence in a particular directory), and the configuration file or some other logic is used to indicate the explicit loading of the library, extract a function or two, and call them.

For Windows programming, I suggest looking for examples of calling the LoadLibrary () API. You will probably find a tutorial or two on how to do this.

+3
source

"hooked" " DLL- ", CreateRemoteThread(). , . , .

" DLL ", SetWindowsHookEx().

+1

Looks like you want to paste as soon as the application starts? You can do this with Microsoft Detours DetourCreateProcessWithDll(). An example is here .

0
source

Source: https://habr.com/ru/post/1746905/


All Articles