From c40af681bfedfa53c65a7f8fb9260f612e45ac3b Mon Sep 17 00:00:00 2001 From: Tixx <83774803+WiserTixx@users.noreply.github.com> Date: Sun, 21 Sep 2025 21:39:38 +0200 Subject: [PATCH] Strip bom encoding --- src/Security/BeamNG.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Security/BeamNG.cpp b/src/Security/BeamNG.cpp index 58167b7..19f5524 100644 --- a/src/Security/BeamNG.cpp +++ b/src/Security/BeamNG.cpp @@ -177,6 +177,10 @@ void LegitimacyCheck() { std::string contents((std::istreambuf_iterator(beamngIni)), std::istreambuf_iterator()); beamngIni.close(); + if (contents.size() >= 3 && (unsigned char)contents[0] == 0xEF && (unsigned char)contents[1] == 0xBB && (unsigned char)contents[2] == 0xBF) { + contents = contents.substr(3); + } + auto ini = Utils::ParseINI(contents); if (ini.empty()) lowExit(3);