Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

Reversing and injecting some D3D9 code

$
0
0

Hello !

 

First, thanks for this forum, as I got my answers here very often.

 

I'm trying to make some graphic modifications to an old 2D game, and because the .exe is not easily reverse-engineerable (nor the game data file) I succeeded by creating a d3d9.dll proxy.

 

The modifications were simple so far (removing some elements, adjusting screen size), I've done that by hooking the SetViewport function and the DrawIndexedPrimitiveUP (and checking textures of elements I wanted to remove).

 

Now what I wanted is to rotate some letters elements (drew by a DrawPrimitiveUP call).

I tried SetTransform methods with no luck.

 

Checking when letters are drawn gives this inside PIX:

 

FxAsTD1.jpg

 

I think I read somewhere that using a vertex shader may avoid SetTransform to work ? Is this correct ?

So I thought that I could create a new VertexShader that is the same as the disassembled one (as it is not too complex, I think I can do that) that also adds the rotation, and applying it in a proxy DrawPrimitiveUP method before drawing the letter.

 

Am I going in the right direction ?

How should I override the VertexShader ?

 

I've never done this before (directx programming, custom dll injection), so I'm maybe missing something obvious here.

 

Thanks for any help !

Attached Thumbnails

  • 426117801_237349_14289543893410945211.jpg
  • 426117801_237349_14289543893410945211.jpg

Viewing all articles
Browse latest Browse all 17560

Trending Articles