diff --git a/kdstinker/driver_util.cpp b/kdstinker/driver_util.cpp index 2122d2a..6a1292b 100644 --- a/kdstinker/driver_util.cpp +++ b/kdstinker/driver_util.cpp @@ -117,14 +117,18 @@ namespace driver_util // save old function pointer result = reinterpret_cast(first_thunk->u1.Function); + // + // although disabling wp bit can cause crashes, im disabling it for nano seconds. only to write 8 bytes... + // in reality this is 1 mov instruction. + // { // // disable write protection // + _disable(); auto cr0 = __readcr0(); cr0 &= 0xfffffffffffeffff; __writecr0(cr0); - _disable(); } // swap address @@ -136,8 +140,8 @@ namespace driver_util // auto cr0 = __readcr0(); cr0 |= 0x10000; - _enable(); __writecr0(cr0); + _enable(); } return result; }