I intercept the WSASend call and print the contents of the buffer to the console using this code
void printBuffer(BYTE* buffer, int length)
{
for (int i = 0; i < length; i++)
{
printf("%02X ", buffer[i]);
}
cout << endl;
}
int WSAAPI __WSASend(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent, DWORD dwFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
{
printBuffer((BYTE*)lpBuffers->buf, lpBuffers->len);
return _WSASend(s, lpBuffers, dwBufferCount, lpNumberOfBytesSent, dwFlags, lpOverlapped, lpCompletionRoutine);
}
I want to be able to select in the console the data I need that was printed using the printBuffer and send it again. But for this I need to perform the conversion from what printf output to a char array to pass this to WSASend. How to do it?
Example:
EB 62 1C 99 = ыb∟Щ
AA ED C8 89 0C C1 F9 = кэ╚Й♀┴∙
I think you understand me..