Hello,
I'm a pickle at the moment. I have been playing around with import table hijacking, well now I want to rewrite a function and to avoid having the program malfunction, I need to use the old function in the new function; that's besides the point.
I have something like this, which would pointer function
typedef int (__cdecl * oldfunct)(SOCKET s, const char *buf, int len, int flags);
I however do not know how to assign oldfunct a value, in other words, I don't know how to cast it;
oldfunct = pThunk2->Function; //pThunk2->Function == the pointer
doesn't work and neither do
oldfunct = (int __cdecl) pThunk2->Function;
oldfunct = (int __cdecl *)(SOCKET , const char *, int , int ) pThunk2->Function;
oldfunct = (int __cdecl) pThunk2->Function;
oldfunct = (int __cdecl *) (SOCKET , const char *, int , int )pThunk2->Function;
Any advice is appreciated, thanks.