YY指针堆栈,测试你的基础知识。
积木 2005-12-03 09:12:31 一个小bt写的,转过来,不运行猜猜这个程序的运行结果。
#include <stdio.h>
int funa(void)
{
printf("AAAAA");
exit(3);
return 0;
}
int funb(int (*p)(void))
{
char *h;
h = &h;
/* point to the first variable */
h += sizeof(char *);
/* point to the old ebp */
h += sizeof(char *);
/* point to the return address */
(*(int (**)(void))(h)) = p;
return 0;
}
int main()
{
funb(funa);
return 0;
}