#include #include "export.h" #ifdef _MSC_VER #include #define UINT16 uint16_t #define UINT32 uint32_t #else #define UINT16 __uint16_t #define UINT32 __uint32_t #endif typedef struct { UINT16 DataType; UINT16 Size; unsigned char* Data; }packet; typedef struct { UINT16 DataType; UINT32 Id; UINT16 Size; unsigned char* Data; }packetEx; EXPORT int encrypt(packet *packet, unsigned char* outBuf, UINT16 *len, unsigned char* key); EXPORT int decrypt(packetEx *packet, unsigned char* inBuf, UINT16 len, unsigned char* key); void fill_random(unsigned char* buffer, int length);