Last active
February 24, 2024 16:08
-
-
Save LostMyselfInTheNowhere/249d62985c2025b04c89f20c8902f293 to your computer and use it in GitHub Desktop.
Shell stub for C, makes the source file compile itself just by running it (C/Bash polyglot)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SHELL_STUB /* | |
CC="gcc"; "$CC" -o "$0.elf" "$0"; ./"$0.elf"; rm -rf "$0.elf"; exit | |
*/ | |
#include <stdio.h> | |
int main(void) { | |
printf("Hello! ^w^\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment