⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crypt.h

📁 A3服务端AccountServer源代码
💻 H
字号:
#if !defined(AFX_CRYPT_H__413D055F_F135_4B2E_A4C3_19C1E8937B86__INCLUDED_)
#define AFX_CRYPT_H__413D055F_F135_4B2E_A4C3_19C1E8937B86__INCLUDED_


//////////////////////////////////////////////////////////////////////////////
//
//	Simple Crypt Base Class
//
//////////////////////////////////////////////////////////////////////////////

class CSimpleCrypt  
{
public:
	CSimpleCrypt();
	virtual ~CSimpleCrypt();

protected:
	int		m_ConstKey1;
	int		m_ConstKey2;
	int		m_DynamicKey;

	void	Encrypt32bit(const char * pSrc, char * pDest);
	void	Decrypt32bit(const char * pSrc, char * pDest);

public:

	void	SetKey(int ConstKey1, int ConstKey2, int DynamicKey);
	void	Encrypt(void * pData, int nSize);
	void	Decrypt(void * pData, int nSize);
};


//////////////////////////////////////////////////////////////////////////////
//
//	Optimized Crypt Class for A3
//
//////////////////////////////////////////////////////////////////////////////

class CMsgCrypt : public CSimpleCrypt
{
public:
	CMsgCrypt();
	virtual ~CMsgCrypt();

protected:
	int		m_iMsgHeaderSize;

public:
	void	SetMsgHeaderSize(int MsgHeaderSize);
	
public:
	void	EncryptMsgBody(void * pData, int nSize);
	void	DecryptMsgBody(void * pData, int nSize);
};


#endif // !defined(AFX_CRYPT_H__413D055F_F135_4B2E_A4C3_19C1E8937B86__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -