static void r_munprotect(unsigned int addr, unsigned int len, unsigned char *eip) { if (EFLAGS & EFLAGS_DF) addr -= len; if (debug_level('e')>3) dbug_printf("\tR_MUNPROT %08x:%08x %s\n", addr,addr+len,(EFLAGS&EFLAGS_DF?"back":"fwd")); if (LINEAR2UNIX(addr) != MEM_BASE32(addr) && !e_querymark(addr, len)) return; InvalidateNodePage(addr,len,eip,NULL); e_resetpagemarks(addr,len); e_munprotect(addr,len); }
/* * Return address of the stub function is passed into eip */ static void m_munprotect(unsigned int addr, unsigned int len, unsigned char *eip) { if (debug_level('e')>3) e_printf("\tM_MUNPROT %08x:%p [%08x]\n", addr,eip,*((int *)(eip-3))); /* if only data in aliased low memory is hit, nothing to do */ if (LINEAR2UNIX(addr) != MEM_BASE32(addr) && !e_querymark(addr, len)) return; /* Always unprotect and clear all code in the pages * for either DPMI data or code. * Maybe the stub was set up before that code was parsed. * Clear that code */ if (debug_level('e')>1 && e_querymark(addr, len)) e_printf("CODE %08x hit in DATA %p patch\n",addr,eip); /* if (UnCpatch((void *)(eip-3))) leavedos_main(0); */ InvalidateNodePage(addr,len,eip,NULL); e_resetpagemarks(addr,len); e_munprotect(addr,len); }