Fill data into the recv-Buffer locally

有些话、适合烂在心里 提交于 2020-01-14 10:42:36

问题


I hook into the send and recv functions in Windows. In some situations I modify the data that's going to be sent and read. In the send function, this is easy. I hook into the function, modify the source buffer and then pass it to the original function. But for the recv function, this is more complicated. When I've called the original recv function and I'm going to decide to add more data, I need to push data into the local queue so that the next call of recv would return those bytes. Any ideas on that?


回答1:


Your filter method should call recv() and then add your data to the end of the buffer, adjust the read count returned, and return it. No need to 'push data into the local queue'.



来源:https://stackoverflow.com/questions/19299638/fill-data-into-the-recv-buffer-locally

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!