Commit message

This commit is contained in:
lenheart
2024-05-12 09:07:41 +08:00
parent ccce18df0b
commit 4ec73c5a2a
153 changed files with 944 additions and 31920 deletions

View File

@@ -46,7 +46,8 @@ ADD_LIBRARY(hook_aurora SHARED ${DIR_ASMJIT_LIB_SRCS} ${LIB_SOURCE})
SET_TARGET_PROPERTIES(hook_aurora PROPERTIES OUTPUT_NAME "Aurora")
target_link_libraries(hook_aurora libstdc++.a -L/home/dnf_project/dnf_project/build/lib/squirrel -lsqstdlib_static -L/home/dnf_project/dnf_project/build/lib/squirrel -lsquirrel_static -L/home/dnf_project/dnf_project/build/lib/mysql/lib libmysqlclient.a -lpthread)
target_link_libraries(hook_aurora libstdc++.a -L/home/dnf_project/dnf_project/build/lib/squirrel -lsqstdlib_static -L/home/dnf_project/dnf_project/build/lib/squirrel -lsquirrel_static -L/home/dnf_project/dnf_project/build/lib/mysql/lib libmysqlclient.a -lpthread libffi.a)
# target_link_libraries(hook_aurora /usr/local/lib/libffi.a)
# 指定动态库版本, 视需求而定,可不加
# VERSION:动态库版本SOVERSION:API版本
#SET_TARGET_PROPERTIES(hook_aurora PROPERTIES VERSION 0.1.1 SOVERSION 0)

View File

@@ -296,6 +296,54 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher *a1, CUser *us
}
sq_settop(v, top); // restores the original stack size
}
// 返回选择角色
else if (packet_id == 7)
{
std::lock_guard<std::recursive_mutex> lock(SqMtx);
// 执行虚拟机Main函数
SQInteger top = sq_gettop(v); // saves the stack size before the call
sq_pushroottable(v); // pushes the global table
sq_pushstring(v, _SC("Cb_return_select_character"), -1);
if (SQ_SUCCEEDED(sq_get(v, -2)))
{ // gets the fie123oo' from the global table
sq_pushroottable(v); // push the 'this' (in this case is the global table)
sq_pushuserpointer(v, user);
sq_call(v, 2, SQFalse, SQTrue); // calls the function
}
sq_settop(v, top); // restores the original stack size
}
// 下线
else if (packet_id == 3)
{
std::lock_guard<std::recursive_mutex> lock(SqMtx);
// 执行虚拟机Main函数
SQInteger top = sq_gettop(v); // saves the stack size before the call
sq_pushroottable(v); // pushes the global table
sq_pushstring(v, _SC("Cb_player_exit"), -1);
if (SQ_SUCCEEDED(sq_get(v, -2)))
{ // gets the fie123oo' from the global table
sq_pushroottable(v); // push the 'this' (in this case is the global table)
sq_pushuserpointer(v, user);
sq_call(v, 2, SQFalse, SQTrue); // calls the function
}
sq_settop(v, top); // restores the original stack size
}
// 放弃副本
else if (packet_id == 45)
{
std::lock_guard<std::recursive_mutex> lock(SqMtx);
// 执行虚拟机Main函数
SQInteger top = sq_gettop(v); // saves the stack size before the call
sq_pushroottable(v); // pushes the global table
sq_pushstring(v, _SC("Cb_giveup_dgn"), -1);
if (SQ_SUCCEEDED(sq_get(v, -2)))
{ // gets the fie123oo' from the global table
sq_pushroottable(v); // push the 'this' (in this case is the global table)
sq_pushuserpointer(v, user);
sq_call(v, 2, SQFalse, SQTrue); // calls the function
}
sq_settop(v, top); // restores the original stack size
}
// 自定义包
else if (packet_id == 130)
{

View File

@@ -41,6 +41,8 @@ SUBHOOK_INIT(InterSelectMobileAuthReward, 0x0816132A);
SUBHOOK_INIT(CreateSkill, 0x084024E6);
SUBHOOK_INIT(CreateEquip, 0x084023AC);
SUBHOOK_INIT(History_Log, 0x854F990);
SUBHOOK_INIT(UseGlod, 0x84FF54C);
SUBHOOK_INIT(BossDieCheckSend, 0x81CDA62);
//_setCharacInfoDetail
@@ -359,7 +361,7 @@ int _addServerHackCnt(void *pCHackAnalyzer, void *pCUserCharacInfo, int HackType
int _put_header(void *pInterfacePacketBuf, int Type, int Cmd)
{
printf("Send() cmd:%d\n", Cmd);
return put_header(pInterfacePacketBuf, Type, Cmd);
}
@@ -555,6 +557,11 @@ int _LenGetTimerMess(void *TimerQueue, void *TimerEntry)
// std::cout << &response;
// }
int _UseGlod(void *CUser, int a1, int a3, int a4)
{
return UseGlod(CUser, a1, a3, a4);
}
void PrintAuroraTag()
{
printf("\n");
@@ -674,6 +681,24 @@ int _History_Log(int a1, char *format, ...)
return result;
}
// BOSS死亡HOOK
void _BossDieCheckSend(void *a1, void *a2, void *a3)
{
std::lock_guard<std::recursive_mutex> lock(SqMtx);
// 执行虚拟机Main函数
SQInteger top = sq_gettop(v); // saves the stack size before the call
sq_pushroottable(v); // pushes the global table
sq_pushstring(v, _SC("Cb_BossDie"), -1);
if (SQ_SUCCEEDED(sq_get(v, -2)))
{ // gets the field 'foo' from the global table
sq_pushroottable(v); // push the 'this' (in this case is the global table)
sq_pushuserpointer(v, a2);
sq_call(v, 2, SQFalse, SQTrue); // calls the function
}
sq_settop(v, top); // restores the original stack size
BossDieCheckSend(a1, a2, a3);
}
void Lenheart()
{
@@ -750,6 +775,10 @@ void Lenheart()
// SUBHOOK_SETUP(CreateSkill);
// 创建角色创建装备
SUBHOOK_SETUP(CreateEquip);
// 使用金币
// SUBHOOK_SETUP(UseGlod);
// BOSS死亡
SUBHOOK_SETUP(BossDieCheckSend);
// SUBHOOK_SETUP(doDispatch); // 收包注册

View File

@@ -95,4 +95,9 @@ typedef int (*fnInitSkill)(int a1, int a2, int a3);
// 游戏事件
typedef int (*fnHistory_Log)(int a1, char *format, ...);
typedef int (*fnUseGlod)(void *CUser, int a1, int a3, int a4);
// 通过副本
typedef void (*fnBossDieCheckSend)(void *a1, void *a2, void *a3);
__END_DECLS