HOOK显卡驱动可用于D3D射击游戏

易语言 2020-06-21 17:12:40

HOOK显卡驱动可用于D3D射击游戏

参数 [1] = hAdapter
参数 [2] = pAdapterData
ret = Hook_Jmp (OldCreateDevice.Pointer, OldCreateDevice.Data, OldCreateDevice.Call, 参数, OldCreateDevice.Subroutine)
pAdapterFuncs = asm_读整数 (ASM_ADD (pAdapterData, 40)) ' 4*10=40
.如果真 (设备_是否初始化 = 0)
pfnSetRenderState = asm_读整数 (pAdapterFuncs) ' 4*0=0
JmpSetRenderState = pfnSetRenderState
pfnDrawIndexedPrimitive = asm_读整数 (ASM_ADD (pAdapterFuncs, 44)) ' 4*11=44
pfnSetStreamSource = asm_读整数 (ASM_ADD (pAdapterFuncs, 204)) ' 4*51=204
.如果真 (OldSetStreamSource.Pointer = 0)
OldSetStreamSource.Pointer = pfnSetStreamSource
OldSetStreamSource.Subroutine = 到整数 (&WarpSetStreamSource)
Hook_NOP_5 (OldSetStreamSource.Pointer, OldSetStreamSource.Subroutine, OldSetStreamSource.Data, OldSetStreamSource.Call)
.如果真结束
.如果真 (OldDrawIndexedPrimitive.Pointer = 0)
OldDrawIndexedPrimitive.Pointer = pfnDrawIndexedPrimitive
OldDrawIndexedPrimitive.Subroutine = 到整数 (&WarpDrawIndexedPrimitive)
Hook_NOP_5 (OldDrawIndexedPrimitive.Pointer, OldDrawIndexedPrimitive.Subroutine, OldDrawIndexedPrimitive.Data, OldDrawIndexedPrimitive.Call)
.如果真结束
设备_是否初始化 = 1