Skip to content

Instantly share code, notes, and snippets.

@canoon
Created August 24, 2011 13:10
Show Gist options
  • Save canoon/1168023 to your computer and use it in GitHub Desktop.
Save canoon/1168023 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int *p;
void foo(int *n) {
p = ((void **)n)[0];
((int (*)(void))((void**)n)[1])();
}
void bar() {
printf("%d\n", *p);
}
void baz() {
int n = 4;
foo((void *[2]){&n, &bar});
}
void fuck_stack() {
int g = 0;
int h = 0;
int i = 0;
int p = 0;
int n = 5;
}
int main(void) {
baz();
fuck_stack();
bar();
return 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment