Changing code at runtime

Posted by Pagis on Stack Overflow See other posts from Stack Overflow or by Pagis
Published on 2010-03-29T09:57:54Z Indexed on 2010/03/29 10:03 UTC
Read the original article Hit count: 363

Filed under:
|
|
|

I have a pointer to a function (which i get from a vtable) and I want to edit the function by changing the assembler code (changing a few bytes) at runtime. I tried using memset and also tried assigning the new value directly (something like mPtr[0] = X, mPtr[1] = Y etc.) but I keep getting segmentation fault. How can I change the code?

(I'm using C++)

© Stack Overflow or respective owner

Related posts about c++

Related posts about assembler