Add Logging for HTTP Start Requests (#3667)
Some checks are pending
Nightly Build / Build Nightly (push) Waiting to run
Nightly Build / Recreate Release (push) Blocked by required conditions
Nightly Build / Check Recent Commit (push) Successful in 1m0s

This commit is contained in:
Arthur 2024-09-07 14:59:32 +03:00 committed by GitHub
parent 41942f4d84
commit 18fcde5fc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View File

@ -120,6 +120,7 @@ namespace big
int metric_logs{};
int packet_logs{};
bool http_start_request_logs{};
bool script_hook_logs{};
struct script_event
@ -134,7 +135,7 @@ namespace big
NLOHMANN_DEFINE_TYPE_INTRUSIVE(script_event, logs, filter_player, player_id)
} script_event{};
NLOHMANN_DEFINE_TYPE_INTRUSIVE(logs, metric_logs, packet_logs, script_hook_logs, script_event)
NLOHMANN_DEFINE_TYPE_INTRUSIVE(logs, metric_logs, packet_logs, http_start_request_logs, script_hook_logs, script_event)
} logs{};
struct fuzzer

View File

@ -4,11 +4,14 @@ namespace big
{
bool hooks::http_start_request(void* request, const char* uri)
{
if (g.debug.logs.http_start_request_logs)
LOG(INFO) << uri;
if (strstr(uri, "Bonus")) [[unlikely]]
{
// This is for worst case scenario where a report does slip through the cracks...
// Lets make it go somewhere it doesn't matter -- don't let the reports reach their servers!
LOG(WARNING) << "Blocked bonus report!";
LOG(WARNING) << "Blocked bonus report!";
uri = "https://0.0.0.0/";
}
return g_hooking->get_original<hooks::http_start_request>()(request, uri);

View File

@ -11,6 +11,7 @@ namespace big
static const char* options[]{"OFF"_T.data(), "ALL"_T.data(), "FILTERS"_T.data()};
ImGui::Combo("DEBUG_LOG_METRICS"_T.data(), (int*)&g.debug.logs.metric_logs, options, IM_ARRAYSIZE(options));
ImGui::Combo("VIEW_DEBUG_LOGS_LOG_PACKETS"_T.data(), (int*)&g.debug.logs.packet_logs, options, IM_ARRAYSIZE(options));
ImGui::Checkbox("DEBUG_LOG_HTTP_START_REQUESTS"_T.data(), &g.debug.logs.http_start_request_logs);
ImGui::Checkbox("DEBUG_LOG_NATIVE_SCRIPT_HOOKS"_T.data(), &g.debug.logs.script_hook_logs);
if (ImGui::TreeNode("DEBUG_LOG_TREE_SCRIPT_EVENT"_T.data()))