I would like to be able to dynamically change the executable code within a library I am using. Essentially, I would like to dynamically NOP out certain functions if they are
Probably the best approach is to use the system specific API to change the writability of the memory you wish to modify, modify it, then change it back.
On unix family systems, you'd want to look at mprotect
. Just keep in mind that it deals with blocks that are multiples of the page size of your system. Likely 4096, so rounding is likely required.