HRESULT __stdcall Hooked_DrawIndexedPrimitive( LPDIRECT3DDEVICE9 lpDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount ) { DWORD dwReturnAddress; _asm MOV EAX, [ESP+0x738]; _asm MOV dwReturnAddress, EAX; if( dwReturnAddress != 0x24035E70 ) return pDrawIndexedPrimitive( lpDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount ); ModelRenderInfo_t* pInfo; _asm LEA EAX, [ESP+0x750]; _asm MOV pInfo, EAX; if( pInfo->pModel && pModelInfo->GetModelName( pInfo->pModel ) ) { if( strstr( pModelInfo->GetModelName( pInfo->pModel ), "models/weapons/v_" ) ) { lpDevice->SetTexture( 0, texWeapon ); HRESULT result = pDrawIndexedPrimitive( lpDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount ); lpDevice->SetTexture( 0, NULL ); return result; } } return pDrawIndexedPrimitive( lpDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount ); }
if you got questions, ask (:
Comment