You can read and write to other processes memory addresses on Linux using /proc/mem,
https://renenyffenegger.ch/notes/Linux/memory/read-write-ano...
You need the same access as you would for connecting gdb, so generally need to be running in the same uid, or be root.