111
This commit is contained in:
413
Include/Hook.hpp
413
Include/Hook.hpp
@@ -4,6 +4,7 @@
|
||||
#include "inlinehook.h"
|
||||
#include "RegisterSquirrel.hpp"
|
||||
#include "IO_Ex.hpp"
|
||||
#include "Verify.hpp"
|
||||
|
||||
//游戏初始化完毕Flag
|
||||
static bool InitGameFlag = false;
|
||||
@@ -37,36 +38,32 @@ int Sq_mycompilebuffer(HSQUIRRELVM v, const wchar_t* s, int size, const wchar_t*
|
||||
|
||||
|
||||
void Suxn() {
|
||||
|
||||
size_t Ds = BaseData.size();
|
||||
HSQUIRRELVM v = *(HSQUIRRELVM*)0x1AF3544;
|
||||
|
||||
for (size_t i = 0; i < Ds; i++)
|
||||
{
|
||||
std::string filenamebuf = "BaseData" + std::to_string(i);
|
||||
std::string filenamebuf = "BaseData" + std::to_string(i) + BaseData[i].substr(0,50);
|
||||
std::string strbuf = BaseData[i];
|
||||
wchar_t* filename = DNFTOOL::charTowchar_t((char*)filenamebuf.c_str());
|
||||
wchar_t* str = DNFTOOL::charTowchar_t((char*)strbuf.c_str());
|
||||
std::wstring filename = DNFTOOL::charTowchar_t((char*)filenamebuf.c_str());
|
||||
std::wstring str = DNFTOOL::charTowchar_t((char*)strbuf.c_str());
|
||||
|
||||
HSQUIRRELVM v = *(HSQUIRRELVM*)0x1AF3544;
|
||||
SQInteger Top = Sq_gettop(v);
|
||||
#ifdef SELL
|
||||
//std::cout << strbuf << std::endl;
|
||||
if (Sq_mycompilebuffer(v, str, wcslen(str), L"interactive console", false) >= 0) {
|
||||
if (Sq_mycompilebuffer(v, str.c_str(), str.length(), filename.c_str(), false) >= 0) {
|
||||
Sq_pushroottable(v);
|
||||
Sq_call(v, 1, SQFalse, SQTrue);
|
||||
Sq_pop(v, 1);
|
||||
//std::cout << "加载了: " << strbuf.substr(0, 100) << std::endl;
|
||||
}
|
||||
#else
|
||||
if (Sq_mycompilebuffer(v, str, wcslen(str), filename, false) >= 0) {
|
||||
if (Sq_mycompilebuffer(v, str.c_str(), str.length(), filename.c_str(), false) >= 0) {
|
||||
Sq_pushroottable(v);
|
||||
Sq_call(v, 1, SQFalse, SQTrue);
|
||||
Sq_pop(v, 1);
|
||||
}
|
||||
#endif // SELL
|
||||
Sq_settop(v, Top);
|
||||
delete[] filename;
|
||||
delete[] str;
|
||||
}
|
||||
BaseData.clear();
|
||||
jiaoben = false;
|
||||
@@ -790,8 +787,6 @@ void __declspec(naked)MonsetrRace_Hook() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -938,7 +933,7 @@ typedef void(__cdecl* pack_handler_t)(int idx, int err, void*, void*);
|
||||
typedef void(__cdecl* register_pack_handler_t)(int idx, pack_handler_t handler, int zero);
|
||||
typedef bool(__cdecl* _Net_Get_Dword)(DWORD*);
|
||||
static _Net_Get_Dword Net_Get_Dword = reinterpret_cast<_Net_Get_Dword>(0x011AEA60);
|
||||
typedef bool(__cdecl* _Net_Get_Buffer)(char*, int);
|
||||
typedef bool(__cdecl* _Net_Get_Buffer)(void*, int);
|
||||
static _Net_Get_Buffer Net_Get_Buffer = reinterpret_cast<_Net_Get_Buffer>(0x011AEA90);
|
||||
//130号收包
|
||||
void Pack_Control(int idx, int code, void* p3, void* p4)
|
||||
@@ -949,10 +944,11 @@ void Pack_Control(int idx, int code, void* p3, void* p4)
|
||||
Net_Get_Dword(&Size);
|
||||
char* Buffer = new char[Size + 1];
|
||||
Net_Get_Buffer(Buffer, Size);
|
||||
|
||||
Buffer[Size] = '\0';
|
||||
|
||||
wchar_t* ss = DNFTOOL::charTowchar_t(Buffer);
|
||||
|
||||
std::wstring ss = DNFTOOL::charTowchar_t(Buffer);
|
||||
delete[]Buffer;
|
||||
HSQUIRRELVM v = *(HSQUIRRELVM*)0x1AF3544;
|
||||
SQInteger Top = Sq_gettop(v);
|
||||
Sq_pushroottable(v);
|
||||
@@ -964,11 +960,84 @@ void Pack_Control(int idx, int code, void* p3, void* p4)
|
||||
|
||||
if (SQ_SUCCEEDED(Sq_get(v, -2))) {
|
||||
Sq_pushroottable(v);
|
||||
Sq_pushstring(v, ss, -1);
|
||||
Sq_pushstring(v, ss.c_str(), -1);
|
||||
Sq_call(v, 2, SQFalse, SQTrue);
|
||||
}
|
||||
Sq_settop(v, Top);
|
||||
delete[]ss;
|
||||
}
|
||||
}
|
||||
void Pack_Control2(int idx, int code, void* p3, void* p4)
|
||||
{
|
||||
if (InitGameFlag)
|
||||
{
|
||||
DWORD Size;
|
||||
Net_Get_Dword(&Size);
|
||||
void* Buffer = malloc(Size);
|
||||
Net_Get_Buffer(Buffer, Size);
|
||||
|
||||
HSQUIRRELVM v = *(HSQUIRRELVM*)0x1AF3544;
|
||||
SQInteger Top = Sq_gettop(v);
|
||||
Sq_pushroottable(v);
|
||||
Sq_pushstring(v, L"Sq_BlobPack_Control", -1);
|
||||
if (SQ_SUCCEEDED(Sq_get(v, -2))) {
|
||||
Sq_pushroottable(v);
|
||||
Sq_pushinteger(v, Size);
|
||||
Sq_pushuserpointer(v,Buffer);
|
||||
Sq_call(v, 3, SQFalse, SQTrue);
|
||||
}
|
||||
Sq_settop(v, Top);
|
||||
free(Buffer);
|
||||
|
||||
|
||||
//Buffer[Size] = '\0';
|
||||
|
||||
// std::wstring ss = DNFTOOL::charTowchar_t(Buffer);
|
||||
//
|
||||
// HSQUIRRELVM v = *(HSQUIRRELVM*)0x1AF3544;
|
||||
// SQInteger Top = Sq_gettop(v);
|
||||
// Sq_pushroottable(v);
|
||||
//#if defined(SELL) || defined(EXPRESS)
|
||||
// Sq_pushstring(v, L"Sq_Pack_Control", -1);
|
||||
//#else
|
||||
// Sq_pushstring(v, L"Sq_Pack_ControlLocal", -1);
|
||||
//#endif // SELL
|
||||
//
|
||||
// if (SQ_SUCCEEDED(Sq_get(v, -2))) {
|
||||
// Sq_pushroottable(v);
|
||||
// Sq_pushstring(v, ss.c_str(), -1);
|
||||
// Sq_call(v, 2, SQFalse, SQTrue);
|
||||
// }
|
||||
// Sq_settop(v, Top);
|
||||
}
|
||||
else {
|
||||
DWORD Size;
|
||||
Net_Get_Dword(&Size);
|
||||
void* Buffer = malloc(Size);
|
||||
Net_Get_Buffer(Buffer, Size);
|
||||
|
||||
std::string StringBuffer((char*)Buffer, Size);
|
||||
//std::cout << "base64: " << StringBuffer << std::endl;
|
||||
|
||||
|
||||
std::vector<unsigned char> StrBuf = Base64::decode(StringBuffer);
|
||||
|
||||
char* strip = reinterpret_cast<char*>(StrBuf.data());;
|
||||
|
||||
int RealKey[5] = { 5,7,8,1,6 };
|
||||
Cutecode(strip, RealKey, StrBuf.size(), 5);//解密
|
||||
|
||||
std::string Ip(strip, StrBuf.size());
|
||||
|
||||
#ifdef SELL
|
||||
VerifyThreadParams* params = new VerifyThreadParams;
|
||||
params->data = Ip;
|
||||
//多线程验证
|
||||
DWORD threadID;
|
||||
HANDLE Thand = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)VerifyThread, params, 0, &threadID);
|
||||
#endif
|
||||
|
||||
//std::cout << "IP++++++++:" << Ip << std::endl;
|
||||
//std::cout << "IP++++++++:" << Ip.length() << std::endl;
|
||||
}
|
||||
}
|
||||
void H_Register_Pack(void* Ecx)
|
||||
@@ -976,7 +1045,9 @@ void H_Register_Pack(void* Ecx)
|
||||
Lpfn_Init(Ecx);
|
||||
auto Registerfunc = reinterpret_cast<register_pack_handler_t>(0x7186D0);
|
||||
|
||||
Registerfunc(130, Pack_Control, 0);
|
||||
//Registerfunc(130, Pack_Control, 0);
|
||||
//Registerfunc(131, Pack_Control2,0);
|
||||
//std::cout << "注册1" << std::endl;
|
||||
}
|
||||
|
||||
//DrawMain HOOK
|
||||
@@ -984,13 +1055,27 @@ typedef DWORD(_fastcall _4C61F0)(DWORD thisc, DWORD Seat);
|
||||
static _4C61F0* Old4C61F0;
|
||||
DWORD _fastcall New4C61F0(DWORD thisc, DWORD Seat)
|
||||
{
|
||||
|
||||
//选择频道调用
|
||||
static bool RegisterPackFlag = false;
|
||||
if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+", 0) == 6 && !RegisterPackFlag) {
|
||||
RegisterPackFlag = true;
|
||||
//注册包控制 (很多煞笔登录器不让开始注册)
|
||||
auto Registerfunc = reinterpret_cast<register_pack_handler_t>(0x7186D0);
|
||||
Registerfunc(130, Pack_Control, 0);
|
||||
Registerfunc(131, Pack_Control2, 0);
|
||||
//std::cout << "注册2" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
DWORD Ret = Old4C61F0(thisc, Seat);
|
||||
if (BaseData.size() > 0 && jiaoben == true && InitGameFlag) {
|
||||
Suxn();
|
||||
|
||||
//注册包控制 (很多煞笔登录器不让开始注册)
|
||||
auto Registerfunc = reinterpret_cast<register_pack_handler_t>(0x7186D0);
|
||||
Registerfunc(130, Pack_Control, 0);
|
||||
////注册包控制 (很多煞笔登录器不让开始注册)
|
||||
//auto Registerfunc = reinterpret_cast<register_pack_handler_t>(0x7186D0);
|
||||
//Registerfunc(130, Pack_Control, 0);
|
||||
|
||||
}
|
||||
static bool mouseInit = false;
|
||||
|
||||
@@ -1029,7 +1114,6 @@ DWORD _fastcall New4C61F0(DWORD thisc, DWORD Seat)
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
static void InitBin() {
|
||||
void* buf = malloc(81443744);
|
||||
int readsize;
|
||||
@@ -1056,32 +1140,22 @@ static void InitBin() {
|
||||
free(buf);
|
||||
}
|
||||
|
||||
void PFunc(HSQUIRRELVM v, const SQChar* s, ...) {
|
||||
va_list vl;
|
||||
va_start(vl, s);
|
||||
// 使用_vsnwprintf正确计算格式化后的宽字符字符串长度
|
||||
int len = _vsnwprintf(nullptr, 0, s, vl);
|
||||
va_end(vl);
|
||||
|
||||
va_start(vl, s);
|
||||
// 动态分配足够的内存空间,注意长度计算需要考虑宽字符的字节数(通常一个宽字符占2字节或更多,取决于平台和编码)
|
||||
wchar_t* buffer = new wchar_t[len + 1];
|
||||
// 将格式化后的宽字符字符串拼接到动态分配的内存中
|
||||
_vsnwprintf(buffer, len + 1, s, vl);
|
||||
va_end(vl);
|
||||
|
||||
std::wofstream outFile("test.txt", std::ios::out | std::ios::app | std::ios::binary); // 以二进制模式打开文件用于追加写入
|
||||
if (outFile) {
|
||||
outFile << buffer << std::endl; // 将宽字符字符串写入文件,并添加换行符
|
||||
outFile.close(); // 关闭文件流
|
||||
std::wcout << L"宽字符字符串已成功追加写入文件。" << std::endl;
|
||||
}
|
||||
else {
|
||||
std::wcerr << L"无法打开文件进行追加写入。" << std::endl;
|
||||
}
|
||||
// 捕获函数
|
||||
void CaptureSQPrint(HSQUIRRELVM v, const SQChar* format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
std::wcout << buffer << std::endl; // 使用std::wcout输出宽字符字符串
|
||||
delete[] buffer;
|
||||
|
||||
int requiredSize = _vscwprintf(format, args) + 1; // 计算所需长度
|
||||
|
||||
static wchar_t* capturedWString = new wchar_t[requiredSize];
|
||||
// 安全地格式化字符串
|
||||
vswprintf(capturedWString, requiredSize, format, args);
|
||||
va_end(args);
|
||||
|
||||
std::wcout << capturedWString << std::endl;
|
||||
}
|
||||
|
||||
//HookNut函数注册
|
||||
@@ -1089,122 +1163,87 @@ typedef void(__cdecl _Register_Nut)();
|
||||
static _Register_Nut* Register_Nut_Old;
|
||||
void __cdecl H_Register_Nut()
|
||||
{
|
||||
InitBin();
|
||||
|
||||
//原始注册逻辑
|
||||
Register_Nut_Old();
|
||||
|
||||
static bool Init = false;
|
||||
if (!Init) {
|
||||
Init = true;
|
||||
//sq_setprintfunc(*(HSQUIRRELVM*)0x1AF3544, PFunc);
|
||||
static bool init = false;
|
||||
if (!init) {
|
||||
init = true;
|
||||
HSQUIRRELVM v = *(HSQUIRRELVM*)0x1AF3544;
|
||||
//读取bin文件字符串
|
||||
InitBin();
|
||||
//注册我自己的nut函数
|
||||
R_Register_Nut();
|
||||
|
||||
std::string BaseFile = "YosinBaseC";
|
||||
std::string Base = R"(
|
||||
FFI_FIRST_ABI <- 0;
|
||||
FFI_SYSV <- 1;
|
||||
FFI_STDCALL <- 2;
|
||||
FFI_THISCALL <- 3;
|
||||
FFI_FASTCALL <- 4;
|
||||
FFI_MS_CDECL <- 5;
|
||||
FFI_PASCAL <- 6;
|
||||
FFI_REGISTER <- 7;
|
||||
Lenheart_P_Update <- true;
|
||||
function Sq_L_Medal (x,y) {}
|
||||
function Sq_SettingWindowCallBack (x,y) {}
|
||||
function Sq_BuffSwitchingCallBack (x,y) {}
|
||||
function Sq_SwitchingCallBack (x,y) {}
|
||||
function Sq_UpgradeCallBack (x,y) {}
|
||||
function Sq_RecoveryCallBack (x,y) {}
|
||||
function Sq_RecoveryTypeSetCallBack (Type) {}
|
||||
function Sq_DrawMainMaxLayerCustomUI (pack) {}
|
||||
function Lenheart (VmTop) {}
|
||||
function Sq_MouseEventCallBack (Lb, Rb, Mb) {}
|
||||
function Sq_SelectCharacter (Chunk) {}
|
||||
function Sq_DrawMainTopLayerCustomUI (pack) {}
|
||||
function Sq_GetExeStr_Event (StrIndex) {return StrIndex;}
|
||||
function Sq_CreatChr (chunk) {}
|
||||
function Sq_SendPackType_Event (Type) {}
|
||||
function Sq_SendPackByte_Event (Parm) {}
|
||||
function Sq_SendPackWord_Event (Parm) {}
|
||||
function Sq_SendPackDWord_Event (Parm) {}
|
||||
function Sq_SendPackChar_Event (Parm) {}
|
||||
function Sq_SendPack_Event () {}
|
||||
function Sq_DrawItemBack (Xpos, Ypos, Image) {}
|
||||
function Sq_DrawItemFront (Xpos, Ypos, Image) {}
|
||||
function Sq_GetDrawMonBloodSw () {return false;}
|
||||
function Sq_DrawMonsterBlood (Object, X, Y) {}
|
||||
function Sq_Set_Inventory_M_Pos (This) {}
|
||||
function Sq_Get_Ex_IntData (SkillAddress, Idx, objAddress) {return 0;}
|
||||
function Sq_Get_Ex_SkillCoolTime (SkillAddress, Idx, objAddress) {return 0;}
|
||||
function Sq_Get_Ex_LevelData (SkillAddress, Idx, objAddress) {return 0;}
|
||||
function Sq_PlayerEachPos (x, y) {}
|
||||
function Sq_DrawMainMaxLayerCustomUI (pack) {}
|
||||
function Sq_PushDamageFontData (ObjAddress, X, Y, Z, Value, Type,A8,A9) { return true;}
|
||||
function Sq_PushDamageData(ObjAddress, MySelfAddress, Value);
|
||||
function Sq_Pack_Control (chunk) {}
|
||||
function Sq_MessageWindowDraw (a,c) {}
|
||||
function Sq_Get_Event_Pos_X () {return 1;}
|
||||
function Sq_Get_Event_Pos_Y () {return 1;}
|
||||
function Sq_L_OtherPlayerInfo (x, y, Type, Value, ImgBuf) {local str = Value.tostring(); local lenght = L_sq_GetStringDrawLength(str); L_sq_DrawImg(ImgBuf, x + 70 - lenght, y + 5); return Value;}
|
||||
function Sq_DrawMiniMapUI (a) {}
|
||||
function Sq_CompleteTask(a1,a2,a3){}
|
||||
function L_drawMainCustomUI_All(){}
|
||||
function L_MouseCallBack(a, b, c,d) {}
|
||||
function L_DrawWindow_A() {}
|
||||
function L_DrawWindow_B() {}
|
||||
function L_OpenOldWindowCallBack(WindowIndex) {}
|
||||
function L_Old_Window_Get(WindowObject) {}
|
||||
function L_Character_Info_Window(WindowObject) { return false;}
|
||||
function L_Other_Character_Info_Window(WindowObject) {return false;}
|
||||
function L_Old_Window_Visible(WindowObject,Flag) {}
|
||||
|
||||
sq_setprintfunc(v,CaptureSQPrint);
|
||||
|
||||
getroottable().LenheartBaseFuncTab <- {};
|
||||
getroottable().LenheartFuncTab <- {};
|
||||
getroottable().Rindro_Scr_Width <- L_sq_RA(0x4D848E);
|
||||
getroottable().Rindro_Scr_High <- L_sq_RA(0x4D8495);
|
||||
|
||||
)";
|
||||
|
||||
//是否为本地
|
||||
FILE* file = fopen("sqr/DofileList.nut", "rb");
|
||||
if (file)
|
||||
{
|
||||
Base += "RINDROLOCAL <- true";
|
||||
fclose(file);
|
||||
}
|
||||
else {
|
||||
Base += "RINDROLOCAL <- false";
|
||||
}
|
||||
|
||||
HSQUIRRELVM v = *(HSQUIRRELVM*)0x1AF3544;
|
||||
|
||||
wchar_t* filename = DNFTOOL::charTowchar_t((char*)BaseFile.c_str());
|
||||
wchar_t* str = DNFTOOL::charTowchar_t((char*)Base.c_str());
|
||||
|
||||
if (sq_mycompilebuffer(v, str, wcslen(str), filename, false) >= 0) {
|
||||
//本地逻辑 直接读取配置文件来加载nut
|
||||
#ifndef SELL
|
||||
Sq_pushroottable(v);
|
||||
Sq_call(v, 1, SQTrue, SQFalse);
|
||||
Sq_pushstring(v, L"RINDROLOCAL", -1);
|
||||
Sq_pushbool(v, true);
|
||||
sq_newslot(v, -3, SQFalse);
|
||||
Sq_pop(v, 1);
|
||||
}
|
||||
|
||||
delete[]filename;
|
||||
delete[]str;
|
||||
|
||||
#ifndef SELL//本地模式要加在整体脚本
|
||||
#ifndef EXPRESS//本地模式要加在整体脚本
|
||||
Sq_pushroottable(v);
|
||||
Sq_pushstring(v, L"dofile", -1);
|
||||
if (SQ_SUCCEEDED(Sq_get(v, -2))) {
|
||||
Sq_pushroottable(v);
|
||||
Sq_pushstring(v, L"sqr/DofileList.nut", -1);
|
||||
Sq_call(v, 2, SQFalse, SQTrue);
|
||||
}
|
||||
Sq_pop(v, 2);
|
||||
#endif // !SELL
|
||||
#endif // !SELL
|
||||
std::ifstream f("sqr/FileConfig.json");
|
||||
nlohmann::json Jso = nlohmann::json::parse(f);
|
||||
f.close();
|
||||
|
||||
//加载基础脚本
|
||||
for (const auto& elem : Jso["BaseScript"]) {
|
||||
if (elem.is_string()) {
|
||||
std::string line = elem.get<std::string>();
|
||||
|
||||
std::string ContentString = "";
|
||||
std::fstream F;
|
||||
F.open(("sqr/" + line).c_str(), std::ios::in);
|
||||
if (F.is_open()) {
|
||||
std::stringstream ContentStringStream;
|
||||
ContentStringStream << F.rdbuf();
|
||||
ContentString = (ContentStringStream.str());
|
||||
F.close();
|
||||
}
|
||||
|
||||
std::wstring filename = DNFTOOL::charTowchar_t((char*)line.c_str(), line.length());
|
||||
std::wstring str = DNFTOOL::charTowchar_t((char*)ContentString.c_str(), ContentString.length());
|
||||
if (sq_mycompilebuffer(v, str.c_str(), str.length(), filename.c_str(), false) >= 0) {
|
||||
Sq_pushroottable(v);
|
||||
Sq_call(v, 1, SQTrue, SQFalse);
|
||||
Sq_pop(v, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
//加载项目脚本
|
||||
for (const auto& elem : Jso["ProjectScript"]) {
|
||||
if (!Jso.contains("Enabled") || Jso["ProjectScript"] == true) {
|
||||
for (const auto& path : elem["Script"]) {
|
||||
if (path.is_string()) {
|
||||
std::string line = path.get<std::string>();
|
||||
|
||||
std::string ContentString = "";
|
||||
std::fstream F;
|
||||
F.open(("sqr/" + line).c_str(), std::ios::in);
|
||||
if (F.is_open()) {
|
||||
std::stringstream ContentStringStream;
|
||||
ContentStringStream << F.rdbuf();
|
||||
ContentString = (ContentStringStream.str());
|
||||
F.close();
|
||||
}
|
||||
|
||||
std::wstring filename = DNFTOOL::charTowchar_t((char*)line.c_str(), line.length());
|
||||
std::wstring str = DNFTOOL::charTowchar_t((char*)ContentString.c_str(), ContentString.length());
|
||||
if (sq_mycompilebuffer(v, str.c_str(), str.length(), filename.c_str(), false) >= 0) {
|
||||
Sq_pushroottable(v);
|
||||
Sq_call(v, 1, SQTrue, SQFalse);
|
||||
Sq_pop(v, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cout << "weiqiyong" << std::endl;
|
||||
}
|
||||
}
|
||||
#endif // !SELL
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1229,10 +1268,6 @@ void _fastcall H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4, int a5
|
||||
delete[]clone;
|
||||
|
||||
|
||||
if (GameStr.find("将帐号金库中的物品存入金库中") != std::string::npos) {
|
||||
std::cout << GameStr << std::endl;
|
||||
}
|
||||
|
||||
return DrawCodeF(thisc, Seat, a3, a4, a5, a6);
|
||||
}
|
||||
|
||||
@@ -1930,24 +1965,26 @@ int __fastcall New43A1B0(DWORD thisc, DWORD Seat, int Xpos, int Ypos) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 原函数指针类型定义
|
||||
typedef DWORD*(__stdcall _744CB0)(DWORD thisc, DWORD Address, DWORD S);
|
||||
static _744CB0* Old744CB0;
|
||||
DWORD* __stdcall New744CB0(DWORD Idx, DWORD Address, DWORD S) {
|
||||
|
||||
if (Idx == 370) {
|
||||
std::cout << std::hex << Address << std::endl;
|
||||
}
|
||||
//std::cout << "regist: " << *(int*)Idx << std::endl;
|
||||
return Old744CB0(Idx, Address, S);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RegisterHook() {
|
||||
|
||||
#ifdef EXPRESS
|
||||
InitGameFlag = true;
|
||||
MH_Initialize();
|
||||
|
||||
//Hook收包
|
||||
MH_CreateHook((void*)0x721EA0, &H_Register_Pack, reinterpret_cast<void**>(&Lpfn_Init));
|
||||
MH_EnableHook((void*)0x721EA0);
|
||||
|
||||
//HookNut函数注册
|
||||
MH_CreateHook((void*)0x67B910, &H_Register_Nut, reinterpret_cast<void**>(&Register_Nut_Old));
|
||||
MH_EnableHook((void*)0x67B910);
|
||||
|
||||
return;
|
||||
#endif // EXPRESS
|
||||
|
||||
//InlineHook///
|
||||
//InlineHook//
|
||||
|
||||
//玩家菜单选项HOOK 有回调
|
||||
inlinehook SSS(0x001004B52, (int)&PlayerEach2);
|
||||
@@ -1970,6 +2007,10 @@ void RegisterHook() {
|
||||
inlinehook MonsetrRaceHook(0x43A862, (int)&MonsetrRace_Hook);
|
||||
MonsetrRaceHook.Motify_address();
|
||||
|
||||
//血槽背景层Hook (图标绘制也在这里)
|
||||
inlinehook HudBloodBackgroundHook(0x04CA035, (int)&HudBloodBackground);
|
||||
HudBloodBackgroundHook.Motify_address();
|
||||
|
||||
////读取StringBin文件
|
||||
//inlinehook ReadStringBinHookA(0x119F2F8, (int)&ReadStringBin_HookA);
|
||||
//ReadStringBinHookA.Motify_address();
|
||||
@@ -1977,15 +2018,27 @@ void RegisterHook() {
|
||||
//ReadStringBinHookB.Motify_address();
|
||||
|
||||
|
||||
|
||||
//Fundction Hook//
|
||||
MH_Initialize();
|
||||
|
||||
|
||||
//FILE* mengyiqufile = fopen("mengyiqukey.dll", "rb");
|
||||
//if (!mengyiqufile)
|
||||
//{
|
||||
// MH_CreateHook(&connect, &HookedConnect, reinterpret_cast<LPVOID*>(&pOriginalConnect));
|
||||
// MH_EnableHook(&connect);
|
||||
//}
|
||||
//else fclose(mengyiqufile);
|
||||
//MH_CreateHook(&sendto, &HookedSendTo, reinterpret_cast<LPVOID*>(&originalSendTo));
|
||||
//MH_EnableHook(&sendto);
|
||||
|
||||
//关闭原版商城
|
||||
//MH_CreateHook((void*)0x4294A0, &New4294A0, reinterpret_cast<void**>(&Old4294A0));
|
||||
//MH_EnableHook((void*)0x4294A0);
|
||||
|
||||
// hook注册包
|
||||
//MH_CreateHook((void*)0x744CB0, &New744CB0, reinterpret_cast<void**>(&Old744CB0));
|
||||
//MH_EnableHook((void*)0x744CB0);
|
||||
|
||||
//绘制鼠标
|
||||
MH_CreateHook((void*)0xFFDC60, &NewFFDC60, reinterpret_cast<void**>(&OldFFDC60));
|
||||
@@ -2052,8 +2105,8 @@ void RegisterHook() {
|
||||
|
||||
//Hook发包相关
|
||||
//HOOK发包类型
|
||||
MH_CreateHook((void*)0x1127D60, &NewSendPacksType, reinterpret_cast<void**>(&_OldSendPackType));
|
||||
MH_EnableHook((void*)0x1127D60);
|
||||
//MH_CreateHook((void*)0x1127D60, &NewSendPacksType, reinterpret_cast<void**>(&_OldSendPackType));
|
||||
//MH_EnableHook((void*)0x1127D60);
|
||||
//MH_CreateHook((void*)0x1128550, &NewSendPacksByte, reinterpret_cast<void**>(&_OldSendPackByte));
|
||||
//MH_EnableHook((void*)0x1128550);
|
||||
//MH_CreateHook((void*)0x1128580, &NewSendPacksWord, reinterpret_cast<void**>(&_OldSendPackWord));
|
||||
@@ -2073,10 +2126,6 @@ void RegisterHook() {
|
||||
MH_CreateHook((void*)0x11A8F60, &newsub11A8F60, reinterpret_cast<void**>(&sub11A8F60));
|
||||
MH_EnableHook((void*)0x11A8F60);
|
||||
|
||||
//血槽背景层Hook (图标绘制也在这里)
|
||||
inlinehook HudBloodBackgroundHook(0x04CA035, (int)&HudBloodBackground);
|
||||
HudBloodBackgroundHook.Motify_address();
|
||||
|
||||
//如果加载了百级UI
|
||||
FILE* file = fopen("ImagePacks2/!HUD_Yosin百级UI.NPK", "rb");
|
||||
if (file) {
|
||||
@@ -2154,8 +2203,8 @@ void RegisterHook() {
|
||||
MH_EnableHook((void*)0x43A1B0);
|
||||
|
||||
//他人信息Hook 数值
|
||||
MH_CreateHook((void*)0xFA42D0, &NewFA42D0, reinterpret_cast<void**>(&OldFA42D0));
|
||||
MH_EnableHook((void*)0xFA42D0);
|
||||
//MH_CreateHook((void*)0xFA42D0, &NewFA42D0, reinterpret_cast<void**>(&OldFA42D0));
|
||||
//MH_EnableHook((void*)0xFA42D0);
|
||||
//他人信息Hook 图标
|
||||
//MH_CreateHook((void*)0xFA8230, &NewFA8230, reinterpret_cast<void**>(&OldFA8230));
|
||||
//MH_EnableHook((void*)0xFA8230);
|
||||
|
||||
Reference in New Issue
Block a user