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:
107
Server/RylServerProject/RylGameLibrary/GameGuardLib/CSAuth.h
Normal file
107
Server/RylServerProject/RylGameLibrary/GameGuardLib/CSAuth.h
Normal file
@@ -0,0 +1,107 @@
|
||||
//=============================================================================
|
||||
// File : CSAuth.h
|
||||
// Use : Authentication between Client and Server
|
||||
// using 128-bit Enhanced SEED block cipher
|
||||
// Author : Kim Chan Ho (chkim@inca.co.kr)
|
||||
// Date : 2003/10/15
|
||||
// Modify : 2003/10/20 Refactoring to a class
|
||||
// 2003/10/21 Move random part to the class
|
||||
// 2003/12/01 Add GetAuthResults()
|
||||
// 2003/12/10 Support unix/linux system
|
||||
// 2004/02/11 Add PacketProtect stuff
|
||||
// 2004/03/03 Add Key-index related functions
|
||||
// 2004/04/02 Fix endian problem
|
||||
//=============================================================================
|
||||
|
||||
#ifndef __CSAUTH_H__
|
||||
#define __CSAUTH_H__
|
||||
|
||||
|
||||
/// Type definitions
|
||||
#if !defined(_WINDEF_) && !defined(_TYPEDEF_)
|
||||
|
||||
#define _TYPEDEF_
|
||||
|
||||
typedef void* LPVOID;
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned short WORD;
|
||||
typedef unsigned char BYTE;
|
||||
typedef unsigned char* LPBYTE;
|
||||
typedef const char* LPCSTR;
|
||||
typedef DWORD* LPDWORD;
|
||||
|
||||
#endif
|
||||
|
||||
#define CSAUTH_TABLE_SIZE (8 * 5)
|
||||
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#define __cdecl
|
||||
#endif
|
||||
|
||||
#define CSAUTH_EXPORT extern "C"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Functions
|
||||
DWORD __cdecl LoadAuthTable(LPCSTR lpszPath);
|
||||
DWORD __cdecl LoadAuthIndex(LPCSTR lpszPath);
|
||||
DWORD __cdecl SetAuthTable(LPBYTE lpTable, DWORD dwSize);
|
||||
DWORD __cdecl SetAuthIndex(DWORD dwIndex);
|
||||
DWORD __cdecl InitPacketProtect(LPCSTR lpszUserKey, DWORD dwUseSeqCheck);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/// Class CSAuth
|
||||
class CCSAuth
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
CCSAuth();
|
||||
|
||||
// Destructor
|
||||
~CCSAuth();
|
||||
|
||||
// Functions
|
||||
void Init();
|
||||
DWORD IsAuth();
|
||||
DWORD GetAuthDword();
|
||||
DWORD CheckAuthDword(DWORD dwReturnValue);
|
||||
DWORD GetAuthResults(DWORD dwAuthValue, LPDWORD lpdwResult, DWORD dwCount);
|
||||
DWORD EncryptPacket(LPVOID lpData, DWORD dwLength);
|
||||
DWORD DecryptPacket(LPVOID lpData, DWORD dwLength);
|
||||
DWORD PPGetLastError();
|
||||
|
||||
protected:
|
||||
DWORD TransAuthDword(DWORD dwAuth, int index);
|
||||
void np_srandom(DWORD initial_seed);
|
||||
DWORD np_random();
|
||||
DWORD CheckLastPacket(DWORD dwSeq);
|
||||
|
||||
private:
|
||||
// No copies
|
||||
CCSAuth(const CCSAuth &rhs);
|
||||
CCSAuth &operator=(const CCSAuth &rhs);
|
||||
|
||||
public:
|
||||
DWORD m_dwSeed;
|
||||
DWORD m_dwAuthValue;
|
||||
DWORD m_bAuth;
|
||||
DWORD m_dwCurrIndex;
|
||||
char m_table[8][5];
|
||||
DWORD m_dwClientSequenceNumber;
|
||||
DWORD m_dwServerSequenceNumber;
|
||||
DWORD m_adwLastSeqs[12];
|
||||
DWORD m_dwPPLastError;
|
||||
DWORD m_dwSeq;
|
||||
};
|
||||
|
||||
|
||||
#endif // __CSAUTH_H__
|
||||
|
||||
BIN
Server/RylServerProject/RylGameLibrary/GameGuardLib/CSAuth.lib
Normal file
BIN
Server/RylServerProject/RylGameLibrary/GameGuardLib/CSAuth.lib
Normal file
Binary file not shown.
354
Server/RylServerProject/RylGameLibrary/GameGuardLib/NPGameLib.h
Normal file
354
Server/RylServerProject/RylGameLibrary/GameGuardLib/NPGameLib.h
Normal file
@@ -0,0 +1,354 @@
|
||||
//=============================================================================
|
||||
// File : NPGameLib.h
|
||||
// Use : Handle Communication between Game and GameMon
|
||||
// Author : Kim Chan Ho (chkim@inca.co.kr)
|
||||
// Date : 2003/07/01 - 03
|
||||
//=============================================================================
|
||||
|
||||
#ifndef __NPGAMELIB_H__
|
||||
#define __NPGAMELIB_H__
|
||||
|
||||
|
||||
/// Definitions
|
||||
#ifdef NPGAMEDLL_EXPORTS
|
||||
#define NPGAMEDLL_API __declspec(dllexport)
|
||||
#else
|
||||
#define NPGAMEDLL_API
|
||||
#endif
|
||||
|
||||
|
||||
// Callback Message
|
||||
#define NPGAMEMON_UNDEFINED 1000 // Undefined message
|
||||
#define NPGAMEMON_COMM_ERROR 1001 // Communication error
|
||||
#define NPGAMEMON_COMM_CLOSE 1002 // Communication closing
|
||||
|
||||
#define NPGAMEMON_SPEEDHACK 1011 // SpeedHack detected
|
||||
#define NPGAMEMON_GAMEHACK_KILLED 1012 // GameHack killed
|
||||
#define NPGAMEMON_GAMEHACK_DETECT 1013 // GameHack detected
|
||||
#define NPGAMEMON_INIT_ERROR 1014 // GameMon Init Error
|
||||
#define NPGAMEMON_GAMEHACK_DOUBT 1015 // GameHack doubt
|
||||
#define NPGAMEMON_CHECK_CSAUTH 1016 // CSAuth
|
||||
#define NPGAMEMON_CHECK_CSAUTH2 1017 // CSAuth2
|
||||
#define NPGAMEMON_GAMEHACK_REPORT 1018 // GameHack report
|
||||
|
||||
// Error Code 110 - 300
|
||||
#define NPGAMEMON_ERROR_EXIST 110 // GameMon Already Exist
|
||||
#define NPGAMEMON_ERROR_CREATE 111 // GameGuard Directory Create Error
|
||||
#define NPGAMEMON_ERROR_NPSCAN 112 // npscan.des Error
|
||||
#define NPGAMEMON_ERROR_THREAD 113 // CreateThread Error
|
||||
#define NPGAMEMON_ERROR_INIT 114 // GameMon Initialize Error
|
||||
#define NPGAMEMON_ERROR_GAME_EXIST 115 // Game Instance Already Exist
|
||||
#define NPGAMEMON_ERROR_AUTH_INI 120 // .ini Authentication Fail
|
||||
#define NPGAMEMON_ERROR_AUTH_NPGMUP 121 // npgmup.des Authentication Fail
|
||||
#define NPGAMEMON_ERROR_AUTH_GAMEMON 122 // GameMon.des Authentication Fail
|
||||
#define NPGAMEMON_ERROR_AUTH_NEWUP 123 // npgmup.des.new Auth Fail
|
||||
#define NPGAMEMON_ERROR_AUTH_GAMEGUARD 124 // GameGuard.des Authentication Fail
|
||||
#define NPGAMEMON_ERROR_AUTH_DLL 125 // NPGameDLL.dll Authentication Fail
|
||||
#define NPGAMEMON_ERROR_DECRYPT 130 // .ini File Decryption Fail
|
||||
#define NPGAMEMON_ERROR_CORRUPT_INI 141 // Corrupt ini file Error
|
||||
#define NPGAMEMON_ERROR_CORRUPT_INI2 142 // Not match GameName in ini file Error
|
||||
#define NPGAMEMON_ERROR_NFOUND_INI 150 // ini File not Found
|
||||
#define NPGAMEMON_ERROR_NFOUND_NPGMUP 151 // npgmup.des not found
|
||||
#define NPGAMEMON_ERROR_NFOUND_NEWUP 152 // npgmup.des.new not found
|
||||
#define NPGAMEMON_ERROR_NFOUND_GG 153 // GameGuard.des not found
|
||||
#define NPGAMEMON_ERROR_NFOUND_GM 154 // GameMon.des not found
|
||||
#define NPGAMEMON_ERROR_CRYPTOAPI 155 // rsabase.dll is corrupted
|
||||
#define NPGAMEMON_ERROR_COMM 160 // Communication Init Error
|
||||
#define NPGAMEMON_ERROR_EXECUTE 170 // GameMon Execute Error
|
||||
#define NPGAMEMON_ERROR_EVENT 171 // GameMon Event Create Error
|
||||
#define NPGAMEMON_ERROR_NPGMUP 180 // npgmup.dll Error
|
||||
#define NPGAMEMON_ERROR_MOVE_INI 191 // Move ini Error
|
||||
#define NPGAMEMON_ERROR_MOVE_NEWUP 192 // Move npgmup.des.new Error
|
||||
|
||||
#define NPGAMEMON_ERROR_ILLEGAL_PRG 200 // Detected a illegal program
|
||||
|
||||
#define NPGAMEMON_ERROR_GAMEMON 210 // GameMon Init Error
|
||||
#define NPGAMEMON_ERROR_SPEEDCHECK 220 // SpeedCheck Init Error
|
||||
#define NPGAMEMON_ERROR_GAMEGUARD 230 // GameGuard Init Error
|
||||
|
||||
// Error Code 310 - 400
|
||||
// Update Error Code
|
||||
#define NPGMUP_ERROR_PARAM 320 // Invalid .ini
|
||||
#define NPGMUP_ERROR_INIT 330 // npgmup.des Initialize Error
|
||||
#define NPGMUP_ERROR_DOWNCFG 340 // Download Error
|
||||
#define NPGMUP_ERROR_ABORT 350 // Canceled by User
|
||||
#define NPGMUP_ERROR_AUTH 360 // File Authentication Error
|
||||
#define NPGMUP_ERROR_AUTH_INI 361 // .ini Authentication Error
|
||||
#define NPGMUP_ERROR_DECRYPT 370 // .ini Decrypt Error
|
||||
#define NPGMUP_ERROR_CONNECT 380 // Connect to update server Fail
|
||||
#define NPGMUP_ERROR_INI 390 // .ini is corrupted
|
||||
|
||||
// Error Code 500
|
||||
// Collision Error Code
|
||||
#define NPGG_ERROR_COLLISION 500 // Detected a Collision Program
|
||||
|
||||
#define NPGAMEMON_SUCCESS 0x755 // GameMon Initialize Success
|
||||
|
||||
|
||||
// USER_POLYBUFFER (NPGE L5 only)
|
||||
#define USER_POLYBUFFER \
|
||||
__asm _emit 0xEB \
|
||||
__asm _emit 0x04 \
|
||||
__asm _emit 0xEB \
|
||||
__asm _emit 0x05 \
|
||||
__asm _emit 0x39 \
|
||||
__asm _emit 0x19
|
||||
|
||||
|
||||
// gameguard auth data
|
||||
typedef struct _GG_AUTH_DATA
|
||||
{
|
||||
DWORD dwIndex;
|
||||
DWORD dwValue1;
|
||||
DWORD dwValue2;
|
||||
DWORD dwValue3;
|
||||
} GG_AUTH_DATA, *PGG_AUTH_DATA;
|
||||
|
||||
|
||||
#if defined(_LIB) || !defined(__LITE_VERSION)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
NPGAMEDLL_API DWORD __cdecl CheckNPGameMon();
|
||||
NPGAMEDLL_API BOOL __cdecl CloseNPGameMon();
|
||||
NPGAMEDLL_API DWORD __cdecl InitNPGameMon();
|
||||
NPGAMEDLL_API void __cdecl SetHwndToGameMon(HWND hWnd);
|
||||
NPGAMEDLL_API DWORD __cdecl PreInitNPGameMonA(LPCSTR szGameName);
|
||||
NPGAMEDLL_API DWORD __cdecl PreInitNPGameMonW(LPCWSTR szGameName);
|
||||
NPGAMEDLL_API BOOL __cdecl SendUserIDToGameMonA(LPCSTR szUserID);
|
||||
NPGAMEDLL_API BOOL __cdecl SendUserIDToGameMonW(LPCWSTR szUserID);
|
||||
NPGAMEDLL_API BOOL __cdecl SendCSAuthToGameMon(DWORD dwAuth);
|
||||
NPGAMEDLL_API BOOL __cdecl SendCSAuth2ToGameMon(PGG_AUTH_DATA pAuth);
|
||||
NPGAMEDLL_API LPSTR __cdecl NPDect(LPSTR lpszString);
|
||||
NPGAMEDLL_API BOOL __cdecl NPGuardData(LPVOID lpData, DWORD dwSize);
|
||||
NPGAMEDLL_API BOOL __cdecl NPReleaseData(LPVOID lpData, DWORD dwSize);
|
||||
NPGAMEDLL_API LPCSTR __cdecl GetInfoFromGameMon();
|
||||
NPGAMEDLL_API LPBYTE __cdecl GetHackInfoFromGameMon(DWORD* dwSize);
|
||||
NPGAMEDLL_API BOOL __cdecl ResourceAuthA(LPCSTR lpszFilename, bool bCheckFilename /* = true */ );
|
||||
NPGAMEDLL_API BOOL __cdecl ResourceAuthW(LPCWSTR lpszFilename, bool bCheckFilename /* = true */ );
|
||||
NPGAMEDLL_API BOOL __cdecl CheckD3DDevice(LPVOID lpD3DDevice, LPSTR lpszDll);
|
||||
NPGAMEDLL_API DWORD __cdecl GGGetLastError(); // 2009.07.27
|
||||
|
||||
NPGAMEDLL_API DWORD __cdecl InitPacketProtect(LPCSTR lpszUserKey);
|
||||
NPGAMEDLL_API DWORD __cdecl EncryptPacket(LPVOID lpData, DWORD dwLength);
|
||||
NPGAMEDLL_API DWORD __cdecl DecryptPacket(LPVOID lpData, DWORD dwLength);
|
||||
NPGAMEDLL_API DWORD __cdecl EncryptPeerPacket(LPVOID lpData, DWORD dwLength);
|
||||
NPGAMEDLL_API DWORD __cdecl DecryptPeerPacket(LPVOID lpData, DWORD dwLength);
|
||||
NPGAMEDLL_API DWORD __cdecl PPGetLastError();
|
||||
|
||||
NPGAMEDLL_API BOOL __cdecl FixVC80DEP();
|
||||
|
||||
typedef BOOL (CALLBACK *NPGMCALLBACK)(DWORD dwMsg, DWORD dwArg);
|
||||
NPGAMEDLL_API void __cdecl SetCallbackToGameMon(NPGMCALLBACK fnCallback);
|
||||
|
||||
NPGAMEDLL_API DWORD __cdecl SetModulePathA(LPCSTR szModulePath); // 2008.10.31
|
||||
NPGAMEDLL_API DWORD __cdecl SetModulePathW(LPCWSTR szModulePath); // 2008.10.31
|
||||
|
||||
NPGAMEDLL_API BOOL __cdecl IsAdminPrivilege(); // 2009.02.25
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _UNICODE
|
||||
#define PreInitNPGameMon PreInitNPGameMonW
|
||||
#define SetModulePath SetModulePathW
|
||||
#define SendUserIDToGameMon SendUserIDToGameMonW
|
||||
#define ResourceAuth ResourceAuthW
|
||||
#else
|
||||
#define SetModulePath SetModulePathA
|
||||
#define PreInitNPGameMon PreInitNPGameMonA
|
||||
#define SendUserIDToGameMon SendUserIDToGameMonA
|
||||
#define ResourceAuth ResourceAuthA
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef NPGAMELIB_C
|
||||
|
||||
/// CNPGameLib Wrapper Class ///
|
||||
class CNPGameLib
|
||||
{
|
||||
public:
|
||||
explicit CNPGameLib(LPCTSTR lpszGameName)
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return;
|
||||
#endif
|
||||
PreInitNPGameMon(lpszGameName);
|
||||
}
|
||||
|
||||
explicit CNPGameLib(LPCTSTR lpszGameName, LPCTSTR lpszModulePath)
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return;
|
||||
#endif
|
||||
SetModulePath(lpszModulePath);
|
||||
PreInitNPGameMon(lpszGameName);
|
||||
}
|
||||
|
||||
~CNPGameLib()
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return;
|
||||
#endif
|
||||
CloseNPGameMon();
|
||||
}
|
||||
|
||||
public:
|
||||
DWORD Init()
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return NPGAMEMON_SUCCESS;
|
||||
#endif
|
||||
return (InitNPGameMon());
|
||||
}
|
||||
|
||||
void SetHwnd(HWND hWnd)
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return;
|
||||
#endif
|
||||
SetHwndToGameMon(hWnd);
|
||||
}
|
||||
|
||||
DWORD Check()
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return NPGAMEMON_SUCCESS;
|
||||
#endif
|
||||
return (CheckNPGameMon());
|
||||
}
|
||||
|
||||
DWORD Send(LPCTSTR lpszUserId)
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return NPGAMEMON_SUCCESS;
|
||||
#endif
|
||||
return (SendUserIDToGameMon(lpszUserId));
|
||||
}
|
||||
|
||||
LPCSTR GetInfo()
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return NULL;
|
||||
#endif
|
||||
return (GetInfoFromGameMon());
|
||||
}
|
||||
LPBYTE GetHackInfo(DWORD *dwSize)
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return NULL;
|
||||
#endif
|
||||
return (GetHackInfoFromGameMon(dwSize));
|
||||
}
|
||||
DWORD Auth(DWORD dwAuth)
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return NPGAMEMON_SUCCESS;
|
||||
#endif
|
||||
return (SendCSAuthToGameMon(dwAuth));
|
||||
}
|
||||
|
||||
DWORD Auth2(PGG_AUTH_DATA pAuth)
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return NPGAMEMON_SUCCESS;
|
||||
#endif
|
||||
return (SendCSAuth2ToGameMon(pAuth));
|
||||
}
|
||||
|
||||
BOOL ResAuth(LPCTSTR lpszFilename, bool bCheckFilename = true)
|
||||
{
|
||||
#ifdef NO_GAMEGUARD
|
||||
return TRUE;
|
||||
#endif
|
||||
return (ResourceAuth(lpszFilename, bCheckFilename));
|
||||
}
|
||||
|
||||
private:
|
||||
// No copies
|
||||
CNPGameLib(const CNPGameLib &rhs);
|
||||
CNPGameLib &operator=(const CNPGameLib &rhs);
|
||||
};
|
||||
|
||||
///
|
||||
/*
|
||||
class CNPDword
|
||||
{
|
||||
public:
|
||||
CNPDword();
|
||||
//CNPDword(DWORD dwSize);
|
||||
~CNPDword();
|
||||
DWORD Get();
|
||||
void Set(DWORD dwValue);
|
||||
|
||||
private:
|
||||
void Guard();
|
||||
void Release();
|
||||
|
||||
public:
|
||||
LPDWORD m_pValue;
|
||||
DWORD m_dwSize;
|
||||
};
|
||||
*/
|
||||
|
||||
extern BOOL __cdecl RegisterToMgr(LPVOID);
|
||||
extern void __cdecl RemoveFromMgr(LPVOID);
|
||||
extern DWORD __cdecl GetDataFromMgr(LPVOID);
|
||||
extern void __cdecl SetDataToMgr(LPVOID, DWORD);
|
||||
|
||||
|
||||
class CNPDword {
|
||||
public:
|
||||
CNPDword() : m_dwData(0)
|
||||
{
|
||||
m_bFlag = RegisterToMgr(this);
|
||||
}
|
||||
|
||||
~CNPDword()
|
||||
{
|
||||
RemoveFromMgr(this);
|
||||
}
|
||||
|
||||
DWORD Get()
|
||||
{
|
||||
if (m_bFlag)
|
||||
return GetDataFromMgr(this);
|
||||
else
|
||||
return m_dwData;
|
||||
}
|
||||
|
||||
void Set(DWORD dwData)
|
||||
{
|
||||
if (m_bFlag)
|
||||
SetDataToMgr(this, dwData);
|
||||
else
|
||||
m_dwData = dwData;
|
||||
}
|
||||
|
||||
private:
|
||||
DWORD m_dwData;
|
||||
BOOL m_bFlag;
|
||||
};
|
||||
|
||||
#endif // NPGAMELIB_C
|
||||
|
||||
#else // defined(_LIB) || !defined(__LITE_VERSION)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
NPGAMEDLL_API DWORD __cdecl StartGameGuard(LPCSTR szGameName);
|
||||
NPGAMEDLL_API BOOL __cdecl EndGameGuard();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // defined(_LIB) || !defined(__LITE_VERSION)
|
||||
|
||||
#endif // __NPGAMELIB_H__
|
||||
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
#ifndef _GG_ERROR_H_
|
||||
#define _GG_ERROR_H_
|
||||
|
||||
#ifndef ERROR_SUCCESS
|
||||
#define ERROR_SUCCESS 0
|
||||
#endif
|
||||
|
||||
// ERROR CODE
|
||||
#define ERROR_GGAUTH_FAIL_MEM_ALLOC 1
|
||||
#define ERROR_GGAUTH_FAIL_LOAD_DLL 2
|
||||
#define ERROR_GGAUTH_FAIL_GET_PROC 3
|
||||
#define ERROR_GGAUTH_FAIL_BEFORE_INIT 4
|
||||
|
||||
#define ERROR_GGAUTH_INVALID_PARAM 10
|
||||
#define ERROR_GGAUTH_NO_REPLY 11
|
||||
#define ERROR_GGAUTH_INVALID_PROTOCOL_VERSION 12
|
||||
#define ERROR_GGAUTH_INVALID_REPLY 13
|
||||
|
||||
#define ERROR_GGAUTH_INVALID_GAMEMON_VER 101
|
||||
#define ERROR_GGAUTH_INVALID_GAMEMON_VER_CODE 102
|
||||
|
||||
#endif
|
||||
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
|
||||
|
||||
BIN
Server/RylServerProject/RylGameLibrary/GameGuardLib/ggsrvlib.lib
Normal file
BIN
Server/RylServerProject/RylGameLibrary/GameGuardLib/ggsrvlib.lib
Normal file
Binary file not shown.
Reference in New Issue
Block a user