How to write to another process address space using python under Ubuntu Linux? My attempts:
1) Using the virtual file / proc / $ PID / mem and finding the address. I have successfully used it to read memory, but trying to write raises an IOError:
fd=open("/proc/"+pid+"/mem","r+")
fd.seek(address,0)
fd.write("ABC")
Conclusion:
IOError: [Errno 22] Invalid argument
2) An attempt to use the python-ptrace library, as suggested in other threads. However, I cannot find good documentation or sample code.
Note. This is not a root privilege issue, it produces the same behavior.
source
share