public
Last active

  • Download Gist
gistfile1.h
C
1 2 3 4 5 6 7 8 9 10
/* gcc -o nostdlib nostdlib.c -m32 -z execstack -nostdlib */
/* Who needs libc or asm() when you can abuse the ABI in horrible ways?*/
typedef int (*sc_fun)(int,int,int,int,int,int,int);
 
void _start(void) {
char syscall[] = "\x60\x83\xc4\x24\x58\x5b\x59\x5a\x5e\x5f\x5d\xcd\x80\x83\xec\x40\x61\xc3";
 
((sc_fun)syscall)(4, 0, "Hello, World\n", 13, 0, 0, 0);
((sc_fun)syscall)(1, 0, 0, 0, 0, 0, 0);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.