1

Using PTRACE_POKEDATA to replace data in the heap of a process

view story
linux-howto

http://stackoverflow.com – I would like to use ptrace in order to attach my tool to a Linux process, read and write to the heap memory of this process and again detach my tool. Actually, it's not working although there is no error. I can not see any modifications in the heap memory of the process after I run the tool. Anyway, I'm quite not sure if that is possible in general. Currently, my C code looks like this: int res = 0, i = 0; int size = heap_address->end - heap_address->start; char tmp_page[size]; memset(tmp_page, 'x', size); // just a test, I know this makes no sense print (HowTos)