修改时间容器前

This commit is contained in:
947330670 2022-06-20 03:10:33 +08:00
parent ff48fc1d25
commit e17ffc3965
9 changed files with 116 additions and 73 deletions

View File

@ -351,9 +351,10 @@ void DNFTOOL::GMNotice(char* str, int type, int color)
#else
std::string DNFTOOL::GetIP()
{
httplib::SSLClient Tencword("gitee.com");
//std::cout << "»ñÈ¡Ip" << std::endl;
httplib::SSLClient Tencword("yosin-team.coding.net");
std::string body;
auto res = Tencword.Get("/yosin_team/request-ip/raw/master/README.md",
auto res = Tencword.Get("/p/huoqushuju/d/GetIp/git/raw/master/ip.txt?download=false",
[&](const char* data, size_t data_length) {
body.append(data, data_length);
return true;

16
test/Main.h Normal file
View File

@ -0,0 +1,16 @@
#pragma once
class Main
{
public:
Main();
void OpenConsole();//¿ªÆô¿ØÖÆÌ¨
void Validation();//ÑéÖ¤
void Run();
};

View File

@ -1,24 +1,15 @@
#pragma once
#include "pch.h"
//单个字符异或运算
char MakecodeChar(char c, int key) {
return c = c ^ key;
}
//单个字符解密
char CutcodeChar(char c, int key) {
return c ^ key;
}
//加密
void Makecode(char* pstr, int* pkey) {
int len = strlen(pstr);//获取长度
for (int i = 0; i < len; i++)
*(pstr + i) = MakecodeChar(*(pstr + i), pkey[i % 5]);
char CutcodeChar(char c, int key, int key2) {
return (((c - 1) ^ key) ^ key2) - key;
}
//解密
void Cutecode(char* pstr, int* pkey) {
int len = strlen(pstr);
for (int i = 0; i < len; i++)
*(pstr + i) = CutcodeChar(*(pstr + i), pkey[i % 5]);
*(pstr + i) = CutcodeChar(*(pstr + i), pkey[i % 5], pkey[(i + 18) % 5]);
}

View File

@ -8,46 +8,15 @@
#if defined LOCALHOSTS_SWITCH
void LenheartThread(void)
{
// 下方写全局变量
static int Nut头地址;
static int ;
static int ;
while (true)
{
Sleep(10);
if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 6) = 1;
if ( == 1)//选频道界面 游戏初始化完毕
{
//hook::InitGameScript();
while (true)
{
Sleep(10);
if (DNFTOOL::GetExeNutWrtNum(61) != 0 && Nut头地址 == 0)Nut头地址 = DNFTOOL::GetExeNutWrtNum(61);
//if (GetExeNutWrtNum(61 != 0))属性头地址 = GetExeNutWrtNum(61);
if (DNFTOOL::GetExeNutWrtNum(0) == 666)
{
std::cout << "写成功" << std::endl;;
DNFTOOL::SetExeNutWrtNum(0, 0);
DNFTOOL::SetNutArrNum(Nut头地址 , 20, 0);
}
}
}
}
}
#else
void LenheartThread()
{
while (true)
{
Sleep(10);
static int ;
if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 6) = 1;
if ( == 1)
{
Sleep(3000);
//获取验证服务器ip
std::string Rqip = DNFTOOL::GetIP();
//std::cout << "验证服务器IP:" << Rqip << std::endl;
@ -81,7 +50,6 @@ void LenheartThread()
//std::cout << "验证IP:" << ippack << std::endl;
//已经获取了要发送的验证IP
LenheartBase::CBASE64 bb;
ippack += "nima";
std::string rsastring = bb.RsaPriEncrypt(ippack, Pri_key);
@ -108,30 +76,30 @@ void LenheartThread()
__int64 absnum = abs(nowdate - redate);
if (absnum < 18000)
{
hook::InitGameScript();
return;
Sleep(300000);
}
else
{
//ExitProcess(0);
ExitProcess(0);
}
}
else
{
//ExitProcess(0);
ExitProcess(0);
}
return;
}
}
}
#endif
__declspec(dllexport) void Lenheart()
{
DWORD threadID;
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LenheartThread, NULL, 0, &threadID);
HANDLE Thand = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LenheartThread, NULL, 0, &threadID);
//Sleep(300000);
//CloseHandle(Thand);//销毁线程
//return Lenheart();
}
@ -145,7 +113,6 @@ BOOL APIENTRY DllMain( HMODULE hModule,
{
case DLL_PROCESS_ATTACH:
#if defined COUTWINDOWS_SWITCH
AllocConsole();
freopen(("CONOUT$"), ("w"), stdout);

View File

@ -27,7 +27,10 @@
//#define LOCALHOSTS_SWITCH "本地免验证 开启"
#define COUTWINDOWS_SWITCH "输出窗口 开启"
#define GOLD_LIGHT "曙光 开启"
#define MONSTER_BLOOD_UI "血槽修改 开启"
@ -65,9 +68,12 @@
#include "httplib.h"
#endif
#if defined GOLD_LIGHT
# define Skey {5,1,9,1,2}
#else
# define Skey {5,2,7,7,0}
#endif
# define Pri_key "-----BEGIN PRIVATE KEY-----\n"\
"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDFRCM7WMVgU81p\n"\
"JXGmH7nxun7IaXiERWtegwJ7WsV6I4D+K4TMHkm5LVgnsQnFWluJhNkpO7iMR7mA\n"\

View File

@ -38,16 +38,18 @@ void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4,
//ĚŘĘâ
if (a3 == 9999 && a4 == 9998)
{
uint32_t v = GetSqVm();
SQPushRootTable(v);
SQPushString(v, L"DrawMainMaxLayerCustomUI", -1);
SQ_Get(v, -2);
SQPushRootTable(v);
SQPushString(v, L"Lenheart", -1);
SQ_Call(v, 2, 1, 0);
SQ_Call(v, 2, 0, 0);
SQPop(v, 2);
//int num = SQGetTop(v);
//std::cout << num << std::endl;
for (DrawCodestruct iter : DrawCodeT2_STL)
{
//wchar_t* str = DNFTOOL::charTowchar_t((char*)iter.str.c_str());
@ -58,16 +60,36 @@ void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4,
//ŃĄ˝ÇÉŤ
if (a3 == 9999 && a4 == 9489)
{
static bool Init = false;
if (!Init)
{
InitGameScript();//µ÷Óóõʼ»¯³ÌÐò
Init = true;
}
uint32_t v = GetSqVm();
SQPushRootTable(v);
SQPushString(v, L"InitLenheartClass", -1);
SQ_Get(v, -2);
SQPushRootTable(v);
SQPushString(v, L"Lenheart", -1);
SQ_Call(v, 2, 1, 0);
SQ_Call(v, 2, 0, 0);
SQPop(v, 2);
}
#if defined MONSTER_BLOOD_UI
if (a4 == 100 || a4 == 107 || a4 == 99)
{
//if (a3 == 37 || a3 == 100 || a3 == 74 || a3 == 70)
//{
a3 = 5000;
a4 = 5000;
//}
}
#endif
//std::cout << "xPos:" << a3 << "yPos:" << a4 <<std::endl;
//thisc = 0;
return DrawCodeF(thisc, Seat, a3, a4, a5, a6);
}
@ -95,7 +117,6 @@ int hook::RegisterHook()
int hook::InitGameScript()
{
#if defined LOCALHOSTS_SWITCH
uint32_t v = GetSqVm();
SQPushRootTable(v);
@ -112,7 +133,7 @@ int hook::InitGameScript()
SQ_Get(v, -2);
SQPushRootTable(v);
SQPushString(v, L"licbylist.dll", -1);
SQ_Call(v, 2, 1, 0);
SQ_Call(v, 2, 0, 0);
SQPop(v, 2);
#endif
return 0;

View File

@ -16,6 +16,17 @@ void sock::Pack_Control(int idx, int code, void* p3, void* p4)
Dom.Parse(Buffer);//속潼 俚륜눔
int Op = Dom["op"].GetInt();//털뙤잚謹
uint32_t v = GetSqVm();
SQPushRootTable(v);
SQPushString(v, L"Sq_Pack_Control", -1);
SQ_Get(v, -2);
SQPushRootTable(v);
SQPushString(v, DNFTOOL::charTowchar_t(Buffer), -1);
SQ_Call(v, 2, 0, 0);
SQPop(v, 2);
//질분
#if defined DRAGONBOX_SWITCH
if (Op >= 0 && Op <= 10)Json_STL["DragonBox"] = Buffer;
@ -26,8 +37,6 @@ void sock::Pack_Control(int idx, int code, void* p3, void* p4)
if (Op >= 10 && Op <= 20)Json_STL["WorldBoss"] = Buffer;
#endif
#if defined LOCALHOSTS_SWITCH
std::cout << "130뵀澗관냥묘" << std::endl;
std::cout << "관코휭" << Buffer << std::endl;

View File

@ -868,13 +868,16 @@ int squirrel::New_STL(uint32_t v)
//时间 STL
#if defined TIME_STL
extern std::map<wchar_t*, TimeSTLStruct>Time_STL;
//时间容器线程
void TimeSTL(LPVOID lpParam)
{
TimeSTLStruct *pack = (TimeSTLStruct*)lpParam;//得到传递的包
std::wcout << "线程启动:" << pack->Name << std::endl;
Time_STL[pack->Name].Static_Time = (int)GetTickCount64();//设置时间容器的基准时间
while (true)//线程循环
{
Sleep(10);
int N_Time = (int)GetTickCount64() - Time_STL[pack->Name].Static_Time;//得到现在的时间
if (N_Time < Time_STL[pack->Name].Max_Time)//如果还没到 设定新的now时间
{
@ -905,7 +908,7 @@ int squirrel::Timer_STL(uint32_t v)
switch (Type)
{
case 0: {//设置时间容器
case 0: //设置时间容器
if (Time_STL.count(Name) != 0)//如果这个标识容器存在 就返回 否则创建
{
SQPushBool(v, false);
@ -918,24 +921,25 @@ int squirrel::Timer_STL(uint32_t v)
pack.Static_Time = 0;//设置 基础时间(用于运算)
pack.Thand = NULL;//设置句柄为空
Time_STL[Name] = pack;//设置包给标识时间容器
break; }
case 1: {//启动时间容器
break;
case 1: //启动时间容器
if (Time_STL[Name].Thand == NULL)//只有句柄为空的时候new线程
{
DWORD threadID;//线程ID
Time_STL[Name].Now_Time = 0;//设置当前容器时间
Time_STL[Name].Thand = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)TimeSTL, &Time_STL[Name], 0, &threadID);//创建一个新线程 开始计算时间 并把线程赋予给容器
}
break; }
break;
case 2://获取时间容器
SQPushInt(v, Time_STL[Name].Now_Time);//返回当前容器时间
return 1;
break;
case 3://重置时间容器
SuspendThread(Time_STL[Name].Thand);//挂起线程
//SuspendThread(Time_STL[Name].Thand);//挂起线程
CloseHandle(Time_STL[Name].Thand);//销毁线程
Time_STL[Name].Static_Time = 0;//基准时间设置为0
Time_STL[Name].Thand = NULL;
ResumeThread(Time_STL[Name].Thand);//启动线程
//ResumeThread(Time_STL[Name].Thand);//启动线程
break;
case 4://暂停时间容器
SuspendThread(Time_STL[Name].Thand);//挂起线程
@ -1284,6 +1288,34 @@ int squirrel::Jsoner_STL(uint32_t v)
Json_STL[Name] = jsonBuffer.GetString();
SQPushBool(v, true);
}
else if (ParameterNum == 5)
{
//获取容器名字
SQGetString(v, 2, &WName);
char* CName = DNFTOOL::wchar_tTochar(WName);
std::string Name = CName;
//获取Str 的内容
wchar_t* str;
SQGetString(v, 3, &str);
//转化为可用内容
char* Jso = DNFTOOL::wchar_tTochar(str);
//获取类型
int Type;
SQGetInt(v, 4, &Type);
switch (Type)
{
case 0:
Json_STL[Name] = Jso;
break;
case 1:
if(Json_STL[Name].empty())Json_STL[Name] = Jso;
break;
default:
break;
}
}
else
{
SQPushBool(v, false);

View File

@ -78,7 +78,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>Y:\DOF\DOF-Lenheart\Plugins\</OutDir>
<OutDir>Y:\DOF\D&amp;F-曙光 - 单机\Plugins</OutDir>
<LibraryPath>E:\openssl\lib;E:\Testnixiang\test\test\OpenSSL-Win32\lib;E:\Testnixiang\test\test\OpenSSL-Win32\lib\VC;$(LibraryPath)</LibraryPath>
<IncludePath>E:\openssl\include;$(IncludePath)</IncludePath>
</PropertyGroup>