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:
@@ -0,0 +1,60 @@
|
||||
#ifndef _CXOR_CRYPT_H_
|
||||
#define _CXOR_CRYPT_H_
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Pattern/Singleton.h>
|
||||
|
||||
class CXORCrypt : public CSingleton<CXORCrypt>
|
||||
{
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
// edith 2009.03.14 <20>Ź<EFBFBD> <20>ٲ<EFBFBD><D9B2><EFBFBD> <20><>Ŷ<EFBFBD><C5B6>ȣȭ Ű
|
||||
PAGE_VERSION = 2,
|
||||
BIT_COUNT = 40,
|
||||
CODE_PAGE = 10,
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
static unsigned char BitFields[][CODE_PAGE][BIT_COUNT];
|
||||
|
||||
unsigned char m_CodePage[CODE_PAGE * 10];
|
||||
unsigned long m_CodePageCount;
|
||||
|
||||
void InitCodePage(void);
|
||||
|
||||
void XORF(char *Start_In, int Length_In, unsigned short PageVer, unsigned char PageNum1, unsigned char PageNum2);
|
||||
void XORB(char *Start_In, int Length_In, unsigned short PageVer, unsigned char PageNum1, unsigned char PageNum2);
|
||||
|
||||
// To make Singleton Class.
|
||||
CXORCrypt();
|
||||
|
||||
static CXORCrypt ms_this;
|
||||
|
||||
public:
|
||||
|
||||
~CXORCrypt();
|
||||
|
||||
// interface of encoder, decoder
|
||||
unsigned long GetCodePage(void);
|
||||
unsigned long GetCodePage(unsigned short PageVer_In);
|
||||
inline unsigned short GetPageVer(unsigned long CodePage_In);
|
||||
|
||||
bool EncodePacket(char *Start_In, int Length_In, unsigned long CodePage_In);
|
||||
bool DecodePacket(char *Start_In, int Length_In, unsigned long CodePage_In);
|
||||
|
||||
void EncodeHeader(char *Start_In, int HeaderLen_In, unsigned short PageVer_In, unsigned char PageNum_In);
|
||||
void DecodeHeader(char *Start_In, int HeaderLen_In, unsigned short PageVer_In, unsigned char PageNum_In);
|
||||
};
|
||||
|
||||
inline unsigned short CXORCrypt::GetPageVer(unsigned long CodePage_In)
|
||||
{
|
||||
return (unsigned short)(((CodePage_In & 0xffff0000) >> 16) & 0x0000ffff);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user