| 9 | } |
| 10 | |
| 11 | static void fix_browser_background(const void *rladdr) |
| 12 | { |
| 13 | #if OS_WIN |
| 14 | const char *pattern = "41 83 F8 01 74 0B 41 83 F8 02 75 0A 45 31 C0"; |
| 15 | #elif OS_MAC |
| 16 | const char *pattern = "55 48 89 E5 83 FA 01 74 ?? 83 FA 02 75 ??"; |
| 17 | #endif |
| 18 | using Fn = decltype(&get_background_color); |
| 19 | static hook::Hook<Fn> GetBackgroundColor; |
| 20 | // Find CefContext::GetBackgroundColor() |
| 21 | auto func = reinterpret_cast<Fn>(dylib::find_memory(rladdr, pattern)); |
| 22 | |
| 23 | if (func != nullptr) |
| 24 | GetBackgroundColor.hook(func, get_background_color); |
| 25 | } |
| 26 | |
| 27 | bool check_libcef_version(bool is_browser) |
| 28 | { |
no test coverage detected