add linux dlsym hook

This commit is contained in:
king
2024-08-10 12:24:02 +00:00
parent 55a71164b7
commit 8400493329
3 changed files with 170 additions and 1 deletions

29
test_so/test_so.c Executable file
View File

@@ -0,0 +1,29 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
// posix
int main() {
int fd = open("a.txt", O_CREAT | O_RDWR);
char *buffer = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
write(fd, buffer, strlen(buffer));
char rbuffer[128] = {0};
read(fd, buffer, 128);
printf("rbuffer: %s\n", buffer);
close(fd);
}