#pragma once




//发包函数 地址
typedef DWORD SendPacks();
static SendPacks* _SendPacks = (SendPacks*)0x1127EC0;

//发包Class this地址
typedef DWORD SendClass;
static  SendClass* _SendClass = (SendClass*)0x1AEB6E4;

//发包类型 地址
typedef int(__fastcall* SendPacksType)(DWORD thisc, int Seat, int Parm);
static SendPacksType _SendpacksType = (SendPacksType)0x1127D60;

//发包参数 BYTE
typedef int(__fastcall* SendPacksByte)(DWORD thisc, int Seat, int Parm);
static SendPacksByte _SendPacksByte = (SendPacksByte)0x1128550;

//发包参数 WORD
typedef int(__fastcall* SendPacksWORD)(DWORD thisc, int Seat, int Parm);
static SendPacksWORD _SendPacksWord = (SendPacksWORD)0x1128580;

//发包参数 DWORD
typedef int(__fastcall* SendPacksDWORD)(DWORD thisc, int Seat, int Parm);
static SendPacksDWORD _SendPacksDWord = (SendPacksDWORD)0x11285B0;

//发包参数 char
typedef int(__fastcall* SendPacksChar)(DWORD thisc, int Seat, char* Parm,int Size);
static SendPacksChar _SendPacksChar = (SendPacksChar)0x11285E0;

//公告Class this地址
typedef DWORD NoticeClass;
static  NoticeClass* _NoticeClass = (NoticeClass*)0x1A5FB20;
//公告CALL
typedef void(__fastcall* NoticeCall)(DWORD thisc, int Seat, char* a1, DWORD a2, DWORD a3, DWORD a4, DWORD a5, DWORD a6);
static NoticeCall _Noticecall = (NoticeCall)0x9536C0;

//窗口CALL
typedef void(__fastcall* NoticeTCall)(DWORD thisc, DWORD Seat, DWORD a1, char* a2, DWORD a3);
static NoticeTCall _NoticeTcall = (NoticeTCall)0xE6E070;

//绘制？//TODO
typedef int(DrawTe)(DWORD thisc, int a2, int a3, int a4, int a5, int a6, __int64 a7, float a8, float a9, float a10, int a11, int a12);
//static NoticeTCall _NoticeTcall = (NoticeTCall)0xE6E070;

//绘制字符
typedef void(__fastcall* DrawCode)(DWORD thisc, int Seat, int a3, int a4, int a5, int a6);
static DrawCode DrawCodeF;
#define INIT_NUT_DRAWCODE 0x1206BD0






constexpr int Byte_Length = 6;

//0x1b45b94
class DNFTOOL
{
private:


public:

	//获取EXE使用头 号位数据
	static int GetExeNutWrtNum(int Pos);
	//写EXE使用头 号位数据
	static void SetExeNutWrtNum(int Pos, int num);
	//获取Nut头 号位数据
	static int GetNutArrNum(int Nut头地址, int Pos);
	//写Nut头 号位数据
	static void SetNutArrNum(int Nut头地址, int Pos, int num);
	//读内存偏移地址
	static int GetHook(int Addr, std::string 地址,int Type = 0);
	//解密读取
	static int DNFDeCode(int Address);
	//加密写入
	static void DNFEnCode(int AddreSs, int Data);
	//DNFTOOL::ReadInt
	static int ReadInt(int addr);
	//DNFTOOL::WriteInt
	static void WriteInt(int addr, int buf);
	//写字节数组
	static void WriteByteArr(int addr, BYTE buf[], int len);

	//获取装备偏移地址
	static int GetEquAddr(int addr);


	//UTF8转Unicode
	static char* U8ToUnicode(const char* szU8);
	//Unicode 转 UTF8
	static char* UnicodeToUtf8(const wchar_t* unicode);


	//wchar_t* 转 char*
	static char* UnicodeToAnsi(const wchar_t* szStr, char* pResult, int maxLen);


	//wchar_t* 转 char*		有用
	static char* wchar_tTochar(wchar_t* wbuffer);
	//char* 转 wchar_t*		有用
	static wchar_t* charTowchar_t(char* wbuffer);

	//char* Windows编码 转 wchar_t*
	static wchar_t* char2wchar(const char* cchar);
	//wchar_t* Windows编码 转 char*
	static char* wchar2char(const wchar_t* wchar);

	//Squirrel  wchar_t* 转 Unicode
	static wchar_t* SquirrelW2W(const wchar_t* wchar);
	//Squirrel  UTF8 wchar_t* 转 Unicode
	static char* SquirrelU2W(const wchar_t* wchar);

	//wchar_t* 转 string*
	static void Wchar_tToString(std::string& szDst, wchar_t* wchar);
	//char*	转	wchar_t*
	static wchar_t* AnsiToUnicode(const char* szStr, wchar_t* pResult, int maxLen);
	//string 转 wchar_t*
	static const wchar_t* GetWC(const char* c);

	//utf8 转 gb2312
	static std::string UtfToGbk(const char* utf8);

	//将字符串分割存入vector
	static void Split(const std::string& src, std::vector<std::string>& dest, const std::string& separator = "->");
	//判断字符串是否为纯数字
	static bool isNum(std::string str);

	//窗口公告 0x10d
	static void WindowsNotice(char* str, int type = 0x10d, int b = 0x0);
	//GM公告
	static void GMNotice(char* str, int type, int color);
	//获取腾讯文档IP
	static std::string GetIP();

	//修改内存属性 返回值是源内存属性
	static 	DWORD Motify_memory_attributes(int address, DWORD attributes = PAGE_EXECUTE_READWRITE);
};

