Comment on Rewrite your Ruby VM at runtime to hot patch useful featuresparentComments−tptacek16y int main(int argc, char **argv) { void *faddr = strxfrm; void *paddr = (void*) ((u_int32_t)faddr & 0xfffff000); if(mprotect(paddr, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) >= 0) { ((u_char *)faddr)[0] = 0xcc; strxfrm("foo", "", 0); } else perror("mprotect"); exit(0); } $ ./mp Trace/BPT trap The simplest answer to your question that jumps into my head is "relocations", but I'm always surprised by the everyday craziness of the C runtime and the Unix ABI, so I'm sure there's a simpler answer.
Comments