feat: add FSL API Support (#314)

Co-authored-by: ThePosiDong <kurdanstpolek@gmail.com>
This commit is contained in:
Peter Witgs
2025-05-17 04:20:23 +02:00
committed by GitHub
parent a08503160c
commit ff5d776c47
2 changed files with 49 additions and 0 deletions
+31
View File
@@ -6,6 +6,11 @@
#include "game/backend/NativeHooks.hpp"
#include "game/gta/Natives.hpp"
using FnGetVersion = int(*)();
using FnLocalSaves = bool(*)();
using FnBattlEyeBypass = bool(*)();
namespace YimMenu
{
static bool CheckForFSL()
@@ -43,6 +48,32 @@ namespace YimMenu
LOGF(VERBOSE, "Anticheat bypass mode: {}", mode);
if (m_IsFSLLoaded)
{
HMODULE hFSL = GetModuleHandleA("WINMM.dll");
if (hFSL)
{
auto LawnchairGetVersion = reinterpret_cast<FnGetVersion>(GetProcAddress(hFSL, "LawnchairGetVersion"));
auto LawnchairIsProvidingLocalSaves = reinterpret_cast<FnLocalSaves>(GetProcAddress(hFSL, "LawnchairIsProvidingLocalSaves"));
auto LawnchairIsProvidingBattlEyeBypass = reinterpret_cast<FnBattlEyeBypass>(GetProcAddress(hFSL, "LawnchairIsProvidingBattlEyeBypass"));
if (LawnchairGetVersion && LawnchairIsProvidingLocalSaves && LawnchairIsProvidingBattlEyeBypass)
{
m_FSLVersion = LawnchairGetVersion();
m_ProvidesLocalSaves = LawnchairIsProvidingLocalSaves();
m_ProvidesBEBYPASS = LawnchairIsProvidingBattlEyeBypass();
LOGF(VERBOSE, "FSL Version: {}", m_FSLVersion);
LOGF(VERBOSE, "FSL Local Saves: {}", m_ProvidesLocalSaves ? "Enabled" : "Disabled");
LOGF(VERBOSE, "FSL BE Bypass: {}", m_ProvidesBEBYPASS ? "Enabled" : "Disabled");
}
else
{
LOGF(WARNING, "FSL detected but required exports were missing.");
}
}
}
if (m_BattlEyeRunning)
LOGF(WARNING, "If you are not running an actual BattlEye bypass, exit the game immediately and ensure that BE is properly disabled");
+18
View File
@@ -15,6 +15,9 @@ namespace YimMenu
bool m_IsFSLLoaded = false;
bool m_BattlEyeRunning = false;
int m_FSLVersion = -1;
bool m_ProvidesLocalSaves = false;
bool m_ProvidesBEBYPASS = false;
public:
static void RunScript()
@@ -32,5 +35,20 @@ namespace YimMenu
{
return GetInstance().m_BattlEyeRunning;
}
static int GetFSLVersion()
{
return GetInstance().m_FSLVersion;
}
static bool ProvidesLocalSaves()
{
return GetInstance().m_ProvidesLocalSaves;
}
static bool ProvidesBattlEyeBypass()
{
return GetInstance().m_ProvidesBEBYPASS;
}
};
}