大改
This commit is contained in:
@@ -3,12 +3,13 @@
|
||||
namespace Offset {
|
||||
uint64_t GameResourceServicePtr;
|
||||
uint64_t FireEventServerSidePtr;
|
||||
uint64_t NetworkStateChangedPtr;
|
||||
uint64_t CGameEventManagerPtr;
|
||||
uint64_t Host_SayPtr;
|
||||
uint64_t Module_tier0;
|
||||
uint64_t MaxPlayerNumsPtr;
|
||||
HashFunction_t FnServerHashFunction;
|
||||
StateChanged_t FnStateChanged;
|
||||
NetworkStateChanged_t FnNetworkStateChanged;
|
||||
namespace InterFaces {
|
||||
CSchemaSystem* SchemaSystem;
|
||||
IGameEventManager2* GameEventManager;
|
||||
@@ -17,39 +18,41 @@ CGameResourceService* GameResourceServiceServer;
|
||||
IServerGameClients* IServerGameClient;
|
||||
IVEngineServer2* IVEngineServer;
|
||||
ISource2Server* ISource2ServerInterFace;
|
||||
CLocalize* ILocalize;
|
||||
INetworkServerService* INetworkServerServiceInteFace;
|
||||
}; // namespace InterFaces
|
||||
auto Init() -> bool {
|
||||
CModule server("server.dll");
|
||||
CModule schemasystem("schemasystem.dll");
|
||||
CModule engine("engine2.dll");
|
||||
CModule localize("localize.dll");
|
||||
|
||||
// engine.dll
|
||||
engine.FindPattern(pattern_MaxPlayerNumsPtr).ToAbsolute(3, 0).Get(MaxPlayerNumsPtr);
|
||||
|
||||
// server.dll
|
||||
server.FindPattern(pattern_FireEventServerSide).Get(FireEventServerSidePtr);
|
||||
server.FindPattern(pattern_NetworkStateChanged).Get(NetworkStateChangedPtr);
|
||||
server.FindPattern(pattern_NetworkStateChanged).Get(FnNetworkStateChanged);
|
||||
server.FindPattern(pattern_FnStateChangedPtr).Get(FnStateChanged);
|
||||
|
||||
// 48 8D 05 4A 30 82 00 lea rax, ??_7CGameEventManager@@6B@
|
||||
server.FindPattern(pattern_CGameEventManager)
|
||||
.ToAbsolute(3, 0)
|
||||
.Get(CGameEventManagerPtr);
|
||||
server.FindPattern(pattern_fnHost_SayPtr).Get(Host_SayPtr);
|
||||
server.FindPattern(pattern_ServerHashFunctionPtr).Get(FnServerHashFunction);
|
||||
|
||||
// schemasystem
|
||||
InterFaces::SchemaSystem = reinterpret_cast<CSchemaSystem*>(
|
||||
schemasystem.FindInterface("SchemaSystem_001").Get());
|
||||
|
||||
// engine.dll
|
||||
//InterFaces::GameEventManager = reinterpret_cast<IGameEventManager2*>(
|
||||
// engine.FindInterface("GameEventSystemServerV001").Get());
|
||||
//InterFaces::GameEventManager = reinterpret_cast<IGameEventManager2*>(engine.FindInterface("GameEventSystemServerV001").Get());
|
||||
InterFaces::ILocalize = reinterpret_cast<CLocalize*>(localize.FindInterface("Localize_001").Get());
|
||||
InterFaces::GameResourceServiceServer =
|
||||
reinterpret_cast<CGameResourceService*>(
|
||||
engine.FindInterface("GameResourceServiceServerV001").Get());
|
||||
InterFaces::IVEngineServer = reinterpret_cast<IVEngineServer2*>(
|
||||
engine.FindInterface("Source2EngineToServer001").Get());
|
||||
|
||||
// server.dll
|
||||
InterFaces::INetworkServerServiceInteFace = reinterpret_cast<INetworkServerService*>(
|
||||
engine.FindInterface("NetworkServerService_001").Get());
|
||||
InterFaces::IServerGameClient = reinterpret_cast<IServerGameClients*>(
|
||||
server.FindInterface("Source2GameClients001").Get());
|
||||
InterFaces::ISource2ServerInterFace = reinterpret_cast<ISource2Server*>(
|
||||
@@ -65,9 +68,10 @@ auto Init() -> bool {
|
||||
global::MaxPlayers = 64;
|
||||
|
||||
LOG("[huoji]FireEventServerSidePtr : %llx \n", FireEventServerSidePtr);
|
||||
LOG("[huoji]NetworkStateChangedPtr : %llx \n", NetworkStateChangedPtr);
|
||||
LOG("[huoji]Host_SayPtr : %llx \n", Host_SayPtr);
|
||||
LOG("[huoji]FnNetworkStateChanged : %llx \n", FnNetworkStateChanged);
|
||||
LOG("[huoji]FnServerHashFunction : %llx \n", FnServerHashFunction);
|
||||
LOG("[huoji]FnStateChanged : %llx \n", FnStateChanged);
|
||||
LOG("[huoji]MaxGlobals : %d \n", global::MaxPlayers);
|
||||
|
||||
LOG("[huoji]InterFaces::SchemaSystem : %llx \n", InterFaces::SchemaSystem);
|
||||
@@ -86,11 +90,11 @@ auto Init() -> bool {
|
||||
|
||||
// GetOffsets();
|
||||
LOG("init offset success !\n");
|
||||
LOG("FnServerHashFunction: %llx \n", FnServerHashFunction("here", sizeof("here") - 1, 0x31415926));
|
||||
//LOG("FnServerHashFunction: %llx \n", FnServerHashFunction("here", sizeof("here") - 1, 0x31415926));
|
||||
return FnServerHashFunction && Host_SayPtr && InterFaces::IVEngineServer &&
|
||||
InterFaces::GameResourceServiceServer &&
|
||||
InterFaces::IServerGameClient && InterFaces::GameEventManager &&
|
||||
InterFaces::SchemaSystem && FireEventServerSidePtr &&
|
||||
NetworkStateChangedPtr;
|
||||
FnNetworkStateChanged;
|
||||
}
|
||||
} // namespace Offset
|
||||
|
||||
Reference in New Issue
Block a user