0

I have a program that calls send (), I need to change the host to my own, but this does not work (either the program crashes or the request does not reach the server) - I log requests on the server. What could be the problem?

int WINAPI Mine_Send(SOCKET s, const char* buf, int len, int flags) {

string sdata = "Host: myhost.com\r\r\nConnection: close\r\r\nAccept-Encoding: gzip,deflate\r\r\n\r\r\n";

const char* cstr = sdata.c_str();

return Real_Send(s, cstr, strlen(cstr), flags);
}
2
  • How are you hooking that function? – morsisko Nov 1 '20 at 19:37
  • The function works. I can output the buffer that comes to the method. But I do not know how to replace the original buffer with my own. – IRED Nov 1 '20 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.