【发布时间】:2014-12-15 13:17:54
【问题描述】:
我想在获取之前修改下一条指令,在 foo 函数中 This post 的最佳答案中,*p 指向 main 函数中的下一条指令。我想修改*p 指向的内容。例如,我想将下一条指令更改为跳转指令。我该怎么做?
void foo()
{
void** p = search((void**)&p, __builtin_return_address(0));
// modify content of where *p points at.
}
int main()
{
foo();
//next instruction. *p points here
return 0;
}
我想在 intel Core-i7 3632QM 处理器上使用 gcc 编译器。
【问题讨论】:
标签: c assembly gcc instructions self-modifying