1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #include "zend.h"
- #include "phpdbg.h"
- int mprotect(void *addr, size_t size, int protection) {
- int var;
- return (int)VirtualProtect(addr, size, protection == (PROT_READ | PROT_WRITE) ? PAGE_READWRITE : PAGE_READONLY, &var);
- }
- int phpdbg_exception_handler_win32(EXCEPTION_POINTERS *xp) {
- EXCEPTION_RECORD *xr = xp->ExceptionRecord;
- CONTEXT *xc = xp->ContextRecord;
- if(xr->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
- if (phpdbg_watchpoint_segfault_handler((void *)xr->ExceptionInformation[1]) == SUCCESS) {
- return EXCEPTION_CONTINUE_EXECUTION;
- }
- }
- return EXCEPTION_CONTINUE_SEARCH;
- }
|