mirror of
https://github.com/YimMenu/YimMenuV2.git
synced 2026-10-10 03:43:15 +08:00
feat: add FSL API Support (#314)
Co-authored-by: ThePosiDong <kurdanstpolek@gmail.com>
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user