's_pInterfacesRegs' Pattern works for all supported builds

This commit is contained in:
Amos 2022-01-18 01:21:24 +01:00
parent 2c62fbfafe
commit 4b29892304
3 changed files with 27 additions and 12 deletions

View File

@ -14,7 +14,7 @@
#include "vpc/IAppSystem.h"
#include "vpc/keyvalues.h"
#include "vpc/basefilesystem.h"
#include "vpc/keyvalues.h"
#include "vpc/interfaces.h"
#include "common/opcodes.h"
#include "launcher/IApplication.h"
#include "ebisusdk/EbisuSDK.h"

View File

@ -1,10 +1,11 @@
#include "core/stdafx.h"
#include "interfaces.h"
//===========================================================================//
//
// Purpose: A higher level link library for general use in the game and SDK.
//
//===========================================================================//
/* Might wanna move this and rename a few things?
* I'm not sure how Amos wants to structure this part of the SDK.
* - Pix
*/
#include "core/stdafx.h"
#include "vpc/interfaces.h"
//---------------------------------------------------------------------------------
// Purpose: get all factory registered in the global s_pInterfacesRegs
@ -57,4 +58,6 @@ ADDRESS IFactory::GetFactoryPtr(const std::string& factoryName, bool versionLess
void IFactory::AddFactory(FactoryInfo factoryInfo)
{
factories.push_back(factoryInfo); // Push factory info back into the vector.
}
}
IFactory* g_pFactory = new IFactory();

View File

@ -40,11 +40,23 @@ public:
std::vector<FactoryInfo> factories = {};
};
extern IFactory* g_pFactory;
namespace
{
/* ==== s_pInterfaceRegs ==================================================================================================================================================== */
// Check pattern viability for all seasons.
// Make sure it properly gets the interface factory pointer.
InterfaceGlobals_t* s_pInterfacesRegs = nullptr; /* g_mGameDll.FindPatternSIMD((std::uint8_t*)"\xE9\x00\x00\x00\x00\xCC\xCC\x89\x91\x00\x00\x00\x00", "x????xxxx????").FollowNearCallSelf().FindPatternSelf("48 8B 1D", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).DerefSelf().RCast<InterfaceGlobals_t*>(); */
}
InterfaceGlobals_t* s_pInterfacesRegs = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\xE9\x00\x00\x00\x00\xCC\xCC\x89\x91\x00\x00\x00\x00", "x????xxxx????").FollowNearCallSelf().FindPatternSelf("48 8B 1D", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).DerefSelf().RCast<InterfaceGlobals_t*>();
}
///////////////////////////////////////////////////////////////////////////////
class HFactory : public IDetour
{
virtual void debugp()
{
std::cout << "| VAR: s_pInterfacesRegs : 0x" << std::hex << std::uppercase << s_pInterfacesRegs << std::setw(0) << " |" << std::endl;
std::cout << "+----------------------------------------------------------------+" << std::endl;
}
};
///////////////////////////////////////////////////////////////////////////////
REGISTER(HFactory);