Skip to content

Instantly share code, notes, and snippets.

@hshrzd

hshrzd/memcmp.c Secret

Created January 4, 2021 21:20
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 hshrzd/c96268a67f7da7b6a831ae68b080a7ae to your computer and use it in GitHub Desktop.
Save hshrzd/c96268a67f7da7b6a831ae68b080a7ae to your computer and use it in GitHub Desktop.
/*
Compile:
gcc -fPIC -c -m32 memcmp.c -o memcmp.o
gcc -shared -m32 -o memcmp.so memcmp.o
*/
#include <stdio.h>
int memcmp(const void *s1, const void *s2, size_t n)
{
printf("s1: %s\n", (char*)s1);
printf("s2: %s\n", (char*)s2);
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment