2024-12-21 10:04:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
#include <winsock2.h>
|
|
|
|
|
|
#include "Define.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CNetPacketParser
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
typedef DWORD (*LPFN_PACKET_NOTIFY_PROC) (
|
|
|
|
|
|
LPVOID, // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
SHORT, // <20><>Ŷ <20><><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
|
SHORT, // <20><>Ŷ <20><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
|
LPBYTE, // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
SHORT // <20><>Ŷ ũ<><C5A9>
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
LPFN_PACKET_NOTIFY_PROC m_lpfnPacketNotifyProc;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
CNetPacketParser();
|
|
|
|
|
|
virtual ~CNetPacketParser();
|
|
|
|
|
|
|
|
|
|
|
|
VOID SetPacketNotifyProc(LPFN_PACKET_NOTIFY_PROC lpfnPacketNotifyProc) {
|
|
|
|
|
|
m_lpfnPacketNotifyProc = lpfnPacketNotifyProc;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static BOOL PacketParse(class CSessionBase* lpSession, CHAR* lpcBuffer, INT& iBufferPtr, UINT uIoBytes, UINT uTotalBufferSize, LPVOID lpRecvNotifyProcParam, IN_ADDR stIpAddress, WORD wPortNumber);
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
LPFN_PACKET_NOTIFY_PROC GetNotifyProc() const { return m_lpfnPacketNotifyProc; }
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|