1 /* $Id: RTmutatedBinary.c,v 1.6 2003/02/04 15:19:04 bernat Exp $ */
3 /* this file contains the code to restore the necessary
4 data for a mutated binary
10 extern int isMutatedExec;
13 /* checkMutatedFile() is defined in RTmutatedBinary_<fileformat>.c */
15 extern int checkMutatedFile();
18 * This function sets up pre-initialization
19 * data structures for SaveTheWorld. Ensure
20 * it is called _before_ DYNINSTinit
22 void RTmutatedBinary_init(){
24 /* this buffer is allocated to clear
25 the first page on the heap. This is necessary
26 because loading the heap tramps uses mmap, which
27 is going to eat the heap if the heap begins on
28 the same page the heap tramps end on (almost certain)
30 /* Call-once protection */
34 buffer = (char*) malloc(getpagesize());
35 isMutatedExec =checkMutatedFile();