diff --git a/test/DNFTOOL.cpp b/test/DNFTOOL.cpp index 38ff2df..d207ea5 100644 --- a/test/DNFTOOL.cpp +++ b/test/DNFTOOL.cpp @@ -285,6 +285,9 @@ void DNFTOOL::GMNotice(char* str, int type, int color) _Noticecall(thisc, 0, str, color, type, 0, 0, 0); } +#if defined LOCALHOSTS_SWITCH + +#else std::string DNFTOOL::GetIP() { httplib::SSLClient Tencword("docs.qq.com"); @@ -306,6 +309,7 @@ std::string DNFTOOL::GetIP() else return GetIP(); } +#endif void DNFTOOL::Wchar_tToString(std::string& szDst, wchar_t* wchar) { diff --git a/test/dllmain.cpp b/test/dllmain.cpp index 161c6a2..0786d23 100644 --- a/test/dllmain.cpp +++ b/test/dllmain.cpp @@ -42,7 +42,7 @@ void LenheartThread(void) void LenheartThread() { static int 可开始执行判断; - std::string Rqip = GetIP(); + std::string Rqip = DNFTOOL::GetIP(); std::string MyIp; @@ -71,7 +71,7 @@ void LenheartThread() else { wchar_t* wgameip = (wchar_t*)0x1AE9CEC; - Wchar_tToString(ippack, wgameip); + DNFTOOL::Wchar_tToString(ippack, wgameip); } diff --git a/test/framework.h b/test/framework.h index adabb66..b61f256 100644 --- a/test/framework.h +++ b/test/framework.h @@ -28,7 +28,7 @@ -#define LOCALHOSTS_SWITCH "本地免验证 开启" +//#define LOCALHOSTS_SWITCH "本地免验证 开启" diff --git a/test/squirrel.cpp b/test/squirrel.cpp index 3393bb3..a8e6113 100644 --- a/test/squirrel.cpp +++ b/test/squirrel.cpp @@ -12,7 +12,7 @@ int squirrel::SQloadfile(uint32_t v, const wchar_t* filename, bool printerror) DNFTOOL::UnicodeToAnsi(filename, fname, size); FILE* file; - file = fopen(fname, "rb+"); + file = fopen(fname, "rb"); LSQLEXREADFUNC func = SQ_io_file_lexfeed_ASCII; if (file) { @@ -22,13 +22,14 @@ int squirrel::SQloadfile(uint32_t v, const wchar_t* filename, bool printerror) rewind(file); //һװļĿռ - char* ar = (char*)malloc(sizeof(char) * size); + char* ar = (char*)malloc(sizeof(char) * size + 256); //ļÿζһsize fread(ar, 1, size, file); - - int skey[] = { 5,2,3,5,0 };// + ar[size] = '\0'; + int skey[] = Skey;// Cutecode(ar, skey);// + fclose(file);//رļ FILE* outfile; outfile = fopen("ImagePacks2/sprite_interface_teart_zero.npk", "wb+"); @@ -38,12 +39,11 @@ int squirrel::SQloadfile(uint32_t v, const wchar_t* filename, bool printerror) fclose(outfile);//رļ free(ar);//ͷڴ - SQFILE* newfile = SQfopen(L"ImagePacks2/sprite_interface_teart_zero.npk", L"rb+");//µļ + SQFILE* newfile = SQfopen(L"ImagePacks2/sprite_interface_teart_zero.npk", L"rb");//µļ SQfseek(newfile, 0, 2);//λͷ if (SQ_Compile(v, func, newfile, filename, printerror) >= 0) { - fclose(file);//رļ SQ__Fclose(newfile);//رļ remove("ImagePacks2/sprite_interface_teart_zero.npk");//ɾļ return 0;