Jump to content
Returning Members: Password Reset Required ×

Recommended Posts

Posted (edited)

Following my previous D3D9-Base setup, here's an example using it for a simple DIP (DrawIndexedPrimitive) hook.

Wireframe example code targeting pheasants:

typedef HRESULT(WINAPI* tDrawIndexedPrimitive)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
tDrawIndexedPrimitive oDrawIndexedPrimitive = nullptr;

HRESULT APIENTRY hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 device, D3DPRIMITIVETYPE dType, INT baseVertexIndex,
	UINT minVertexIndex, UINT numVertices, UINT startIndex, UINT primCount) 
{
  
  //targeting pheasants models (mainly 6609 clients)
  if (numVertices == 420 && primCount == 544) 
  {
    DWORD dwOldFillMode;
    device->GetRenderState(D3DRS_FILLMODE, &dwOldFillMode);
    device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
    
    //here you could return directly, to make it more noticeable
    oDrawIndexedPrimitive(device, dType, baseVertexIndex, minVertexIndex, numVertices, startIndex, primCount);
    
    device->SetRenderState(D3DRS_FILLMODE, dwOldFillMode);
  }

  return oDrawIndexedPrimitive(device, dType, baseVertexIndex, minVertexIndex, numVertices, startIndex, primCount);
}

 

This example code has only wireframe "effect" for the texture targeted (pheasants), but you can change the colors of the texture too (know as Chams), gather realtime w2s positions, adding effects/shaders, etc. 🧉

 

Some preview of how it could work (chams & w2s from texture):

image.png.6ae5e6808c86e8502154a4ceffb88093.png image.png.ce5c189aa263d942656f63195a06c85e.png

Edited by duki
Posted

Huh! That's cool! I wonder if there's a higher level function that would allow you to target a role by their mesh ID or role ID... and then perform this detour for it. Would be pretty cool being able to apply some special modifier to a specific mob, like blinding someone / something tints them black or something (like they're in magical darkness). What are your current plans for using something like this?

Posted (edited)
On 8/16/2025 at 2:46 PM, Spirited said:

Huh! That's cool! I wonder if there's a higher level function that would allow you to target a role by their mesh ID or role ID... and then perform this detour for it. Would be pretty cool being able to apply some special modifier to a specific mob, like blinding someone / something tints them black or something (like they're in magical darkness). What are your current plans for using something like this?

Yeah, that would be cool thing to do without fully getting into reverse-engineering the game, and it could even be almost "universal" across all DX9 versions of the game. 😛

I tested a few things with this hook, like rotating them or making them bigger by multiplying their matrix.  

goofy ah pheasant rotating with wrong axis xD:

rotating2.gif rotating1.gifchicken.gif.d20212ab9f3097c4313af1c48fad7fdc.gif

Edited by duki
  • 1 month later...
Posted

Hey guys, I added imgui too, but in a better version ❤️ I also made a frame for items and changed the text color for items.

 

I added a new button for Auto-Hunt!

 

I mention that the client version is 5165 !

WhatsApp Image 2025-09-28 at 15.42.39_6912a8be.jpg

WhatsApp Image 2025-09-28 at 15.43.02_29daedb0.jpg

  • 2 weeks later...
Posted
On 8/15/2025 at 3:53 PM, duki said:

Following my previous D3D9-Base setup, here's an example using it for a simple DIP (DrawIndexedPrimitive) hook.

Wireframe example code targeting pheasants:

typedef HRESULT(WINAPI* tDrawIndexedPrimitive)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
tDrawIndexedPrimitive oDrawIndexedPrimitive = nullptr;

HRESULT APIENTRY hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 device, D3DPRIMITIVETYPE dType, INT baseVertexIndex,
	UINT minVertexIndex, UINT numVertices, UINT startIndex, UINT primCount) 
{
  
  //targeting pheasants models (mainly 6609 clients)
  if (numVertices == 420 && primCount == 544) 
  {
    DWORD dwOldFillMode;
    device->GetRenderState(D3DRS_FILLMODE, &dwOldFillMode);
    device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
    
    //here you could return directly, to make it more noticeable
    oDrawIndexedPrimitive(device, dType, baseVertexIndex, minVertexIndex, numVertices, startIndex, primCount);
    
    device->SetRenderState(D3DRS_FILLMODE, dwOldFillMode);
  }

  return oDrawIndexedPrimitive(device, dType, baseVertexIndex, minVertexIndex, numVertices, startIndex, primCount);
}

 

This example code has only wireframe "effect" for the texture targeted (pheasants), but you can change the colors of the texture too (know as Chams), gather realtime w2s positions, adding effects/shaders, etc. 🧉

 

Some preview of how it could work (chams & w2s from texture):

image.png.6ae5e6808c86e8502154a4ceffb88093.png image.png.ce5c189aa263d942656f63195a06c85e.png

I tried to do the same thing in version 5517, but it doesn't seem to have much effect. Is it because the wild chicken's model ID is different?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...