IM having a problem with detours automatically calling "int WINAPI my_send". I need to be able to call this from my GUI, That i call externally from the WINAPI MainThread.
IM new to c++ but have been programming in various languages for years. So far ive got pretty far without the need of help. But all this DLL stuff is blowing my mind hehe.
Can someone please explain how i would stop "int WINAPI my_send". Been automatically called when the dll is loaded. So i can then call from my GUI.
Gavin, you definitely have to explain the design in whole prior to be advised anything.
The highlighted stuff indicates that despite all of your years of programming you're not very good at explanations, so you need to do your best once again.
From your code I can see that "This is a dll injection, and all the game is about intercepting winsock send for some time. While send remains intercepted it sends predefined data instead of the stuff provided by application..." This is how I would start explaining.
Besides, there definitely must be some problem you say not a word about. As well, you need to explain for the app you intrude into is it okay to lose the data you substitute with your "packets", what your form main purpose is, etc. You say your form needs send later as well, but in your dll code you remove detour on dll unload only. What's the purpose? You use already intercepted send inside your my_send, so are you aware of the consequences? Is it only DLL stuff blowing your mind, or C++ stuff as well? How good you are at compiler and linker stuff?
And finally, do you really need to intercept, or there may be some other solution? Did you ever think of that?