add linux dlsym hook
This commit is contained in:
29
test_so/test_so.c
Executable file
29
test_so/test_so.c
Executable 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user