4 ms·
if you could recover "cat" and if there was /proc.. oh well, lots of "if there were".
by xtacy 17y ago
if you could recover "cat" and if there was /proc.. oh well, lots of "if there were".
- rdtsc 17y agoPerhaps just use shells with more builtin commands? Something like busybox. So if you ever do rm -rf * and don't close your shell you still have all the basic utilities available.
- jedbrown 17y agoBusybox is a binary that inspects argv[0] to determine how to behave. This is very different from shell builtins that do not launch a new executable, and will thus function correctly after the executable is remove from the file system. As far as I know, you cannot get busybox to perform it's other functions as "builtins". But if you have a functional debugger, it should be possible, though computing offsets is likely to be hard without another machine (chances are that the busybox binary has been stripped).
- pronoiac 17y agoWhile busybox is running, if /proc is still there, you could probably use its file descriptor to get it back.