3 ms·
> Want to simulate a lseek+execve? Use dd! I can't find anything about it in the man page - does anyone know the options? I'm assuming it doesn't mean simply r
by viraptor 4y ago
> Want to simulate a lseek+execve? Use dd!
I can't find anything about it in the man page - does anyone know the options? I'm assuming it doesn't mean simply running dd with seek to output another file and then running that.
- koala_man 4y agoOriginal author here. An example would be `{ dd bs=1 count=0 skip=1234; myprogram; } < file`. This is similar to C `lseek(0, 1234, SEEK_CUR); execve("myprogram", ...);` It's not something you'd realistically use, but it's better to be limited by imagination than tooling.
- viraptor 4y agoAh, I get it! What I initially thought you meant was creating a process from an ELF embedded further into the file. For example lseek-ing into a tar file and somehow execve-ing an included binary. Not I wonder if Linux you allow me to run /dev/stdin...