【发布时间】:2012-06-26 08:31:12
【问题描述】:
我想知道如何记录函数的堆栈返回地址?
如果你记录这样的参数:
int (WINAPI *pSend)(SOCKET s, const char* buf, int len, int flags) = send;
int WINAPI MySend(SOCKET s, const char* buf, int len, int flags);
//在DllMain下面
int WINAPI MySend(SOCKET s, const char* buf, int len, int flags)
{
fopen_s(&pSendLogFile, "C:\\SendLog.txt", "a+");
fprintf(pSendLogFile, "%s\n", buf);
fclose(pSendLogFile);
return pSend(s, buf, len, flags);
}
那我该如何记录 Send 的返回地址呢?
【问题讨论】:
-
返回地址是指保存的EIP吗?
-
你想拦截Socks.dll之类的win32 dll的Send函数还是你自己的send函数?
标签: c++ c logging assembly hook