Get the latest tech news
Pseudo Graceful Process Termination Through Code Injection
This blog post outlines the utilization of code injection to create a tool capable of gracefully terminating any program, setting its exit code to 0.
On UNIX systems, terminating programs involves sending signals, such as SIGTERM or SIGKILL, to the target process. Since we aim for a graceful exit, the program must not crash or exhibit undefined behavior as soon as we start editing the executing code. By analyzing/proc/PID/maps of the target process it is possible to scan every memory mapping that has the executable bit set for the syscall opcode and make the program counter point to it.
Or read this on Hacker News