Skip to content

Instantly share code, notes, and snippets.

View sdaugherty's full-sized avatar

Stephanie Daugherty sdaugherty

View GitHub Profile
@17twenty
17twenty / blockdebugdetect.c
Created May 20, 2014 18:52
LD_PRELOAD=blockdebugdetect.so strace ./testDebug
/* Simple source code for a library to prevent apps being able to see if they're running under debug
* compile as follows:
* gcc -shared -fPIC blockdebugdetect.c -o blockdebugdetect.so
* then use LD_PRELOAD to override as follows:
* LD_PRELOAD=blockdebugdetect.so strace ./testDebug
*/
long ptrace(int request, int pid, void *addr, void *data)
{
/* Nope - we're definitely not running under a debugger mwaahahahahaa */