Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
187
Server/RylServerProject/RylGameLibrary/GameGuardLib/ggsrv.h
Normal file
187
Server/RylServerProject/RylGameLibrary/GameGuardLib/ggsrv.h
Normal file
@@ -0,0 +1,187 @@
|
||||
#ifndef _GG_AUTH_SERVER_H_
|
||||
#define _GG_AUTH_SERVER_H_
|
||||
|
||||
#if !defined(_WIN32) && !defined(_WIN64)
|
||||
#include <stdint.h>
|
||||
|
||||
// 64<36><34>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ÿ<><C5B8> <20><><EFBFBD><EFBFBD> - Coded By HS_Soul [2007.12.28]
|
||||
typedef int32_t INT32, *PINT32;
|
||||
typedef uint32_t UINT32, *PUINT32;
|
||||
typedef int64_t INT64, *PINT64;
|
||||
typedef uint64_t UINT64, *PUINT64;
|
||||
|
||||
typedef intptr_t INT_PTR;
|
||||
typedef uintptr_t UINT_PTR;
|
||||
#endif
|
||||
|
||||
#ifdef _EXPORT_DLL
|
||||
#define GGAUTHS_API extern "C" __declspec(dllexport)
|
||||
#define GGAUTHS_EXPORT __declspec(dllexport)
|
||||
#define __CDECL __cdecl
|
||||
#else
|
||||
#define GGAUTHS_API extern "C"
|
||||
//#define GGAUTHS_API <== ggsrv_cpp_c.h <20><><EFBFBD><EFBFBD> Ȱ<><C8B0>ȭ. extern "C" <20><> c <20><><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD> <20>νĸ<CEBD><C4B8><EFBFBD>.
|
||||
#define GGAUTHS_EXPORT
|
||||
#define __CDECL
|
||||
#endif
|
||||
|
||||
#ifndef ERROR_SUCCESS
|
||||
#define ERROR_SUCCESS 0 //<2F>Ϲ<EFBFBD><CFB9><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
#endif
|
||||
#define NPGG_INFO_SUCCESS 0 //GetInfo() func success.
|
||||
#define NPGG_INFO_ERROR_NOTENOUGHFMEMORY 1 //Need more memory
|
||||
#define ERROR_GGAUTH_FAIL_MEM_ALLOC 1 //CS<43><53><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ε<EFBFBD><CEB5><EFBFBD> <20><EFBFBD><DEB8><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
#define ERROR_GGAUTH_FAIL_LOAD_DLL 2 //CS<43><53><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>(*.dll, *.so) <20>ε<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
#define ERROR_GGAUTH_FAIL_GET_PROC 3 //CS<43><53><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> export <20>Լ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
#define ERROR_GGAUTH_FAIL_BEFORE_INIT 4 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <- critical error
|
||||
#define ERROR_GGAUTH_FAIL_LOAD_CFG 5 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ε<EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
#define ERROR_GGAUTH_INVALID_PARAM 10 // <20>Լ<EFBFBD> ȣ<><C8A3><EFBFBD><EFBFBD> <20>߸<EFBFBD><DFB8><EFBFBD> <20><><EFBFBD>ڰ<EFBFBD><DAB0><EFBFBD> <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
#define ERROR_GGAUTH_NO_REPLY 11 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. GetAuthQuery() <20><> CheckAuthAnswer()<29>ϱ<EFBFBD><CFB1><EFBFBD><EFBFBD><EFBFBD> <20>ι<EFBFBD> <20>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD>
|
||||
#define ERROR_GGAUTH_INVALID_PROTOCOL_VERSION 12 // CS<43><53><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ȣ(ggauth##.dll) Ʋ<><C6B2>
|
||||
#define ERROR_GGAUTH_INVALID_REPLY 13 // <20><><EFBFBD>䰪 Ʋ<><C6B2>.
|
||||
#define ERROR_GGAUTH_INVALID_GAMEGUARD_VER 14 //<2F><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD>. <20><><EFBFBD>̺귯<CCBA><EAB7AF> 2.5<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>߰<EFBFBD><DFB0><EFBFBD>(cs<63><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 50<35><30> <20>̻<EFBFBD>)
|
||||
#define ERROR_GGAUTH_SETSTATE_ERROR 20 // SetCSAuthState() ȣ<><C8A3> <20><> m_CSAuthState<74><65> NULL<4C>̰ų<CCB0>..
|
||||
// m_PrtcTemp<6D><70> NULL <20><> <20><><EFBFBD><EFBFBD> (pProtocolHead <20><> ã<><C3A3> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>...)
|
||||
#define ERROR_GGAUTH_INVALID_GAMEMON_VER 101 //
|
||||
#define ERROR_GGAUTH_INVALID_GAMEMON_VER_CODE 102 //
|
||||
|
||||
#define ERROR_GGAUTH_RETRY_QUERY 200
|
||||
|
||||
#define NPGG_CHECKUPDATED_VERIFIED 0 //csa.CheckUpdated() <20>Լ<EFBFBD> <20><><EFBFBD>ϰ<EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define NPGG_CHECKUPDATED_NOTREADY 1 //csa.CheckUpdated() <20>Լ<EFBFBD> <20><><EFBFBD>ϰ<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD>˻縦 <20>ϱ<EFBFBD> <20><>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
#define NPGG_CHECKUPDATED_HIGH 2 //csa.CheckUpdated() <20>Լ<EFBFBD> <20><><EFBFBD>ϰ<EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define NPGG_CHECKUPDATED_LOW 3 //csa.CheckUpdated() <20>Լ<EFBFBD> <20><><EFBFBD>ϰ<EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
#define NPLOG_DEBUG 0x00000001 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><DEBC><EFBFBD>
|
||||
#define NPLOG_ERROR 0x00000002 // <20><><EFBFBD><EFBFBD> <20><EFBFBD><DEBC><EFBFBD>
|
||||
|
||||
#define NPLOG_ENABLE_DEBUG 0x00000001 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><DEBC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define NPLOG_ENABLE_ERROR 0x00000002 // <20><><EFBFBD><EFBFBD> <20><EFBFBD><DEBC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
// << DATA structure >>
|
||||
// gameguard auth data
|
||||
typedef struct _GG_AUTH_DATA
|
||||
{
|
||||
UINT32 dwIndex;
|
||||
UINT32 dwValue1;
|
||||
UINT32 dwValue2;
|
||||
UINT32 dwValue3;
|
||||
} GG_AUTH_DATA, *PGG_AUTH_DATA;
|
||||
|
||||
// gameguard version data
|
||||
typedef struct _GG_VERSION
|
||||
{
|
||||
UINT32 dwGGVer;
|
||||
unsigned short wYear;
|
||||
unsigned short wMonth;
|
||||
unsigned short wDay;
|
||||
unsigned short wNum;
|
||||
} GG_VERSION, *PGG_VERSION;
|
||||
|
||||
// Data for Server <-> Server (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> <20><><EFBFBD>ι<EFBFBD><CEB9><EFBFBD>, Flag)
|
||||
typedef struct _GG_CSAUTH_STATE
|
||||
{
|
||||
UINT32 m_PrtcVersion;
|
||||
UINT32 m_GGVersion;
|
||||
UINT32 m_UserFlag;
|
||||
} GG_CSAUTH_STATE, *PGG_CSAUTH_STATE;
|
||||
|
||||
typedef struct _GG_AUTH_PROTOCOL *PGG_AUTH_PROTOCOL;
|
||||
|
||||
GGAUTHS_API UINT32 __CDECL InitGameguardAuth(char* sGGPath, UINT32 dwNumActive, int useTimer, int useLog);
|
||||
GGAUTHS_API void __CDECL CleanupGameguardAuth();
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthUpdateTimer(); //useTimer <20><> true <20><> <20><><EFBFBD><EFBFBD> ȣ<><C8A3>.
|
||||
GGAUTHS_API UINT32 __CDECL AddAuthProtocol(char* sDllName);
|
||||
GGAUTHS_API UINT32 __CDECL SetGGVerLimit(UINT32 nLimitVer); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD>Ѽ<EFBFBD><D1BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
GGAUTHS_API UINT32 __CDECL SetUpdateCondition(int nTimeLimit, int nCondition); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
GGAUTHS_API UINT32 __CDECL CheckCSAuth(bool bCheck); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> On/Off <20><> <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD>
|
||||
GGAUTHS_API int ModuleInfo(char* dest, int length);
|
||||
GGAUTHS_API void NpLog(int mode, char* msg); // referenced by
|
||||
/*
|
||||
{
|
||||
if(mode & (NPLOG_DEBUG | NPLOG_ERROR)) // for examples
|
||||
#ifdef WIN32
|
||||
OutputDebugString(msg);
|
||||
#else
|
||||
printf(msg);
|
||||
#endif
|
||||
};
|
||||
*/
|
||||
|
||||
typedef struct _GG_UPREPORT
|
||||
{
|
||||
UINT32 dwBefore; // Before version
|
||||
UINT32 dwNext; // Now version
|
||||
int nType; // Update type 1 : gameguard version, 2 : protocol num
|
||||
} GG_UPREPORT, *PGG_UPREPORT;
|
||||
|
||||
GGAUTHS_API void GGAuthUpdateCallback(PGG_UPREPORT report); // referenced by
|
||||
/*
|
||||
{
|
||||
printf("GGAuth version update [%s] : [%ld] -> [%ld] \n", // for examples
|
||||
report->nType==1?"GameGuard Ver":"Protocol Num",
|
||||
report->dwBefore,
|
||||
report->dwNext);
|
||||
};
|
||||
*/
|
||||
|
||||
// Class CSAuth2
|
||||
class GGAUTHS_EXPORT CCSAuth2
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
CCSAuth2();
|
||||
|
||||
// Destructor
|
||||
~CCSAuth2();
|
||||
|
||||
protected:
|
||||
bool m_bAuth;
|
||||
PGG_AUTH_PROTOCOL m_pProtocol;
|
||||
UINT32 m_bPrtcRef;
|
||||
UINT32 m_dwUserFlag;
|
||||
GG_VERSION m_GGVer; //<2F><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
GG_AUTH_DATA m_AuthQueryTmp; //m_AuthQuery <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>صд<D8B5>.
|
||||
|
||||
public:
|
||||
GG_AUTH_DATA m_AuthQuery;
|
||||
GG_AUTH_DATA m_AuthAnswer;
|
||||
|
||||
void Init();
|
||||
UINT32 GetAuthQuery();
|
||||
UINT32 CheckAuthAnswer();
|
||||
UINT32 CheckUserCSAuth(bool bCheck);
|
||||
inline void InitCSAuthState(PGG_CSAUTH_STATE m_CSAuthState) { memset(m_CSAuthState, 0, sizeof(GG_CSAUTH_STATE)); };
|
||||
UINT32 GetCSAuthState(PGG_CSAUTH_STATE m_CSAuthState);
|
||||
UINT32 SetCSAuthState(PGG_CSAUTH_STATE m_CSAuthState);
|
||||
UINT32 SetSecretOrder();
|
||||
void Close();
|
||||
int Info(char* dest, int length); // protocol information
|
||||
int CheckUpdated(); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD>θ<EFBFBD> Ȯ<><C8AE><EFBFBD>Ѵ<EFBFBD>.
|
||||
};
|
||||
|
||||
// C type CSAuth2
|
||||
typedef void* LPGGAUTH;
|
||||
|
||||
GGAUTHS_API LPGGAUTH __CDECL GGAuthCreateUser(); // CCSAuth2()
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthDeleteUser(LPGGAUTH pGGAuth); // ~CCSAuth2()
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthInitUser(LPGGAUTH pGGAuth); // Init()
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthCloseUser(LPGGAUTH pGGAuth); // Close()
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthGetQuery(LPGGAUTH pGGAuth, PGG_AUTH_DATA pAuthData); // GetAuthQuery()
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthCheckAnswer(LPGGAUTH pGGAuth, PGG_AUTH_DATA pAuthData); // CheckAuthAnswer()
|
||||
GGAUTHS_API int __CDECL GGAuthCheckUpdated(LPGGAUTH pGGAuth); // CheckAuthAnswer()
|
||||
GGAUTHS_API int __CDECL GGAuthUserInfo(LPGGAUTH pGGAuth, char* dest, int length); // CheckAuthAnswer()
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthGetState(LPGGAUTH pGGAuth, PGG_CSAUTH_STATE pAuthState); // GetCSAuthState()
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthSetState(LPGGAUTH pGGAuth, PGG_CSAUTH_STATE pAuthState); // SetCSAuthState()
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthSetSecureOrder(LPGGAUTH pGGAuth); // SetSecureOrder()
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthCheckUserCSAuth(LPGGAUTH pGGAuth, bool bCheck); // CheckCSAuth()
|
||||
|
||||
#define NPGG_USER_AUTH_QUERY 0x00000001 //GGAuthGetUserValue() <20><> <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD> Query
|
||||
#define NPGG_USER_AUTH_ANSWER 0x00000002 //GGAuthGetUserValue() <20><> <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD> Answer
|
||||
#define NPGG_USER_AUTH_INDEX 0x00000010 //GGAuthGetUserValue() <20><> <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD> index
|
||||
#define NPGG_USER_AUTH_VALUE1 0x00000020 //GGAuthGetUserValue() <20><> <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD> Value1
|
||||
#define NPGG_USER_AUTH_VALUE2 0x00000040 //GGAuthGetUserValue() <20><> <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD> Value2
|
||||
#define NPGG_USER_AUTH_VALUE3 0x00000080 //GGAuthGetUserValue() <20><> <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD> Value3
|
||||
GGAUTHS_API UINT32 __CDECL GGAuthGetUserValue(LPGGAUTH pGGAuth, int type);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user