From ea7529c1d74a804ef0bff61635b9abaee0251538 Mon Sep 17 00:00:00 2001 From: neru Date: Wed, 24 Jun 2026 02:18:44 -0300 Subject: [PATCH] feat: bypass xbox chat filtering --- src/unlocker/main.cpp | 6 ++++-- src/unlocker/spoofer.cpp | 1 + src/unlocker/xbox-fixes.cpp | 17 +++++++++++++++++ src/unlocker/xbox-fixes.h | 20 ++++++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 src/unlocker/xbox-fixes.cpp create mode 100644 src/unlocker/xbox-fixes.h diff --git a/src/unlocker/main.cpp b/src/unlocker/main.cpp index 1d74a6e..42959e7 100644 --- a/src/unlocker/main.cpp +++ b/src/unlocker/main.cpp @@ -6,6 +6,7 @@ #include "log-sink-file.h" #include "proxy-configurator.h" #include "cache-cleaner.h" +#include "xbox-fixes.h" #include #include @@ -103,9 +104,11 @@ bool run() conf = new ProxyConfigurator(); conf->setProxy("127.0.0.1", 44444); - mainLog.info("Instantiating spoofer and registering proxy listeners"); + mainLog.info("Instantiating and registering proxy listeners"); Spoofer* spoofer = new Spoofer(); + XboxFixes* xboxFix = new XboxFixes(); spoofer->registerListeners(proxy); + xboxFix->registerListeners(proxy); mainLog.info("Starting proxy"); if (!proxy->init()) @@ -117,7 +120,6 @@ bool run() } mainLog.info("Setting up system tray icon"); - TrayIcon tray; tray.setExitCallback([&]() { running = false; diff --git a/src/unlocker/spoofer.cpp b/src/unlocker/spoofer.cpp index 26ab1ae..2e37877 100644 --- a/src/unlocker/spoofer.cpp +++ b/src/unlocker/spoofer.cpp @@ -54,6 +54,7 @@ Spoofer::~Spoofer() delete _log; } + void Spoofer::registerListeners(TinyMITMProxy* proxy) { proxy->onClientRequest.addListener( diff --git a/src/unlocker/xbox-fixes.cpp b/src/unlocker/xbox-fixes.cpp new file mode 100644 index 0000000..824c799 --- /dev/null +++ b/src/unlocker/xbox-fixes.cpp @@ -0,0 +1,17 @@ +#include "xbox-fixes.h" + +XboxFixes::XboxFixes() {} + +XboxFixes::~XboxFixes() {} + +void XboxFixes::antiCensor(std::string& body) +{ + body = R"-({"verifyStringResult":[{"resultCode":0,"offendingString":null}]})-"; +} + +void XboxFixes::serverResponseHandler(const std::string& url, std::string& body, std::string& /*headers*/, + bool& /*blockOutgoing*/) { + if (url.find("xboxlive.com") == std::string::npos) return; + + if (url.ends_with("/system/strings/validate")) return antiCensor(body); +} diff --git a/src/unlocker/xbox-fixes.h b/src/unlocker/xbox-fixes.h new file mode 100644 index 0000000..996fb37 --- /dev/null +++ b/src/unlocker/xbox-fixes.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +class TinyMITMProxy; + +class XboxFixes +{ + public: + XboxFixes(); + ~XboxFixes(); + + void registerListeners(TinyMITMProxy* proxy); + + private: + void antiCensor(std::string& body); + + void serverResponseHandler(const std::string& url, std::string& body, std::string& headers, + bool& blockOutgoing); +};