我在gdb中使用了反汇编主程序,例如我在gdb中使用了反汇编main来确定下一行的地址,这就是我跳到所需行的方式。有没有一种方法可以使用反汇编主程序确定下一行的地址。即直接在c中。如果还有其他方法,请提及。在c中跳过代码行
#include<stdio.h>
fun()
{
int i,*j;
j=&i;
j++;
j++;
j++;
*j=*j+13; //to skip first printf +13
*j=*j+21; //to skip first and second printf +21 ie. 21 + 13
//*j=*j+13; //to skip first,second,third printf +13 ie. 21 + 13 + 13
}
main()
{
int a;
a=5;
fun();
printf("hello1");
printf("%d\n",a);
printf("hello2");
}
您正在超越C-标准,并且绝对没有可行的方法来做到这一点。为什么不让'fun'返回一个真或假的值,并决定如果你想跳过'printf'? – 2013-04-30 00:33:27