您的位置:首页 > 其它

如何得到一个函数在内存中的大小

2017-07-29 01:09 148 查看
一下的例子为得到函数test的大小,大小为dwSize

#pragma check_stack (off)
void test()
{
int x;
std::cin >> x;
std::cout << x;
int a, b, c, d;
std::cin >> a >> b >> c >> d;
printf("%d\n", x);
}
void afterFunc()
{
return;
}
#pragma check_stack

//得到函数大小
DWORD dwSize = ((BYTE *)(DWORD)afterFunc - (BYTE *)(DWORD)test);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  函数 内存
相关文章推荐