// ./stdin < 22.bin o cat 22.bin | ./stdin #include #include // gets() is dangerous, it doesn't check the size of the buffer char *gets(char *s) { int c = '\0'; char *dest = s; while ((c = getchar()) != EOF && c != '\n') *dest++ = c; *dest = '\0'; return s; } int main() { char shellcode[64]; gets(shellcode); printf("shellcode[%zu] = %s\n", strlen(shellcode), shellcode); ((void (*)())shellcode)(); }