| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | //************************************
 | 
					
						
							|  |  |  | // FileName:  D:\VisualStudioSource\dnf_project\src\controller.cpp
 | 
					
						
							|  |  |  | // FullName:  D:\VisualStudioSource\dnf_project\src
 | 
					
						
							|  |  |  | // Date:      2022/09/01
 | 
					
						
							|  |  |  | // By:        Vance
 | 
					
						
							|  |  |  | // Copyright (c) 2022.  Vance All rights reserved
 | 
					
						
							|  |  |  | //************************************
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | #include "controller.h"
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | extern HSQUIRRELVM v; | 
					
						
							|  |  |  | extern std::recursive_mutex SqMtx; | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | Controller::Controller() : assembler(Arch::kX86), | 
					
						
							|  |  |  | 						   Asm(NULL) | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 	Asm = assembler.GetAssembler(); | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Controller::~Controller() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Controller::init() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	CMem::WriteUChar((void *)(base::GlobalData::Init_fix_1 - 0x1), 0); | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 	//.text:085BDE9D 83 F8 0A                                                        cmp     eax, 10
 | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	CMem::WriteUChar((void *)(base::CParty::addDungeonClear_fix_1 + 2), 0x7E); // 普通被击
 | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 	//.text:085BDF30 83 F8 1E                                                        cmp     eax, 30
 | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	CMem::WriteUChar((void *)(base::CParty::addDungeonClear_fix_2 + 2), 0x7E); // 远古被击
 | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 	//.text:085BDFC3 83 F8 32                                                        cmp     eax, 50
 | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	CMem::WriteUChar((void *)(base::CParty::addDungeonClear_fix_3 + 2), 0x7E); // 异界被击
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	CMem::WriteUChar((void *)(0x081C025F + 1), 0x0B); | 
					
						
							|  |  |  | 	CMem::WriteUChar((void *)(0x081C029E + 1), 0x0B); | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	/*	修正使用代币增加积分
 | 
					
						
							|  |  |  | 		地址	长度	原始字节	已修补字节 | 
					
						
							| 
									
										
										
										
											2022-09-09 12:24:02 +08:00
										 |  |  | 		08179043	0x1	97 	B8 | 
					
						
							|  |  |  | 		0817904E	0x1	8C 	AD | 
					
						
							|  |  |  | 	*/ | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	CMem::WriteUChar((void *)(0x08179043), 0xB8); | 
					
						
							|  |  |  | 	CMem::WriteUChar((void *)(0x0817904E), 0xAD); | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	// mov     dword ptr [esp+4], 8E0F448h
 | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 	Asm->lea(eax, dword_ptr(ebp, -0x84)); | 
					
						
							|  |  |  | 	Asm->mov(dword_ptr(esp), eax); | 
					
						
							|  |  |  | 	Asm->mov(eax, int(&hook_importCashShopItemList)); | 
					
						
							|  |  |  | 	Asm->call(eax); | 
					
						
							|  |  |  | 	Asm->mov(dword_ptr(esp, 4), 0x8E0F448); | 
					
						
							|  |  |  | 	Asm->mov(eax, base::importCashShopItemList_hook_end); | 
					
						
							|  |  |  | 	Asm->jmp(eax); | 
					
						
							|  |  |  | 	auto code_importCashShopItemList = assembler.GetBytes(true); | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	void *new_importCashShopItemList_addr = Utils::alloc(code_importCashShopItemList.size()); | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 	CMem::WriteBytes(new_importCashShopItemList_addr, code_importCashShopItemList.data(), code_importCashShopItemList.size()); | 
					
						
							| 
									
										
										
										
											2024-05-24 19:02:09 +08:00
										 |  |  | 	YLOG("code	:%s", Utils::ToHexString((const unsigned char *)code_importCashShopItemList.data(), code_importCashShopItemList.size()).c_str()); | 
					
						
							|  |  |  | 	YLOG("code_addr	:%p", new_importCashShopItemList_addr); | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	CMem::HookJmp(base::importCashShopItemList_hook_begin, (int)new_importCashShopItemList_addr); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/************************************************************************/ | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	/* HOOK 商城购买物品成功处理                                                */ | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 	/************************************************************************/ | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	// mov     dword ptr [ebp-0FCh], 0FFFFFFFFh
 | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	Asm->lea(eax, dword_ptr(ebp, -0xEC)); | 
					
						
							|  |  |  | 	Asm->mov(dword_ptr(esp, 0x10), eax); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Asm->mov(eax, dword_ptr(ebp, -0x3A)); | 
					
						
							|  |  |  | 	Asm->mov(dword_ptr(esp, 0xc), eax); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Asm->mov(eax, dword_ptr(ebp, -0x5C)); | 
					
						
							|  |  |  | 	Asm->mov(dword_ptr(esp, 8), eax); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Asm->mov(eax, dword_ptr(ebp, -0x60)); | 
					
						
							|  |  |  | 	Asm->mov(dword_ptr(esp, 4), eax); | 
					
						
							| 
									
										
										
										
											2022-09-09 12:24:02 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 	Asm->mov(eax, dword_ptr(ebp, 0xC)); | 
					
						
							|  |  |  | 	Asm->mov(dword_ptr(esp), eax); | 
					
						
							| 
									
										
										
										
											2022-09-09 12:24:02 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 	Asm->mov(eax, int(&hook_ProcessIPG_ResultOutput)); | 
					
						
							|  |  |  | 	Asm->call(eax); | 
					
						
							| 
									
										
										
										
											2022-09-09 12:24:02 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 	Asm->mov(dword_ptr(ebp, -0xfc), 0x0FFFFFFFF); | 
					
						
							|  |  |  | 	Asm->mov(eax, base::ItemVendingMachine::ProcessIPG_ResultOutput_hook_end); | 
					
						
							|  |  |  | 	Asm->jmp(eax); | 
					
						
							|  |  |  | 	auto code_ProcessIPG_ResultOutput = assembler.GetBytes(true); | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	void *new_ProcessIPG_ResultOutput_addr = Utils::alloc(code_ProcessIPG_ResultOutput.size()); | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 	CMem::WriteBytes(new_ProcessIPG_ResultOutput_addr, code_ProcessIPG_ResultOutput.data(), code_ProcessIPG_ResultOutput.size()); | 
					
						
							| 
									
										
										
										
											2024-05-24 19:02:09 +08:00
										 |  |  | 	YLOG("code_2	:%s", Utils::ToHexString((const unsigned char *)code_ProcessIPG_ResultOutput.data(), code_ProcessIPG_ResultOutput.size()).c_str()); | 
					
						
							|  |  |  | 	YLOG("code_addr_2	:%p", new_ProcessIPG_ResultOutput_addr); | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	CMem::HookJmp(base::ItemVendingMachine::ProcessIPG_ResultOutput_hook_begin, (int)new_ProcessIPG_ResultOutput_addr); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	// HOOK_SETUP(IPacketDispatcher_ParamBase_dispatch_template);
 | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | 	HOOK_SETUP(UseJewel_dispatch_sig); | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | 	HOOK_SETUP(Dispatcher_ModItemAttr_dispatch_sig); | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | 	HOOK_SETUP(PacketDispatcher_doDispatch); | 
					
						
							| 
									
										
										
										
											2022-09-03 17:30:34 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | 	HOOK_SETUP(DisPatcher_MoveMap_dispatch_sig); | 
					
						
							| 
									
										
										
										
											2022-09-03 17:30:34 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | 	HOOK_SETUP(Inter_LoadEtc_dispatch_sig); | 
					
						
							| 
									
										
										
										
											2022-09-03 17:30:34 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-17 00:49:27 +08:00
										 |  |  | 	HOOK_SETUP(DisPatcher_ReturnToSelectCharacter_dispatch_sig); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-21 16:28:11 +08:00
										 |  |  | 	HOOK_SETUP(Init); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-24 19:02:09 +08:00
										 |  |  | 	YLOG("Controller::init()"); | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | void Controller::Jinit() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	// HOOK_SETUP(LenDispatcher_New_Gmdebug_Command);
 | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | int Controller::hook_IPacketDispatcher_ParamBase_dispatch_template(int a1, int a2, int a3) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	//[root@nimzgryilkxubzo game] # [DNF_PROJECT] Recv() class :1 id : 84 len : 21 callback : 0x81258b6	(nil)0x81258b6	0x8125a06	(nil)(nil)
 | 
					
						
							|  |  |  | 	//	[DNF_PROJECT] + 12	0x8bd8d54 :	Dispatcher_ModItemAttr::dispatch_sig(CUser *,PacketBuf &)
 | 
					
						
							|  |  |  | 	//	[DNF_PROJECT] + 16	0x8bd8d58 :	IPacketDispatcher<MSG_BASE,ParamBase,(ch_state)0>::check_state(CUser *,PacketBuf &)
 | 
					
						
							|  |  |  | 	//	[DNF_PROJECT] + 20	0x8bd8d5c :	Dispatcher_ModItemAttr::read(PacketBuf &,MSG_BASE &)
 | 
					
						
							|  |  |  | 	//	[DNF_PROJECT] + 24	0x8bd8d60 :	Dispatcher_ModItemAttr::process(CUser *,MSG_BASE &,ParamBase &)
 | 
					
						
							|  |  |  | 	//	[DNF_PROJECT] + 28	0x8bd8d64 :	IPacketDispatcher<MSG_BASE,ParamBase,(ch_state)0>::send(CUser *,ParamBase&)
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	//
 | 
					
						
							|  |  |  | 	//
 | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | 	//	[DNF_PROJECT] + 12	0x8bd7dd4 :	Dispatcher_Antibot::dispatch_sig
 | 
					
						
							|  |  |  | 	//	[DNF_PROJECT] + 16	0x8bd7dd8 :	IPacketDispatcher<MSG_BASE,ParamBase,(ch_state)0>::check_state(CUser *,PacketBuf &)
 | 
					
						
							|  |  |  | 	//	[DNF_PROJECT] + 20	0x8bd7ddc :	Dispatcher_Antibot::read(PacketBuf &,MSG_BASE &)
 | 
					
						
							|  |  |  | 	//	[DNF_PROJECT] + 24	0x8bd7de0 :	Dispatcher_Antibot::process(CUser *,MSG_BASE &,ParamBase &)
 | 
					
						
							|  |  |  | 	//	[DNF_PROJECT] + 28	0x8bd7de4 :	IPacketDispatcher<MSG_BASE,ParamBase,(ch_state)0>::send(CUser *,ParamBase&)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-24 19:02:09 +08:00
										 |  |  | 	// YLOG("ParamBase_dispatch_template[ +12	:%p	+16	:%p	+20	:%p	+24	:%p	+28	:%p ]"
 | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | 	//	, *(int*)a1 + 12
 | 
					
						
							|  |  |  | 	//	, *(int*)a1 + 16
 | 
					
						
							|  |  |  | 	//	, *(int*)a1 + 20
 | 
					
						
							|  |  |  | 	//	, *(int*)a1 + 24
 | 
					
						
							|  |  |  | 	//	, *(int*)a1 + 28
 | 
					
						
							|  |  |  | 	//);
 | 
					
						
							|  |  |  | 	Controller::Get()->old_IPacketDispatcher_ParamBase_dispatch_template(a1, a2, a3); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | int Controller::hook_UseJewel_dispatch_sig(void *pDispatcher_UseJewel, CUser *user, PacketBuf *pBuf) | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2022-09-12 13:35:16 +08:00
										 |  |  | 	ENUM_PACK_RET_TYPE ret = CDispatch::Get()->UseJewel_dispatch_sig(pDispatcher_UseJewel, user, pBuf); | 
					
						
							|  |  |  | 	int result = (ret == PAK_ERROR) ? 1 : 0; | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	// 08217C06  分解
 | 
					
						
							| 
									
										
										
										
											2022-09-12 13:35:16 +08:00
										 |  |  | 	return result; | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | int Controller::hook_Dispatcher_ModItemAttr_dispatch_sig(Dispatcher_ModItemAttr *dis_mod, CUser *user, PacketBuf *pBuf) | 
					
						
							| 
									
										
										
										
											2022-09-03 17:30:34 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	PacketBuf new_buf; | 
					
						
							|  |  |  | 	memcpy(&new_buf, pBuf, sizeof(PacketBuf)); | 
					
						
							| 
									
										
										
										
											2022-09-12 13:35:16 +08:00
										 |  |  | 	short equipment_pos = 0; | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | 	int equipment_id = 0; | 
					
						
							|  |  |  | 	short item_pos = 0; | 
					
						
							| 
									
										
										
										
											2022-09-12 13:35:16 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	if ((unsigned __int8)new_buf.get_short(&equipment_pos) != 1 || (unsigned __int8)new_buf.get_int(&equipment_id) != 1 || (unsigned __int8)new_buf.get_short(&item_pos) != 1) | 
					
						
							| 
									
										
										
										
											2022-09-12 13:35:16 +08:00
										 |  |  | 	{ | 
					
						
							|  |  |  | 		user->SendCmdErrorPacket(84, -1); | 
					
						
							|  |  |  | 		return 0; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	CInventory *CurCharacInvenW = user->getCurCharacInvenR(); | 
					
						
							| 
									
										
										
										
											2022-09-03 17:30:34 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	auto item_inven = CurCharacInvenW->GetInvenRef(CInventory::INVENTORY_TYPE_ITEM, item_pos); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (!item_inven->isEmpty() && item_inven->getKey() == ITEM_ID_YIJIRUHUN) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		ENUM_PACK_RET_TYPE ret = CDispatch::Get()->Dispatcher_ModItemAttr_dispatch_sig(dis_mod, user, pBuf); | 
					
						
							|  |  |  | 		int result = (ret == PAK_ERROR) ? 1 : 0; | 
					
						
							|  |  |  | 		return result; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | 	return Get()->old_Dispatcher_ModItemAttr_dispatch_sig(dis_mod, user, pBuf); | 
					
						
							| 
									
										
										
										
											2022-09-03 17:30:34 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher *a1, CUser *user, int packet_class, int packet_id, char *packet_src, int packet_len, int a7, int a8) | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	int (***dispatcher)(int, CUser *, char *) = (int (***)(int, CUser *, char *))a1->get_dispatcher(packet_id); | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | 	if (dispatcher) | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 		// v32 = (**dispatcher)(dispatcher, user, v25);
 | 
					
						
							| 
									
										
										
										
											2024-05-24 19:02:09 +08:00
										 |  |  | 		//  YLOG("Recv()	class:%d	id:%d	len:%d	%p	[ +00 :%p +12 :%p +16 :%p +20 :%p +24 :%p +28 :%p ]"
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 		//  	, packet_class
 | 
					
						
							|  |  |  | 		//  	, packet_id
 | 
					
						
							|  |  |  | 		//  	, packet_len
 | 
					
						
							|  |  |  | 		//  	, (**dispatcher)
 | 
					
						
							|  |  |  | 		//  	, *(int*)dispatcher
 | 
					
						
							|  |  |  | 		//  	, *(int*)dispatcher + 12
 | 
					
						
							|  |  |  | 		//  	, *(int*)dispatcher + 16
 | 
					
						
							|  |  |  | 		//  	, *(int*)dispatcher + 20
 | 
					
						
							|  |  |  | 		//  	, *(int*)dispatcher + 24
 | 
					
						
							|  |  |  | 		//  	, *(int*)dispatcher + 28
 | 
					
						
							|  |  |  | 		//  );
 | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-24 19:02:09 +08:00
										 |  |  | 	// YLOG("Recv()	class:%d	id:%d	len:%d packet_data :%s ", packet_class, packet_id, packet_len, Utils::ToHexString((const unsigned char *)packet_src, packet_len).c_str());
 | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-03 17:30:34 +08:00
										 |  |  | 	if (packet_id == PACKET_ID_ITEM_USE_EQUIPMENT_MOVEITEM) | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2022-09-02 23:34:06 +08:00
										 |  |  | 		int result = 0; | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 		PacketBuf *v25 = PacketBuf::NewPacketBuf(); | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | 		user->setLastPacketID(packet_id); | 
					
						
							|  |  |  | 		v25->bind_packet(packet_src, packet_len); | 
					
						
							| 
									
										
										
										
											2024-05-24 19:02:09 +08:00
										 |  |  | 		YLOG("Recv()	class:%d	id:%d	len:%d packet_data :%s ", packet_class, packet_id, packet_len, Utils::ToHexString((const unsigned char *)packet_src, packet_len).c_str()); | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-02 23:34:06 +08:00
										 |  |  | 		if (v25) | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			ENUM_PACK_RET_TYPE ret = CDispatch::Get()->UseEquipmentMoveItem(user, v25); | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-02 23:34:06 +08:00
										 |  |  | 			result = (ret == PAK_ERROR) ? 1 : 0; | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-02 23:34:06 +08:00
										 |  |  | 			PacketBuf::DelPacketBuf(v25); | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2022-09-02 01:27:05 +08:00
										 |  |  | 		return result; | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	// 区域移动
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	else if (packet_id == 38) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		std::lock_guard<std::recursive_mutex> lock(SqMtx); | 
					
						
							|  |  |  | 		SQBool R; | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 		// 执行虚拟机Main函数
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 		SQInteger top = sq_gettop(v); // saves the stack size before the call
 | 
					
						
							|  |  |  | 		sq_pushroottable(v);		  // pushes the global table
 | 
					
						
							|  |  |  | 		sq_pushstring(v, _SC("Cb_move_area"), -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_pushinteger(v, int(*(unsigned char *)(packet_src + 0x0D))); | 
					
						
							|  |  |  | 			sq_pushinteger(v, int(*(unsigned char *)(packet_src + 0x0E))); | 
					
						
							|  |  |  | 			sq_call(v, 4, SQTrue, SQTrue); // calls the function
 | 
					
						
							|  |  |  | 			sq_getbool(v, -1, &R); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		sq_settop(v, top); // restores the original stack size
 | 
					
						
							|  |  |  | 		if (!R) | 
					
						
							|  |  |  | 			return 0; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	// 普通输入
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	else if (packet_id == 17) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		std::string str = Utils::PackToHexString((const unsigned char *)packet_src, 20); | 
					
						
							|  |  |  | 		std::lock_guard<std::recursive_mutex> lock(SqMtx); | 
					
						
							|  |  |  | 		SQBool R; | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 		// 执行虚拟机Main函数
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 		SQInteger top = sq_gettop(v); // saves the stack size before the call
 | 
					
						
							|  |  |  | 		sq_pushroottable(v);		  // pushes the global table
 | 
					
						
							|  |  |  | 		sq_pushstring(v, _SC("Cb_base_input"), -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_pushstring(v, _SC(str.c_str()), -1); | 
					
						
							|  |  |  | 			sq_call(v, 3, SQTrue, SQTrue); // calls the function
 | 
					
						
							|  |  |  | 			sq_getbool(v, -1, &R); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		sq_settop(v, top); // restores the original stack size
 | 
					
						
							|  |  |  | 		if (!R) | 
					
						
							|  |  |  | 			return 0; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	// GM输入
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	else if (packet_id == 179) | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 		// std::cout << "传入的: " << std::hex << (int)user << std::endl;
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 		std::string str = Utils::PackToHexString((const unsigned char *)packet_src, 13); | 
					
						
							|  |  |  | 		str = str.substr(2); | 
					
						
							|  |  |  | 		std::lock_guard<std::recursive_mutex> lock(SqMtx); | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 		// 执行虚拟机Main函数
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 		SQInteger top = sq_gettop(v); // saves the stack size before the call
 | 
					
						
							|  |  |  | 		sq_pushroottable(v);		  // pushes the global table
 | 
					
						
							|  |  |  | 		sq_pushstring(v, _SC("Cb_gm_input"), -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_pushstring(v, _SC(str.c_str()), -1); | 
					
						
							|  |  |  | 			sq_call(v, 3, SQFalse, SQTrue); // calls the function
 | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		sq_settop(v, top); // restores the original stack size
 | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	// 特殊道具使用
 | 
					
						
							|  |  |  | 	else if (packet_id == 255) | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	{ | 
					
						
							|  |  |  | 		std::lock_guard<std::recursive_mutex> lock(SqMtx); | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 		// 执行虚拟机Main函数
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 		SQInteger top = sq_gettop(v); // saves the stack size before the call
 | 
					
						
							|  |  |  | 		sq_pushroottable(v);		  // pushes the global table
 | 
					
						
							|  |  |  | 		sq_pushstring(v, _SC("Cb_use_item_sp"), -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_pushinteger(v, int(*(int *)(packet_src + 0x0D))); | 
					
						
							|  |  |  | 			sq_call(v, 3, SQFalse, SQTrue); // calls the function
 | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		sq_settop(v, top); // restores the original stack size
 | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2024-05-12 09:07:41 +08:00
										 |  |  | 	// 返回选择角色
 | 
					
						
							|  |  |  | 	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
 | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	// 自定义包
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	else if (packet_id == 130) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		std::string str = Utils::PackToHexString((const unsigned char *)packet_src, 13); | 
					
						
							|  |  |  | 		std::lock_guard<std::recursive_mutex> lock(SqMtx); | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 		// 执行虚拟机Main函数
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 		SQInteger top = sq_gettop(v); // saves the stack size before the call
 | 
					
						
							|  |  |  | 		sq_pushroottable(v);		  // pushes the global table
 | 
					
						
							|  |  |  | 		sq_pushstring(v, _SC("OnClientSocketMsg"), -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_pushstring(v, _SC(str.c_str()), -1); | 
					
						
							|  |  |  | 			sq_call(v, 3, SQFalse, SQTrue); // calls the function
 | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		sq_settop(v, top); // restores the original stack size
 | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | 	return Get()->old_PacketDispatcher_doDispatch(a1, user, packet_class, packet_id, packet_src, packet_len, a7, a8); | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | int Controller::hook_LenDispatcher_New_Gmdebug_Command(void *Command, void *CUser, void *PacketBuf) | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	void *Pck = (void *)((*(int *)(PacketBuf + 20)) + 13); | 
					
						
							|  |  |  | 	int msg_len = *(int *)(Pck); | 
					
						
							|  |  |  | 	std::string msg((char *)(Pck + 4), msg_len); | 
					
						
							|  |  |  | 	msg = msg.substr(2); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	std::lock_guard<std::recursive_mutex> lock(SqMtx); | 
					
						
							| 
									
										
										
										
											2024-04-30 03:01:48 +08:00
										 |  |  | 	// 执行虚拟机Main函数
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 	SQInteger top = sq_gettop(v); // saves the stack size before the call
 | 
					
						
							|  |  |  | 	sq_pushroottable(v);		  // pushes the global table
 | 
					
						
							|  |  |  | 	sq_pushstring(v, _SC("Cb_gm_input"), -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, Command); | 
					
						
							|  |  |  | 		sq_pushuserpointer(v, CUser); | 
					
						
							|  |  |  | 		sq_pushstring(v, _SC(msg.c_str()), -1); | 
					
						
							|  |  |  | 		sq_call(v, 4, SQFalse, SQTrue); // calls the function
 | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	sq_settop(v, top); // restores the original stack size
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	int Ret = Get()->old_LenDispatcher_New_Gmdebug_Command(Command, CUser, PacketBuf); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return Ret; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int Controller::hook_DisPatcher_MoveMap_dispatch_sig(void *a1, CUser *pUser, PacketBuf *pBuf) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	// ENUM_PACK_RET_TYPE ret = CDispatch::Get()->MoveMap_dispatch_sig(a1, pUser, pBuf);
 | 
					
						
							|  |  |  | 	// int result = (ret == PAK_ERROR) ? 1 : 0;
 | 
					
						
							| 
									
										
										
										
											2022-09-21 16:28:11 +08:00
										 |  |  | 	return Get()->old_DisPatcher_MoveMap_dispatch_sig(a1, pUser, pBuf); | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | int Controller::hook_Inter_LoadEtc_dispatch_sig(void *a1, CUser *pUser, char *a3) | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	CDispatch::Get()->Inter_LoadEtc_dispatch_sig(a1, pUser, a3); | 
					
						
							|  |  |  | 	return Get()->old_Inter_LoadEtc_dispatch_sig(a1, pUser, a3); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | int Controller::hook_DisPatcher_ReturnToSelectCharacter_dispatch_sig(void *a1, CUser *pUser, char *a3) | 
					
						
							| 
									
										
										
										
											2022-09-12 18:11:08 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	CDispatch::Get()->DisPatcher_ReturnToSelectCharacter_dispatch_sig(a1, pUser, a3); | 
					
						
							|  |  |  | 	return Get()->old_DisPatcher_ReturnToSelectCharacter_dispatch_sig(a1, pUser, a3); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-09-01 16:56:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | void Controller::hook_importCashShopItemList(const std::string *str) | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2022-09-21 16:28:11 +08:00
										 |  |  | 	if (str != NULL) | 
					
						
							|  |  |  | 		CDispatch::Get()->importCashShopItemList(str); | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | void Controller::hook_ProcessIPG_ResultOutput(CUser *user, int Goods_No, int item_id, int Cera_Type, InterfacePacketBuf *pbuf) | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2022-09-17 14:53:51 +08:00
										 |  |  | 	CDispatch::Get()->ProcessIPG_ResultOutput(user, Goods_No, item_id, Cera_Type, pbuf); | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | int Controller::hook_Dispatcher_BuyCeraShopItem_dispatch_sig(void *a1, CUser *pUser, PacketBuf *pBuf) | 
					
						
							| 
									
										
										
										
											2022-09-13 22:47:38 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	return 0; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | bool Controller::hook_Init(int a1, char **a2) | 
					
						
							| 
									
										
										
										
											2022-09-21 16:28:11 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	auto result = Get()->old_Init(a1, a2); | 
					
						
							|  |  |  | 	if (result) | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2024-04-24 10:25:44 +08:00
										 |  |  | 		CDispatch::Get()->Init_done(a1, (const char **)a2); | 
					
						
							| 
									
										
										
										
											2022-09-21 16:28:11 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	return result; | 
					
						
							|  |  |  | } |