2022-01-25 23:01:41 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "export.h"
|
|
|
|
|
2022-01-27 22:08:40 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#include <stdint.h>
|
|
|
|
#define UINT16 uint16_t
|
|
|
|
#define UINT32 uint32_t
|
|
|
|
#else
|
|
|
|
#define UINT16 __uint16_t
|
|
|
|
#define UINT32 __uint32_t
|
|
|
|
#endif
|
|
|
|
|
2022-01-25 23:01:41 +00:00
|
|
|
typedef struct {
|
2022-01-27 22:08:40 +00:00
|
|
|
UINT16 DataType;
|
|
|
|
UINT16 Size;
|
2022-01-25 23:01:41 +00:00
|
|
|
unsigned char* Data;
|
|
|
|
}packet;
|
|
|
|
|
|
|
|
typedef struct {
|
2022-01-27 22:08:40 +00:00
|
|
|
UINT16 DataType;
|
|
|
|
UINT32 Id;
|
|
|
|
UINT16 Size;
|
2022-01-25 23:01:41 +00:00
|
|
|
unsigned char* Data;
|
|
|
|
}packetEx;
|
|
|
|
|
2022-01-27 22:08:40 +00:00
|
|
|
EXPORT int encrypt(packet *packet, unsigned char* outBuf, UINT16 *len, unsigned char* key);
|
2022-01-25 23:01:41 +00:00
|
|
|
|
|
|
|
|
2022-01-27 22:08:40 +00:00
|
|
|
EXPORT int decrypt(packetEx *packet, unsigned char* inBuf, UINT16 len, unsigned char* key);
|