mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +08:00
Add Logging for HTTP Start Requests (#3667)
This commit is contained in:
parent
0d18cd6e59
commit
b0b56ee4f7
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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()))
|
||||
|
Loading…
Reference in New Issue
Block a user