Add configurable URL hooks

Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
2026-06-20 08:12:06 +08:00
parent 58aa9be073
commit baa0f6e7e7
11 changed files with 233 additions and 3 deletions
+16
View File
@@ -1,5 +1,7 @@
#include "stdinclude.hpp"
#include <cstdarg>
namespace {
HANDLE g_log_file = INVALID_HANDLE_VALUE;
@@ -53,3 +55,17 @@ void hook_log(const char* message) {
WriteFile(log_file, message, lstrlenA(message), &ignored, nullptr);
WriteFile(log_file, "\r\n", 2, &ignored, nullptr);
}
void hook_logf(const char* format, ...) {
if (!format) {
return;
}
char buffer[1024] = {};
va_list args;
va_start(args, format);
wvsprintfA(buffer, format, args);
va_end(args);
hook_log(buffer);
}