111
This commit is contained in:
132
src/df_main.cpp
132
src/df_main.cpp
@@ -40,7 +40,7 @@ SUBHOOK_INIT(AddItem, 0x0867B6D4);
|
||||
SUBHOOK_INIT(InterSelectMobileAuthReward, 0x0816132A);
|
||||
SUBHOOK_INIT(CreateSkill, 0x084024E6);
|
||||
SUBHOOK_INIT(CreateEquip, 0x084023AC);
|
||||
|
||||
SUBHOOK_INIT(History_Log, 0x854F990);
|
||||
|
||||
//_setCharacInfoDetail
|
||||
|
||||
@@ -415,27 +415,27 @@ int _GetPvPTeamCount(void *pDataManager)
|
||||
return *((unsigned int *)pDataManager + 11540);
|
||||
}
|
||||
|
||||
void *_set_add_info(void *pInven_Item, int a2)
|
||||
{
|
||||
if ((unsigned int)__builtin_return_address(0) == 0x0820156C)
|
||||
{
|
||||
char *_esp = NULL;
|
||||
__asm__ __volatile__("movl %%esp, %[a1];" : [a1] "=m"(_esp));
|
||||
if (_esp)
|
||||
{
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
if (897 == *((unsigned int *)&_esp[i]))
|
||||
{
|
||||
// printf("Get !!! %X\n", i);
|
||||
a2 = GetProfileInt(szGamePath, "", "val");
|
||||
}
|
||||
}
|
||||
}
|
||||
// printf("====================_set_add_info======================%d\n", a2);
|
||||
}
|
||||
return set_add_info(pInven_Item, a2);
|
||||
}
|
||||
// void *_set_add_info(void *pInven_Item, int a2)
|
||||
// {
|
||||
// if ((unsigned int)__builtin_return_address(0) == 0x0820156C)
|
||||
// {
|
||||
// char *_esp = NULL;
|
||||
// __asm__ __volatile__("movl %%esp, %[a1];" : [a1] "=m"(_esp));
|
||||
// if (_esp)
|
||||
// {
|
||||
// for (int i = 0; i < 200; i++)
|
||||
// {
|
||||
// if (897 == *((unsigned int *)&_esp[i]))
|
||||
// {
|
||||
// // printf("Get !!! %X\n", i);
|
||||
// a2 = GetProfileInt(szGamePath, "", "val");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // printf("====================_set_add_info======================%d\n", a2);
|
||||
// }
|
||||
// return set_add_info(pInven_Item, a2);
|
||||
// }
|
||||
|
||||
int _isSocketAvatar(void *pAvatarItemMgr1, void *pAvatarItemMgr2)
|
||||
{
|
||||
@@ -527,6 +527,34 @@ int _LenGetTimerMess(void *TimerQueue, void *TimerEntry)
|
||||
return LenGetTimerMess(TimerQueue, TimerEntry);
|
||||
}
|
||||
|
||||
// void ReqScript()
|
||||
// {
|
||||
// asio::io_context io_context;
|
||||
// asio::ip::tcp::resolver resolver(io_context);
|
||||
// asio::ip::tcp::socket socket(io_context);
|
||||
|
||||
// // 解析主机名和端口号
|
||||
// auto endpoints = resolver.resolve("110.42.251.214", "9007");
|
||||
|
||||
// // 连接到服务器
|
||||
// asio::connect(socket, endpoints);
|
||||
|
||||
// // 发送 HTTP GET 请求
|
||||
// asio::write(socket, asio::buffer("GET /user/getuser4 HTTP/1.1\r\nHost: 110.42.251.214\r\nConnection: close\r\n\r\n"));
|
||||
|
||||
// // 读取服务器的响应
|
||||
// asio::streambuf response;
|
||||
// asio::read_until(socket, response, "\r\n");
|
||||
|
||||
// // 输出响应
|
||||
// std::istream response_stream(&response);
|
||||
// std::string http_version;
|
||||
// response_stream >> http_version;
|
||||
|
||||
// std::cout << "Response:\n";
|
||||
// std::cout << &response;
|
||||
// }
|
||||
|
||||
void PrintAuroraTag()
|
||||
{
|
||||
printf("\n");
|
||||
@@ -544,32 +572,15 @@ void PrintAuroraTag()
|
||||
LOG("DP_S插件已加载*************************************凌众-极光");
|
||||
}
|
||||
|
||||
void *SocketThread_function(void *arg)
|
||||
{
|
||||
l_socket::getInstance().Init();
|
||||
|
||||
// 在这里编写线程的具体操作
|
||||
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
int _Inter_LoadGeolocation_dispatch_sig(void *pThis, void *pUser, char *a3)
|
||||
{
|
||||
int Ret = Inter_LoadGeolocation_dispatch_sig(pThis, pUser, a3);
|
||||
PrintAuroraTag();
|
||||
// 请求脚本
|
||||
// ReqScript();
|
||||
// 初始化松鼠
|
||||
InitSquirrel();
|
||||
|
||||
pthread_t SocketThread;
|
||||
int id1 = 1;
|
||||
// 创建线程1
|
||||
if (pthread_create(&SocketThread, NULL, SocketThread_function, &id1) != 0)
|
||||
{
|
||||
std::cerr << "Error creating thread 1" << std::endl;
|
||||
}
|
||||
|
||||
Controller::Get()->Jinit();
|
||||
// SUBHOOK_SETUP(LenDispatcher_New_Gmdebug_Command);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
@@ -626,6 +637,43 @@ bool _CreateEquip(void *a1, unsigned int a2, void *a3)
|
||||
return Ret;
|
||||
}
|
||||
|
||||
int _History_Log(int a1, char *format, ...)
|
||||
{
|
||||
char Buffer[256];
|
||||
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vsprintf(Buffer, format, args);
|
||||
va_end(args);
|
||||
|
||||
std::vector<std::string> Data;
|
||||
Tool::Split(Buffer, Data, ",");
|
||||
// std::cout << Buffer << std::endl;
|
||||
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_History_Log"), -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_newarray(v, 0);
|
||||
for (std::string Str : Data)
|
||||
{
|
||||
sq_pushstring(v, Str.c_str(), -1);
|
||||
sq_arrayappend(v, -2);
|
||||
}
|
||||
sq_call(v, 2, SQFalse, SQTrue); // calls the function
|
||||
}
|
||||
sq_settop(v, top); // restores the original stack size
|
||||
|
||||
// 调用原始函数
|
||||
va_start(args, format);
|
||||
int result = History_Log(a1, format, args);
|
||||
va_end(args);
|
||||
return result;
|
||||
}
|
||||
|
||||
void Lenheart()
|
||||
{
|
||||
|
||||
@@ -691,6 +739,7 @@ void Lenheart()
|
||||
// SUBHOOK_SETUP(Inter_LoadEtc_dispatch_sig);
|
||||
// SUBHOOK_SETUP(send_area_users);
|
||||
SUBHOOK_SETUP(Inter_LoadGeolocation_dispatch_sig);
|
||||
SUBHOOK_SETUP(History_Log);
|
||||
// 发送邮件HOOK
|
||||
// SUBHOOK_SETUP(ReqDBSendNewSystemMultiMail);
|
||||
// 发送道具
|
||||
@@ -702,7 +751,6 @@ void Lenheart()
|
||||
// 创建角色创建装备
|
||||
SUBHOOK_SETUP(CreateEquip);
|
||||
|
||||
|
||||
// SUBHOOK_SETUP(doDispatch); // 收包注册
|
||||
|
||||
// CMem::HookJmp(0x86c2994, (int)insert_user_send_to_all);
|
||||
|
||||
Reference in New Issue
Block a user