mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
commit 4b6351200b9f7e7bb75b780c46042afbed3359f3 Merge: a3946bb 47dc117 Author: Alex <18037145+salcodes1@users.noreply.github.com> Date: Tue Dec 28 22:09:36 2021 +0200 Merge branch 'Mauler125:pylon' into pylon commit a3946bb5ce4655665a763aeb3c2b016215bfa805 Author: Alex <18037145+salcodes1@users.noreply.github.com> Date: Tue Dec 28 22:07:02 2021 +0200 Pylon C++ implementation actually working now commit 00cd76f7b21476e054d3ead4a4c8d507f391c963 Author: Alex <18037145+salcodes1@users.noreply.github.com> Date: Tue Dec 28 03:45:41 2021 +0200 Fixed post requests not using provided route commit 2f2d01713fd38861f0e674641bf14b6afd25ecc6 Author: Alex <18037145+salcodes1@users.noreply.github.com> Date: Tue Dec 28 03:44:20 2021 +0200 added get private game server info route commit b53b89d31a7201ac594abf16dd7c00134bb5a132 Merge: 433f14c c8ec95b Author: Alex <18037145+salcodes1@users.noreply.github.com> Date: Tue Dec 28 03:32:14 2021 +0200 Merge branch 'pylon' into indev commit 433f14c352a0ae366cff2cbe03753b2198a77848 Author: Alex <18037145+salcodes1@users.noreply.github.com> Date: Tue Dec 28 03:31:33 2021 +0200 partial commit commit c8ec95bd37ed0c3e16090ed0a15808bda6a2ee99 Author: Alex <18037145+salcodes1@users.noreply.github.com> Date: Tue Dec 28 03:26:44 2021 +0200 Added backbone and some of the routes for r5net-ms (now Pylon) interactions
53 lines
2.9 KiB
C++
53 lines
2.9 KiB
C++
#pragma once
|
|
#include "tier0/basetypes.h"
|
|
#include "networksystem/r5net.h"
|
|
|
|
struct user_creds
|
|
{
|
|
std::uint8_t gap0[16];
|
|
std::uint32_t m_nIpAddr;
|
|
std::uint8_t gap1[4];
|
|
std::int32_t m_nProtocolVer;
|
|
std::uint8_t gap2[12];
|
|
std::int64_t m_nNucleusID;
|
|
std::int64_t m_nUserID;
|
|
};
|
|
|
|
namespace
|
|
{
|
|
/* ==== CSERVER ========================================================================================================================================================= */
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
|
ADDRESS p_CServer_Authenticate = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x44\x89\x44\x24\x00\x55\x56\x57\x48\x8D\xAC\x24\x00\x00\x00\x00", "xxxx?xxxxxxx????");
|
|
void* (*CServer_Authenticate)(void* cserver, user_creds* creds) = (void* (*)(void* cserver, user_creds * creds))p_CServer_Authenticate.GetPtr(); /*44 89 44 24 ?? 55 56 57 48 8D AC 24 ?? ?? ?? ??*/
|
|
#elif defined (GAMEDLL_S2)
|
|
ADDRESS p_CServer_Authenticate = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x44\x89\x44\x24\x00\x56\x57\x48\x81\xEC\x00\x00\x00\x00", "xxxx?xxxxx????");
|
|
void* (*CServer_Authenticate)(void* cserver, user_creds* creds) = (void* (*)(void* cserver, user_creds * creds))p_CServer_Authenticate.GetPtr(); /*44 89 44 24 ?? 56 57 48 81 EC ?? ?? ?? ??*/
|
|
#else
|
|
ADDRESS p_CServer_Authenticate = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x55\x57\x41\x55\x41\x57\x48\x8D\xAC\x24\x00\x00\x00\x00", "xxxxxxxxxxx????");
|
|
void* (*CServer_Authenticate)(void* cserver, user_creds* creds) = (void* (*)(void* cserver, user_creds * creds))p_CServer_Authenticate.GetPtr(); /*40 55 57 41 55 41 57 48 8D AC 24 ?? ?? ?? ??*/
|
|
#endif
|
|
ADDRESS p_CServer_RejectConnection = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x4C\x24\x00\x53\x55\x56\x57\x48\x81\xEC\x00\x00\x00\x00\x49\x8B\xD9", "xxxx?xxxxxxx????xxx");
|
|
void* (*CServer_RejectConnection)(void* pServer, unsigned int a2, user_creds* pCreds, const char* szMessage) = (void* (*)(void*, unsigned int, user_creds*, const char*))p_CServer_RejectConnection.GetPtr(); /*4C 89 4C 24 ?? 53 55 56 57 48 81 EC ?? ?? ?? ?? 49 8B D9*/
|
|
}
|
|
|
|
void CServer_Attach();
|
|
void CServer_Detach();
|
|
|
|
void* HCServer_Authenticate(void* cserver, user_creds* inpacket);
|
|
|
|
extern bool g_bCheckCompBanDB;
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
class HServer : public IDetour
|
|
{
|
|
virtual void debugp()
|
|
{
|
|
std::cout << "| FUN: CServer::Authenticate : 0x" << std::hex << std::uppercase << p_CServer_Authenticate.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
std::cout << "| FUN: CServer::RejectConnection : 0x" << std::hex << std::uppercase << p_CServer_RejectConnection.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
|
}
|
|
};
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
REGISTER(HServer);
|