装备显示图标

Hook地址:0x00F363D0	//显示物品界面函数

InstallHookStub((PVOID)0x00F363D0, My_ShowEuipmentInfo);	//对此函数进行Hook


typedef DWORD(WINAPI __pfnShowEuipmentInfo)(DWORD dwObjAddress);	//显示物品界面函数定义
DWORD WINAPI My_ShowEuipmentInfo(DWORD RetAddr, __pfnShowEuipmentInfo pfnOriginal, DWORD dwObjAddress)
{
	DWORD dwResult = pfnOriginal(dwObjAddress);
	DWORD dwBoxAddress = *(DWORD *)(dwObjAddress + 0x44);	//取出显示界面Box地址
	if (!IsBadReadPtr((PVOID)dwBoxAddress, 4)){				//判断Box地址是否合法
		DWORD dwShow = *(DWORD *)(dwBoxAddress + 0x2C);			
		if (dwShow == 0){									
			DWORD dwItemAddress = *(DWORD*)0x01AE45B4;			//获取当前鼠标指向的物品的基地址
			if (!IsBadReadPtr((PVOID)dwItemAddress, 4)){	
				int x = *(DWORD *)(dwObjAddress + 0x14);		
				int y = *(DWORD *)(dwObjAddress + 0x18);
				int width = *(DWORD *)(dwObjAddress + 0x38);
				int boxx = x + width - 35;
				int boxy = y + 3;
				_asm
				{
					mov     ecx, dwItemAddress;
					mov     eax, dword ptr[ecx];
					mov     edx, dword ptr[eax + 0xC];
					push	1;
					push	1;
					push	0;
					push	boxy;
					push	boxx;
					call	edx;
				}
			}
		}
	}

	return dwResult;
}

 

© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容