Skip to content

Instantly share code, notes, and snippets.

View julian7's full-sized avatar

Balazs Nagy julian7

View GitHub Profile
// gcc -shared -fPIC -o liboverride_strcmp.so -ldl override_strcmp.c
// LD_PRELOAD=$PWD/liboverride_strcmp.so <command>
#define _GNU_SOURCE 1
#include <stdio.h>
#include <string.h>
#include <dlfcn.h>
#define MAGIC "MAGIC"
int strcmp(const char *s1, const char *s2) {