绘制字符(不太满意)
This commit is contained in:
parent
3bdafc7e35
commit
6583312298
|
|
@ -46,7 +46,12 @@ static NoticeTCall _NoticeTcall = (NoticeTCall)0xE6E070;
|
|||
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
|
||||
|
||||
//0x1b45b94
|
||||
class DNFTOOL
|
||||
{
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
#pragma once
|
||||
#include "framework.h"
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
#include "pch.h"
|
||||
#include "STL.h"
|
||||
|
||||
std::vector<DrawCodestruct>DrawCodeT1_STL;
|
||||
std::vector<DrawCodestruct>DrawCodeT2_STL;
|
||||
|
||||
//질분
|
||||
#if defined DRAGONBOX_SWITCH
|
||||
void STL::SyncDargonBox_STL()
|
||||
|
|
|
|||
11
test/STL.h
11
test/STL.h
|
|
@ -64,6 +64,17 @@ static std::map<std::string, int>DargonModel_STL;
|
|||
#endif
|
||||
|
||||
|
||||
//»æÖƺº×ֽṹÌå
|
||||
struct DrawCodestruct
|
||||
{
|
||||
std::string str;
|
||||
int Xpos;
|
||||
int Ypos;
|
||||
int Color;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class STL
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
//#include "squirrel.h"
|
||||
#include "hook.h"
|
||||
#include "DNFTOOL.h"
|
||||
|
||||
|
||||
#include "rapidjson/document.h"
|
||||
|
|
@ -29,8 +26,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
#define LOCALHOSTS_SWITCH "本地免验证 开启"
|
||||
|
||||
|
||||
|
|
@ -50,7 +45,7 @@
|
|||
#define NORMAL_STL "普通STL开启"
|
||||
#define TIME_STL "时间STL开启"
|
||||
#define JSON_STL "Json_STL 开启"
|
||||
|
||||
#define CODE_STL "字符_STL 开启"
|
||||
|
||||
|
||||
|
||||
|
|
@ -96,3 +91,14 @@
|
|||
"viEw5OFWhMMr3AUcynsAYVi47iqfSVMrrwWBFfadHNRbcZchmHbwp9fJhzV53ecK\n"\
|
||||
"LAhMaD06LDHNnEJ1cGt1jiw=\n"\
|
||||
"-----END PRIVATE KEY-----"
|
||||
|
||||
|
||||
|
||||
|
||||
//#include "squirrel.h"
|
||||
#include "STL.h"
|
||||
#include "DNFTOOL.h"
|
||||
#include "sock.h"
|
||||
#include "hook.h"
|
||||
#include "squirrel.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,8 @@
|
|||
#include "pch.h"
|
||||
#include "hook.h"
|
||||
|
||||
#include "sock.h"
|
||||
#include "MinHook.h"
|
||||
#include "squirrel.h"
|
||||
|
||||
#pragma comment(lib, "libMinHook.x86.lib")
|
||||
|
||||
|
||||
|
||||
extern std::vector<DrawCodestruct>DrawCodeT1_STL;
|
||||
extern std::vector<DrawCodestruct>DrawCodeT2_STL;
|
||||
|
||||
uint32_t hook::H_Register_Nut(uint32_t v, void* f, int freeVarsCnt)
|
||||
{
|
||||
|
|
@ -29,62 +23,56 @@ void hook::H_Register_Pack(void* Ecx)
|
|||
}
|
||||
|
||||
|
||||
std::map<wchar_t*, int> bufferm;
|
||||
static SqPushRootFunc* yuancall;
|
||||
|
||||
uint32_t ThFunc(uint32_t v)
|
||||
void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4, int a5, int a6)
|
||||
{
|
||||
|
||||
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 (a3 == 9999 && a4 == 9999)
|
||||
{
|
||||
|
||||
if (SQ_GetType(v, i) == 134217744)
|
||||
for (DrawCodestruct iter : DrawCodeT1_STL)
|
||||
{
|
||||
|
||||
wchar_t* Name;
|
||||
SQGetString(v, i, &Name);
|
||||
if (bufferm.count(Name) == 0)
|
||||
wchar_t* str = DNFTOOL::charTowchar_t((char*)iter.str.c_str());
|
||||
DrawCodeF(thisc, Seat, iter.Xpos, iter.Ypos, iter.Color, (int)str);
|
||||
}
|
||||
DrawCodeT1_STL.clear();
|
||||
}
|
||||
if (a3 == 9999 && a4 == 9998)
|
||||
{
|
||||
bufferm[Name] = 1;
|
||||
std::wcout << u8"参数为" << Name << std::endl;
|
||||
for (DrawCodestruct iter : DrawCodeT2_STL)
|
||||
{
|
||||
wchar_t* str = DNFTOOL::charTowchar_t((char*)iter.str.c_str());
|
||||
DrawCodeF(thisc, Seat, iter.Xpos, iter.Ypos, iter.Color, (int)str);
|
||||
}
|
||||
DrawCodeT2_STL.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//SQPrintFunc(v);
|
||||
return a;
|
||||
return DrawCodeF(thisc, Seat, a3, a4, a5, a6);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int hook::RegisterHook()
|
||||
{
|
||||
MH_Initialize();
|
||||
//HookÊÕ°ü
|
||||
MH_CreateHook((void*)INIT_PACK_ADDRESS, &H_Register_Pack, reinterpret_cast<void**>(&Lpfn_Init));
|
||||
|
||||
//HookNutº¯Êý×¢²á
|
||||
MH_CreateHook((void*)INIT_NUT_ADDRESS, &H_Register_Nut, reinterpret_cast<void**>(&MLnewclosure));
|
||||
//Hook»æÖÆ×Ö·û
|
||||
MH_CreateHook((void*)INIT_NUT_DRAWCODE, &H_Register_DrawCode, reinterpret_cast<void**>(&DrawCodeF));
|
||||
|
||||
|
||||
MH_CreateHook((void*)0x1358C50, &ThFunc, reinterpret_cast<void**>(&yuancall));
|
||||
|
||||
MH_EnableHook((void*)INIT_PACK_ADDRESS);
|
||||
MH_EnableHook((void*)INIT_NUT_ADDRESS);
|
||||
|
||||
|
||||
//MH_EnableHook((void*)0x1358C50);
|
||||
MH_EnableHook((void*)INIT_NUT_DRAWCODE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hook::InitGameScript()
|
||||
{
|
||||
MH_EnableHook((void*)0x1359280);
|
||||
/*
|
||||
|
||||
|
||||
uint32_t v = GetSqVm();
|
||||
SQPushRootTable(v);
|
||||
SQPushString(v, L"SetHudUI", -1);
|
||||
|
|
@ -97,6 +85,6 @@ int hook::InitGameScript()
|
|||
|
||||
|
||||
std::cout << u8"µ÷Óóɹ¦" << std::endl;
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#pragma once
|
||||
#include "MinHook.h"
|
||||
#pragma comment(lib, "libMinHook.x86.lib")
|
||||
|
||||
class hook
|
||||
{
|
||||
|
|
@ -11,6 +13,8 @@ public:
|
|||
static uint32_t H_Register_Nut(uint32_t v, void* f, int freeVarsCnt);
|
||||
//HOOK_收包的替换函数
|
||||
static void H_Register_Pack(void* Ecx);
|
||||
//HOOK_绘制字符的替换函数
|
||||
static void _fastcall H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4, int a5, int a6);
|
||||
//总HOOK
|
||||
static int RegisterHook();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
#include "pch.h"
|
||||
#include "sock.h"
|
||||
|
||||
#include "STL.h"
|
||||
#include "DNFTOOL.h"
|
||||
|
||||
|
||||
//질분
|
||||
#if defined DRAGONBOX_SWITCH
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
#include "pch.h"
|
||||
#include "squirrel.h"
|
||||
#include "DNFTOOL.h"
|
||||
#include "RSAC.h"
|
||||
#include "STL.h"
|
||||
|
||||
|
||||
int squirrel::SQloadfile(uint32_t v, const wchar_t* filename, BOOL printerror)
|
||||
{
|
||||
|
|
@ -71,11 +69,17 @@ int squirrel::SQdofile(uint32_t v, const wchar_t* filename, BOOL retval, BOOL pr
|
|||
//Test
|
||||
int squirrel::sq_Test(uint32_t v)
|
||||
{
|
||||
int a;
|
||||
|
||||
SQGetInt(v, 2, &a);
|
||||
|
||||
//GMNotice((char*)u"我的天");
|
||||
//WindowsNotice((char*)u"我的天");
|
||||
//SQPopTop(v);
|
||||
//SQPushInt(v, 1);
|
||||
//char* str = (char*)"test";
|
||||
|
||||
std::cout << a << std::endl;
|
||||
return 0;
|
||||
}
|
||||
//读人物 或 装备属性
|
||||
|
|
@ -1052,7 +1056,7 @@ int squirrel::Set_DragonModel(uint32_t v)
|
|||
#endif
|
||||
|
||||
|
||||
|
||||
//Json STL
|
||||
#if defined JSON_STL
|
||||
//构造Json类型容器
|
||||
static std::map<std::string, std::string>Json_STL;
|
||||
|
|
@ -1122,7 +1126,6 @@ int squirrel::Jsoner_STL(uint32_t v)
|
|||
SQGetString(v, 3, &GKey);
|
||||
char* key = DNFTOOL::wchar_tTochar(GKey);
|
||||
rapidjson::Document Dom;
|
||||
std::cout << Json_STL["Lenheart"].c_str() << std::endl;
|
||||
Dom.Parse(Json_STL[Name].c_str());//加载 字符串
|
||||
|
||||
std::vector<std::string> Data;
|
||||
|
|
@ -1256,6 +1259,64 @@ int squirrel::Jsoner_STL(uint32_t v)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//字符 STL
|
||||
#if defined CODE_STL
|
||||
extern std::vector<DrawCodestruct>DrawCodeT1_STL;
|
||||
extern std::vector<DrawCodestruct>DrawCodeT2_STL;
|
||||
int squirrel::Coder_STL(uint32_t v)
|
||||
{
|
||||
wchar_t* Str;
|
||||
int XPos;
|
||||
int YPos;
|
||||
int Color;
|
||||
int Type;
|
||||
int ParameterNum = SQGetTop(v);
|
||||
if (ParameterNum == 6)
|
||||
{
|
||||
//获取字符串内容
|
||||
SQGetString(v, 2, &Str);
|
||||
//获取X坐标
|
||||
SQGetInt(v, 3, &XPos);
|
||||
//获取X坐标
|
||||
SQGetInt(v, 4, &YPos);
|
||||
//获取颜色
|
||||
SQGetInt(v, 5, &Color);
|
||||
//获取类型
|
||||
SQGetInt(v, 6, &Type);
|
||||
|
||||
DrawCodestruct Buffer;
|
||||
char* str = DNFTOOL::wchar_tTochar(Str);
|
||||
Buffer.str = str;
|
||||
Buffer.Xpos = XPos;
|
||||
Buffer.Ypos = YPos;
|
||||
Buffer.Color = Color;
|
||||
switch (Type)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
DrawCodeT1_STL.push_back(Buffer);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
DrawCodeT2_STL.push_back(Buffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
SQPushBool(v, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SQPushBool(v, false);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//获取Squirrel v 基址
|
||||
inline uint32_t GetSqVm()
|
||||
{
|
||||
|
|
@ -1334,7 +1395,7 @@ void squirrel::R_Register_Nut()
|
|||
RegisterNutApi(L"L_Get_STL", squirrel::Get_STL);//获取容器
|
||||
#endif
|
||||
|
||||
//时间 STL
|
||||
//时间 STL
|
||||
#if defined TIME_STL
|
||||
RegisterNutApi(L"L_Timer_STL", squirrel::Timer_STL);//时间容器
|
||||
#endif
|
||||
|
|
@ -1344,7 +1405,12 @@ void squirrel::R_Register_Nut()
|
|||
RegisterNutApi(L"L_Json_STL", squirrel::Jsoner_STL);//时间容器
|
||||
#endif
|
||||
|
||||
//龙盒
|
||||
//字符 STL
|
||||
#if defined CODE_STL
|
||||
RegisterNutApi(L"L_Code_STL", squirrel::Coder_STL);//字符容器
|
||||
#endif
|
||||
|
||||
//龙盒
|
||||
#if defined DRAGONBOX_SWITCH
|
||||
RegisterNutApi(L"L_Get_DragonModel", squirrel::Get_DragonModel);//获取龙盒模式
|
||||
RegisterNutApi(L"L_Set_DragonModel", squirrel::Set_DragonModel);//设置龙盒模式
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#pragma once
|
||||
#include "DNFTOOL.h"
|
||||
#include "RSAC.h"
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------Squirrel
|
||||
|
|
@ -186,6 +188,9 @@ static SQ_ThrowerrorFunc* SQ_Throwerror = (SQ_ThrowerrorFunc*)0x13591A0;
|
|||
inline uint32_t GetSqVm();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class squirrel
|
||||
{
|
||||
private:
|
||||
|
|
@ -231,6 +236,8 @@ public://
|
|||
static int Timer_STL(uint32_t v);//时间容器
|
||||
static int Jsoner_STL(uint32_t v);//时间容器
|
||||
|
||||
static int Coder_STL(uint32_t v);//时间容器
|
||||
|
||||
public://龙盒
|
||||
static int Sync_Dragon_Pack(uint32_t v);//同步 龙盒数据包
|
||||
static int Get_Dragon_Pack(uint32_t v);//获取 龙盒数据包
|
||||
|
|
|
|||
|
|
@ -174,7 +174,6 @@
|
|||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="BASE64.h" />
|
||||
<ClInclude Include="Dargon.h" />
|
||||
<ClInclude Include="DNFTOOL.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="hook.h" />
|
||||
|
|
|
|||
|
|
@ -42,9 +42,6 @@
|
|||
<ClInclude Include="STL.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Dargon.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BASE64.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
Loading…
Reference in New Issue