分享简单的降低网络游戏cpu占用率的方法(Share simple ways to reduce CPU usage in online games)

分享简单的降低网络游戏cpu占用率的方法(Share simple ways to reduce CPU usage in online games)

ID:41245319

大小:36.00 KB

页数:11页

时间:2019-08-20

分享简单的降低网络游戏cpu占用率的方法(Share simple ways to reduce CPU usage in online games)_第1页
分享简单的降低网络游戏cpu占用率的方法(Share simple ways to reduce CPU usage in online games)_第2页
分享简单的降低网络游戏cpu占用率的方法(Share simple ways to reduce CPU usage in online games)_第3页
分享简单的降低网络游戏cpu占用率的方法(Share simple ways to reduce CPU usage in online games)_第4页
分享简单的降低网络游戏cpu占用率的方法(Share simple ways to reduce CPU usage in online games)_第5页
资源描述:

《分享简单的降低网络游戏cpu占用率的方法(Share simple ways to reduce CPU usage in online games)》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、分享简单的降低网络游戏cpu占用率的方法(SharesimplewaystoreduceCPUusageinonlinegames)Infact,verysimple.MainlyfortheD3Dgame.Themainidea:HookIDirect3DDevice9::Present,inwhichtoaddthesleepfunction.LetthesystemgetmoreCPUtimesliceTestthegame:JianWangthree(asD3D9)Learnallkindsofplug-inpro

2、ductiontechnology,immediatelytoBaidusearch"devilworkshop",clickonthefirststoptogotheretolearn.Concreteimplementationsteps:Direct3DCreate9togetthe1.HOOKinterfacepointertypeLPDIRECT3D9Direct3Dobject,ithasamemberfunctionIDirect3D9::CreateDevice,so,aslongastheDirect3D

3、objectDirect3Dobjectinterfacepointertofindvirtualfunctiontable,thenaccordingtothevirtualfunctiontableIDirect3D9::CreateDevicememoryaddress,youcanhookthisfunction,soastoobtainthetypeLPDIRECT3DDEVICE9deviceobjectpointer,andthenaccordingtothedeviceobjectdeviceobjectp

4、ointertothevirtualfunctiontable,accordingtothevirtualfunctiontabletofindIDirect3DDevice9:Presentaddressinmemory,theHOOK,withsleepfunction.----------------------------------------------------------------------------------------------------//Runjinreferencecode#incl

5、ude#include#pragmacomment(LIB,"D3D9.lib")#pragmacomment(LIB,"D3Dx9.lib")Void,GameD3D_HOOK();IDirect3D9*_stdcallNew_Direct3DCreate9(UINTSDKVersion);HRESULT,_stdcall,New_CreateDeviceLPDIRECT3D9pDx9,UINTAdapter,D3DDEVTYPEDeviceType,HWNDhFocusWind

6、ow,DWORDBehaviorFlags,D3DPRESENT_PARAMETERS*pPresentsentationParameters,IDirect3DDevice9**pPresentturnedDeviceInterface);HRESULT,_stdcall,New_PresentLPDIRECT3DDEVICE9pDxdevice,CONSTRECT*pSourceRect,CONSTRECT*pDestRect,HWNDhDestWindowOverride,CONSTRGNDATA*pDirtyReg

7、ion);LPDIRECT3D9m_pD3D=NULL;theinterfacepointerofthe//Direct3Dobjectvoid*pdirect3dcreate9=null;//direct3dcreate9函数地址指针void*pcreatedevice=null;/::函数地址指针CreateDevice函数void*ppresent=null;//IDirect3DDevice9::目前函数地址指针在睡眠时间=50;//延时时间字节direct3dcreate_begin[5];//用于保存direc

8、t3dcreate9入口的5字节字节createdevice_begin[5];//用于保存CreateDevice函数::入口的字节字节present_begin[5];//用于保存IDirect3DDevice9::目前入口的5字节无效gamed3d_hook(){//钩direct3dcreate

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。