Fill data into the recv-Buffer locally

2019-06-25 12:58发布

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条回答
太酷不给撩
2楼-- · 2019-06-25 13:35

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'.

查看更多
登录 后发表回答