add dlsym print to dummy

This commit is contained in:
mykola2312 2024-08-24 01:25:29 +03:00
parent 635cf023c7
commit 9bc3007a7f

View file

@ -1,6 +1,7 @@
#define _DEFAULT_SOURCE
#include <unistd.h>
#include <sys/wait.h>
#include <dlfcn.h>
#include <pthread.h>
#include <signal.h>
#include <string.h>
@ -67,6 +68,10 @@ static void sigaction_handler(int signum, siginfo_t* info, void*)
int main()
{
// print some info about libc
void* libc = dlopen("libc.so.6", RTLD_LOCAL);
printf("libc syscall %p\n", dlsym(libc, "syscall"));
// lets install some signal handlers
// for sigsegv and sig illegal instruction
struct sigaction sa;