1111
This commit is contained in:
parent
5f4ee2ca36
commit
70941036cc
|
|
@ -285,6 +285,9 @@ void DNFTOOL::GMNotice(char* str, int type, int color)
|
||||||
_Noticecall(thisc, 0, str, color, type, 0, 0, 0);
|
_Noticecall(thisc, 0, str, color, type, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined LOCALHOSTS_SWITCH
|
||||||
|
|
||||||
|
#else
|
||||||
std::string DNFTOOL::GetIP()
|
std::string DNFTOOL::GetIP()
|
||||||
{
|
{
|
||||||
httplib::SSLClient Tencword("docs.qq.com");
|
httplib::SSLClient Tencword("docs.qq.com");
|
||||||
|
|
@ -306,6 +309,7 @@ std::string DNFTOOL::GetIP()
|
||||||
else
|
else
|
||||||
return GetIP();
|
return GetIP();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void DNFTOOL::Wchar_tToString(std::string& szDst, wchar_t* wchar)
|
void DNFTOOL::Wchar_tToString(std::string& szDst, wchar_t* wchar)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ void LenheartThread(void)
|
||||||
void LenheartThread()
|
void LenheartThread()
|
||||||
{
|
{
|
||||||
static int 可开始执行判断;
|
static int 可开始执行判断;
|
||||||
std::string Rqip = GetIP();
|
std::string Rqip = DNFTOOL::GetIP();
|
||||||
|
|
||||||
|
|
||||||
std::string MyIp;
|
std::string MyIp;
|
||||||
|
|
@ -71,7 +71,7 @@ void LenheartThread()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wchar_t* wgameip = (wchar_t*)0x1AE9CEC;
|
wchar_t* wgameip = (wchar_t*)0x1AE9CEC;
|
||||||
Wchar_tToString(ippack, wgameip);
|
DNFTOOL::Wchar_tToString(ippack, wgameip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define LOCALHOSTS_SWITCH "本地免验证 开启"
|
//#define LOCALHOSTS_SWITCH "本地免验证 开启"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ int squirrel::SQloadfile(uint32_t v, const wchar_t* filename, bool printerror)
|
||||||
DNFTOOL::UnicodeToAnsi(filename, fname, size);
|
DNFTOOL::UnicodeToAnsi(filename, fname, size);
|
||||||
|
|
||||||
FILE* file;
|
FILE* file;
|
||||||
file = fopen(fname, "rb+");
|
file = fopen(fname, "rb");
|
||||||
LSQLEXREADFUNC func = SQ_io_file_lexfeed_ASCII;
|
LSQLEXREADFUNC func = SQ_io_file_lexfeed_ASCII;
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
|
|
@ -22,13 +22,14 @@ int squirrel::SQloadfile(uint32_t v, const wchar_t* filename, bool printerror)
|
||||||
rewind(file);
|
rewind(file);
|
||||||
|
|
||||||
//申请一块能装下整个文件的空间
|
//申请一块能装下整个文件的空间
|
||||||
char* ar = (char*)malloc(sizeof(char) * size);
|
char* ar = (char*)malloc(sizeof(char) * size + 256);
|
||||||
//读文件,每次读一个,共读size次
|
//读文件,每次读一个,共读size次
|
||||||
fread(ar, 1, size, file);
|
fread(ar, 1, size, file);
|
||||||
|
ar[size] = '\0';
|
||||||
int skey[] = { 5,2,3,5,0 };//定义解密数组
|
int skey[] = Skey;//定义解密数组
|
||||||
|
|
||||||
Cutecode(ar, skey);//解密
|
Cutecode(ar, skey);//解密
|
||||||
|
fclose(file);//关闭文件
|
||||||
|
|
||||||
FILE* outfile;
|
FILE* outfile;
|
||||||
outfile = fopen("ImagePacks2/sprite_interface_teart_zero.npk", "wb+");
|
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);//关闭文件
|
fclose(outfile);//关闭文件
|
||||||
free(ar);//释放内存
|
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);//定位到头
|
SQfseek(newfile, 0, 2);//定位到头
|
||||||
if (SQ_Compile(v, func, newfile, filename, printerror) >= 0)
|
if (SQ_Compile(v, func, newfile, filename, printerror) >= 0)
|
||||||
{
|
{
|
||||||
fclose(file);//关闭文件
|
|
||||||
SQ__Fclose(newfile);//关闭文件
|
SQ__Fclose(newfile);//关闭文件
|
||||||
remove("ImagePacks2/sprite_interface_teart_zero.npk");//删除文件
|
remove("ImagePacks2/sprite_interface_teart_zero.npk");//删除文件
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue