4 ms·
Given the idea behind this repo is to cause pain, why not add a shebang to your file [0] to make it executable. I saw a blog post a long time ago that went int
by maccard 2y ago
Given the idea behind this repo is to cause pain, why not add a shebang to your file [0] to make it executable.
I saw a blog post a long time ago that went into the details of how ./foo worked, and how it executed an elf file. You could register `.c` programs in the same way to be compiled and run?
[0] https://gist.github.com/jdarpinian/1952a58b823222627cc1a8b83a7aa4e2 https://gist.github.com/jdarpinian/1952a58b823222627cc1a8b83...
- nneonneo 2y agoNow I have a very evil idea: what about registering a binfmt handler for the header bytes “#include”? Sure, it doesn’t handle all C/C++ programs (notably any program that dares to start with a comment), but it would not require modifying any source code! (For even more insanity I guess you could also trigger on // and /*, although there’s some risk of false positives then!)