dyninst动态插桩示例代码:
版本:
dyninst-9.3.1
gcc-4.8.4
简述:示例代码演示动态插桩,在程序运行时动态改变运行的函数。
被插装的程序(mutatee)源码:test_dyninst.c
#include
#include
void old()
{
printf("Oh my god! Pid is %d\n", getpid());
}
void new()
{
printf("Hello world! Pid is %d\n", getpid());
}
int main()
{
whi