前言
哦!
更换动态链接库的装载路径
用于设置动态库的路径 export LD_LIBRARY_PATH
这样程序会在该路径下寻找动态链接库,但不会是优先加载的路径
设置export LD_PRELOAD=”./myhack.so” #设置LD_PRELOAD环境变量,库中的同名函数在程序运行时优先调用
可以来做个实验。
实验一
编写test.c
#include<stdio.h>
#include<string.h>
void main() {
char passwd[] = "password";
char str[128];
scanf("%s", &str);
if (!strcmp(passwd, str)) {
printf(