111
This commit is contained in:
parent
ca9f19d7c7
commit
191fcd3da9
|
|
@ -27,6 +27,7 @@ void LenheartThread(void)
|
||||||
if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 6)可开始执行判断 = 1;
|
if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 6)可开始执行判断 = 1;
|
||||||
if (可开始执行判断 == 1)//选频道界面 游戏初始化完毕
|
if (可开始执行判断 == 1)//选频道界面 游戏初始化完毕
|
||||||
{
|
{
|
||||||
|
//hook::InitGameScript();
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
Sleep(10);
|
Sleep(10);
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,39 @@ void hook::H_Register_Pack(void* Ecx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::map<wchar_t*, int> bufferm;
|
||||||
|
static SqPushRootFunc* yuancall;
|
||||||
|
|
||||||
|
uint32_t ThFunc(uint32_t v)
|
||||||
|
{
|
||||||
|
|
||||||
|
int a = yuancall(v);
|
||||||
|
//std::cout << u8"参数个数" << params << std::endl;
|
||||||
|
//SQ_Get(v, -2);
|
||||||
|
|
||||||
|
//std::cout <<u8"参数个数为" << ParameterNum - 1 << std::endl;
|
||||||
|
|
||||||
|
for (int i = -3; i < 3; ++i)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (SQ_GetType(v, i) == 134217744)
|
||||||
|
{
|
||||||
|
|
||||||
|
wchar_t* Name;
|
||||||
|
SQGetString(v, i, &Name);
|
||||||
|
if (bufferm.count(Name) == 0)
|
||||||
|
{
|
||||||
|
bufferm[Name] == 1;
|
||||||
|
std::wcout << u8"参数为" << Name << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//SQPrintFunc(v);
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
int hook::RegisterHook()
|
int hook::RegisterHook()
|
||||||
{
|
{
|
||||||
|
|
@ -37,23 +70,33 @@ int hook::RegisterHook()
|
||||||
|
|
||||||
MH_CreateHook((void*)INIT_NUT_ADDRESS, &H_Register_Nut, reinterpret_cast<void**>(&MLnewclosure));
|
MH_CreateHook((void*)INIT_NUT_ADDRESS, &H_Register_Nut, reinterpret_cast<void**>(&MLnewclosure));
|
||||||
|
|
||||||
|
|
||||||
|
MH_CreateHook((void*)0x1358C50, &ThFunc, reinterpret_cast<void**>(&yuancall));
|
||||||
|
|
||||||
MH_EnableHook((void*)INIT_PACK_ADDRESS);
|
MH_EnableHook((void*)INIT_PACK_ADDRESS);
|
||||||
MH_EnableHook((void*)INIT_NUT_ADDRESS);
|
MH_EnableHook((void*)INIT_NUT_ADDRESS);
|
||||||
|
|
||||||
|
|
||||||
|
//MH_EnableHook((void*)0x1358C50);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int hook::InitGameScript()
|
int hook::InitGameScript()
|
||||||
{
|
{
|
||||||
|
MH_EnableHook((void*)0x1359280);
|
||||||
|
/*
|
||||||
uint32_t v = GetSqVm();
|
uint32_t v = GetSqVm();
|
||||||
SQPushRootTable(v);
|
SQPushRootTable(v);
|
||||||
SQPushString(v, L"SetHudUI", -1);
|
SQPushString(v, L"SetHudUI", -1);
|
||||||
SQ_Get(v, -2);
|
SQ_Get(v, -2);
|
||||||
SQPushRootTable(v);
|
SQPushRootTable(v);
|
||||||
//SQPushString(v, L"1.cpp", -1);
|
SQPushString(v, L"1.cpp", -1);
|
||||||
SQ_Call(v, 2, 1, 0);
|
SQ_Call(v, 2, 1, 0);
|
||||||
SQPop(v, 2);
|
SQPop(v, 2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::cout << u8"µ÷Óóɹ¦" << std::endl;
|
std::cout << u8"µ÷Óóɹ¦" << std::endl;
|
||||||
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ public:
|
||||||
//总HOOK
|
//总HOOK
|
||||||
static int RegisterHook();
|
static int RegisterHook();
|
||||||
|
|
||||||
|
static void bbbb();
|
||||||
//插件执行Nut
|
//插件执行Nut
|
||||||
static int InitGameScript();
|
static int InitGameScript();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -76,10 +76,9 @@ int squirrel::sq_Test(uint32_t v)
|
||||||
|
|
||||||
//GMNotice((char*)u"我的天");
|
//GMNotice((char*)u"我的天");
|
||||||
//WindowsNotice((char*)u"我的天");
|
//WindowsNotice((char*)u"我的天");
|
||||||
|
//SQPopTop(v);
|
||||||
SQPopTop(v);
|
//SQPushInt(v, 1);
|
||||||
SQPushInt(v, 1);
|
return 0;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
//读人物 或 装备属性
|
//读人物 或 装备属性
|
||||||
int squirrel::GetCharacterAttribute(uint32_t v)
|
int squirrel::GetCharacterAttribute(uint32_t v)
|
||||||
|
|
@ -1007,7 +1006,6 @@ int squirrel::Set_DragonModel(uint32_t v)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取Squirrel v 基址
|
//获取Squirrel v 基址
|
||||||
inline uint32_t GetSqVm()
|
inline uint32_t GetSqVm()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------Squirrel
|
//-------------------------------------------------------------------------------------------Squirrel
|
||||||
|
// printFunc 输出调用栈和栈内容
|
||||||
|
typedef int(SqPrintFunc)(uint32_t v);
|
||||||
|
static SqPrintFunc* SQPrintFunc = (SqPrintFunc*)0x1354060;
|
||||||
// PushRoot
|
// PushRoot
|
||||||
typedef int(SqPushRootFunc)(uint32_t v);
|
typedef int(SqPushRootFunc)(uint32_t v);
|
||||||
static SqPushRootFunc* SQPushRootTable = (SqPushRootFunc*)0x1358C50;
|
static SqPushRootFunc* SQPushRootTable = (SqPushRootFunc*)0x1358C50;
|
||||||
|
|
@ -22,6 +25,9 @@ static SqPop* SQPop = (SqPop*)0x1358FD0;
|
||||||
//SQ_Get
|
//SQ_Get
|
||||||
typedef int(Sq_Get)(uint32_t v, int n);
|
typedef int(Sq_Get)(uint32_t v, int n);
|
||||||
static Sq_Get* SQ_Get = (Sq_Get*)0x135AE30;
|
static Sq_Get* SQ_Get = (Sq_Get*)0x135AE30;
|
||||||
|
//SQ_Get
|
||||||
|
typedef int(Sq_GetType)(uint32_t v, int n);
|
||||||
|
static Sq_GetType* SQ_GetType = (Sq_GetType*)0x1358CD0;
|
||||||
//SQ_Rawget
|
//SQ_Rawget
|
||||||
typedef int(Sq_Rawget)(uint32_t v, int n);
|
typedef int(Sq_Rawget)(uint32_t v, int n);
|
||||||
static Sq_Rawget* SQ_Rawget = (Sq_Rawget*)0x135AEA0;
|
static Sq_Rawget* SQ_Rawget = (Sq_Rawget*)0x135AEA0;
|
||||||
|
|
@ -184,7 +190,6 @@ public://
|
||||||
static int Get_DragonModel(uint32_t v);//获取 龙盒 模式
|
static int Get_DragonModel(uint32_t v);//获取 龙盒 模式
|
||||||
static int Set_DragonModel(uint32_t v);//设置 龙盒 模式
|
static int Set_DragonModel(uint32_t v);//设置 龙盒 模式
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//新增nut接口funcName绑定C语言函数funcAddr
|
//新增nut接口funcName绑定C语言函数funcAddr
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue