Skip to content

Instantly share code, notes, and snippets.

@Silva97
Last active December 24, 2022 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Silva97/1737e46bbd2f74802c6558f702b1c1ea to your computer and use it in GitHub Desktop.
Save Silva97/1737e46bbd2f74802c6558f702b1c1ea to your computer and use it in GitHub Desktop.
#define _GNU_SOURCE
#include <dlfcn.h>
typedef int (*puts_t)(const char *);
int puts(const char *string)
{
puts_t original_puts = dlsym(RTLD_NEXT, "puts");
original_puts("-- Hookado --");
return original_puts(string);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment