This commit is contained in:
lenheart 2024-07-19 13:36:35 +08:00
parent 27e53d431e
commit 1fb87fa181
9 changed files with 14 additions and 11 deletions

2
.vscode/launch.json vendored
View File

@ -9,7 +9,7 @@
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "/home/neople/game/df_game_r", "program": "/home/neople/game/df_game_r",
"args": ["siroco15","start"], "args": ["siroco20","start"],
"stopAtEntry": false, "stopAtEntry": false,
"stopOnException": false, "stopOnException": false,
"cwd": "/home/neople/game/", "cwd": "/home/neople/game/",

View File

@ -162,9 +162,9 @@ public:
std::string Str = StrBuffer; std::string Str = StrBuffer;
delete[] StrBuffer; delete[] StrBuffer;
std::cout << "包大小: " << PackSize << std::endl; // std::cout << "包大小: " << PackSize << std::endl;
std::cout << "包内容: " << Str << std::endl; // std::cout << "包内容: " << Str << std::endl;
std::cout << "收到了第: " << TestCode << "个包" << std::endl; // std::cout << "收到了第: " << TestCode << "个包" << std::endl;
std::lock_guard<std::recursive_mutex> lock(SqMtx); std::lock_guard<std::recursive_mutex> lock(SqMtx);
SQInteger top = sq_gettop(v); // saves the stack size before the call SQInteger top = sq_gettop(v); // saves the stack size before the call

View File

@ -241,7 +241,9 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher *a1, CUser *us
else if (packet_id == 17) else if (packet_id == 17)
{ {
std::string str = Utils::PackToHexString((const unsigned char *)packet_src, 20); std::string str = Utils::PackToHexString((const unsigned char *)packet_src, 20);
std::lock_guard<std::recursive_mutex> lock(SqMtx); str += ("RindroType" + *(int *)(packet_src + 0x0d));
std::lock_guard<std::recursive_mutex>
lock(SqMtx);
SQBool R; SQBool R;
// 执行虚拟机Main函数 // 执行虚拟机Main函数
SQInteger top = sq_gettop(v); // saves the stack size before the call SQInteger top = sq_gettop(v); // saves the stack size before the call
@ -251,7 +253,7 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher *a1, CUser *us
{ // gets the fie123oo' from the global table { // gets the fie123oo' from the global table
sq_pushroottable(v); // push the 'this' (in this case is the global table) sq_pushroottable(v); // push the 'this' (in this case is the global table)
sq_pushuserpointer(v, user); sq_pushuserpointer(v, user);
sq_pushstring(v, _SC(str.c_str()), -1); sq_pushstring(v, _SC((str).c_str()), -1);
sq_call(v, 3, SQTrue, SQTrue); // calls the function sq_call(v, 3, SQTrue, SQTrue); // calls the function
sq_getbool(v, -1, &R); sq_getbool(v, -1, &R);
} }

View File

@ -778,11 +778,11 @@ void Lenheart()
if (!checkGame("df_game_r")) if (!checkGame("df_game_r"))
{ {
int a = 1; // int a = 1;
void *buf = malloc(4); // void *buf = malloc(4);
CMem::WriteBytes(buf, &a, 4); // CMem::WriteBytes(buf, &a, 4);
unsigned int nMaxGrade = 85; // unsigned int nMaxGrade = 100;
bGMMode = 1; // bGMMode = 1;
// max_level = nMaxGrade; // max_level = nMaxGrade;
@ -868,6 +868,7 @@ void Lenheart()
Controller::Get() Controller::Get()
->init(); ->init();
// SUBHOOK_SETUP(isSocketAvatar); // SUBHOOK_SETUP(isSocketAvatar);
// if (nMaxGrade > 70) // if (nMaxGrade > 70)
// { // {
// // 以下需要扩充类大小, 修改偏移 // // 以下需要扩充类大小, 修改偏移