| 36 | } |
| 37 | |
| 38 | bool UnhookAPI(const std::string& name, PVOID* ppRealFn, PVOID pMineFn) |
| 39 | { |
| 40 | Initialize(); |
| 41 | |
| 42 | DetourTransactionBegin(); |
| 43 | DetourUpdateThread(GetCurrentThread()); |
| 44 | DetourDetach(ppRealFn, pMineFn); |
| 45 | |
| 46 | auto error = DetourTransactionCommit(); |
| 47 | if (error != NO_ERROR) |
| 48 | { |
| 49 | LOGE << "Error unhooking API call: " << name; |
| 50 | return false; |
| 51 | } |
| 52 | |
| 53 | LOGI << "Unooked API call: " << name; |
| 54 | return true; |
| 55 | } |
| 56 | } |