blob: 848104d40fafd0bd1fce13d120e8b3d832e9d49f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include "pch.h"
#include "r2server.h"
using namespace R2;
// use the R2 namespace for game funcs
namespace R2
{
server_state_t* g_pServerState;
void* (*Server_GetEntityByIndex)(int index);
CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex);
} // namespace R2
ON_DLL_LOAD("engine.dll", R2EngineServer, (HMODULE baseAddress))
{
g_pServerState = (server_state_t*)((char*)baseAddress + 0x12A53D48);
}
ON_DLL_LOAD("server.dll", R2GameServer, (HMODULE baseAddress))
{
Server_GetEntityByIndex = (void*(*)(int))((char*)baseAddress + 0xFB820);
UTIL_PlayerByIndex = (CBasePlayer*(__fastcall*)(int))((char*)baseAddress + 0x26AA10);
}
|