mirror of
https://github.com/YimMenu/YimMenuV2.git
synced 2026-10-10 03:43:15 +08:00
fix: fix BattlEyeServerProcessPlayerJoin (#606)
This commit is contained in:
@@ -119,7 +119,6 @@ namespace YimMenu
|
||||
|
||||
inline bool Module::IsExported(const std::string_view symbolName) const
|
||||
{
|
||||
|
||||
return GetExportImpl<void*, decltype(symbolName)>(symbolName) != nullptr;
|
||||
}
|
||||
|
||||
@@ -141,14 +140,14 @@ namespace YimMenu
|
||||
const auto ordinalOffsets = m_Base.Add(exportDirectory->AddressOfNameOrdinals).As<uint16_t*>();
|
||||
const auto funcOffsets = m_Base.Add(exportDirectory->AddressOfFunctions).As<DWORD*>();
|
||||
|
||||
for (std::size_t i = 0; i < exportDirectory->NumberOfFunctions; i++)
|
||||
for (std::size_t i = 0; i < exportDirectory->NumberOfNames; i++)
|
||||
{
|
||||
if constexpr (std::is_convertible_v<T, int>)
|
||||
{
|
||||
if (ordinalOffsets[i] != symbol)
|
||||
if (exportDirectory->Base + ordinalOffsets[i] != symbol)
|
||||
continue;
|
||||
|
||||
return m_Base.Add(funcOffsets[i]).As<R>();
|
||||
return m_Base.Add(funcOffsets[ordinalOffsets[i]]).As<R>();
|
||||
}
|
||||
else if constexpr (std::is_convertible_v<T, std::string_view>)
|
||||
{
|
||||
@@ -156,7 +155,7 @@ namespace YimMenu
|
||||
if (strcmp(functionName, symbol.data()))
|
||||
continue;
|
||||
|
||||
return m_Base.Add(funcOffsets[i]).As<R>();
|
||||
return m_Base.Add(funcOffsets[ordinalOffsets[i]]).As<R>();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -121,12 +121,16 @@ namespace YimMenu
|
||||
|
||||
if (m_IsFSLLoaded)
|
||||
{
|
||||
HMODULE hFSL = GetModuleHandleA("WINMM.dll");
|
||||
if (hFSL)
|
||||
Module* FSL = nullptr;
|
||||
for (auto& module : ModuleMgr.GetModules())
|
||||
if (module.first == "WINMM.dll"_J && module.second->IsExported("LawnchairGetVersion"))
|
||||
FSL = module.second.get();
|
||||
|
||||
if (FSL)
|
||||
{
|
||||
auto LawnchairGetVersion = reinterpret_cast<FnGetVersion>(GetProcAddress(hFSL, "LawnchairGetVersion"));
|
||||
auto LawnchairIsProvidingLocalSaves = reinterpret_cast<FnLocalSaves>(GetProcAddress(hFSL, "LawnchairIsProvidingLocalSaves"));
|
||||
auto LawnchairIsProvidingBattlEyeBypass = reinterpret_cast<FnBattlEyeBypass>(GetProcAddress(hFSL, "LawnchairIsProvidingBattlEyeBypass"));
|
||||
auto LawnchairGetVersion = FSL->GetExport<FnGetVersion>("LawnchairGetVersion");
|
||||
auto LawnchairIsProvidingLocalSaves = FSL->GetExport<FnLocalSaves>("LawnchairIsProvidingLocalSaves");
|
||||
auto LawnchairIsProvidingBattlEyeBypass = FSL->GetExport<FnBattlEyeBypass>("LawnchairIsProvidingBattlEyeBypass");
|
||||
|
||||
if (LawnchairGetVersion && LawnchairIsProvidingLocalSaves && LawnchairIsProvidingBattlEyeBypass)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,8 @@ namespace YimMenu::Hooks
|
||||
std::uint32_t Anticheat::GetAnticheatInitializedHash2(void* ac_var, std::uint32_t seed)
|
||||
{
|
||||
auto orig = (*Pointers.AnticheatContext) ? (*Pointers.AnticheatContext)->m_BattlEyeEnabled : false;
|
||||
(*Pointers.AnticheatContext)->m_BattlEyeEnabled = true; // integ checks will boot us out if we set this outside this function
|
||||
if (*Pointers.AnticheatContext)
|
||||
(*Pointers.AnticheatContext)->m_BattlEyeEnabled = true; // integ checks will boot us out if we set this outside this function
|
||||
auto ret = BaseHook::Get<Anticheat::GetAnticheatInitializedHash2, DetourHook<decltype(&Anticheat::GetAnticheatInitializedHash2)>>()->Original()(ac_var, seed);
|
||||
if (*Pointers.AnticheatContext)
|
||||
(*Pointers.AnticheatContext)->m_BattlEyeEnabled = orig;
|
||||
|
||||
@@ -384,9 +384,9 @@ namespace YimMenu
|
||||
HasGTAPlus = addr.Add(3).Rip().As<int*>();
|
||||
});
|
||||
|
||||
constexpr auto battlEyeServerProcessPlayerJoinPtrn = Pattern<"BA 2D AD 45 3F">("BattlEyeServerProcessPlayerJoin");
|
||||
constexpr auto battlEyeServerProcessPlayerJoinPtrn = Pattern<"41 57 41 56 41 55 41 54 56 57 55 53 48 83 EC 48 48 89 D3 48 89 CE E9">("BattlEyeServerProcessPlayerJoin");
|
||||
scanner.Add(battlEyeServerProcessPlayerJoinPtrn, [this](PointerCalculator ptr) {
|
||||
BattlEyeServerProcessPlayerJoin = ptr.Sub(0x72).As<PVOID>();
|
||||
BattlEyeServerProcessPlayerJoin = ptr.As<PVOID>();
|
||||
});
|
||||
|
||||
constexpr auto assistedAimShouldReleaseEntityPtrn = Pattern<"80 7F 28 04 75 6A">("AssistedAimShouldReleaseEntity");
|
||||
|
||||
Reference in New Issue
Block a user