Skip to content

Instantly share code, notes, and snippets.

@jedisct1
Created October 4, 2012 20:19
Show Gist options
  • Save jedisct1/3836158 to your computer and use it in GitHub Desktop.
Save jedisct1/3836158 to your computer and use it in GitHub Desktop.
ptrace interposing
#include <sys/types.h>
#include <sys/ptrace.h>
int ptrace_interposed(int request, pid_t pid, caddr_t addr, int data)
{
return 0;
}
const struct { void *hook_func; void *real_func; }
interposers[] __attribute__ ((section("__DATA, __interpose"))) = {
{ ptrace_interposed, ptrace }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment