Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am toomanybananas on github.
  • I am toomanybananas (https://keybase.io/toomanybananas) on keybase.
  • I have a public key ASAmNh_boOZDiPPO8I1vX9zW-90eaJaCBYG10LLPYyvsjQo

To claim this, I am signing this object:

@toomanybananas
toomanybananas / hook.c
Created April 24, 2018 23:30
Shared library injection with the Witchcraft Compiler Collection
#define _GNU_SOURCE
#include <dlfcn.h>
int puts(const char* s)
{
int (*oputs)(const char*) = dlsym(RTLD_NEXT, "puts");
oputs("HOOKED!");
return oputs(s);
}