how to steal texture from directdraw application?

Started by
12 comments, last by zzz822163 15 years, 7 months ago
just as GLIntercept steal texture from opengl application. thanks your attention.
Advertisement
Write a proxy ddraw.dll file that intercepts all DirectDraw calls, then passes them off to the real ddraw.dll.
Or hook an application as it starts up.

Nitpick: There's no such thing as a texture in a DirectDraw application, just surfaces. A texture is a collection of surfaces, and only exists in D3D.
Oor just use PrintScr.
thanks Evil Steve .
do as you tell me ,i can capture screen.
but can i get the image resource?
Quote:Original post by zzz822163
thanks Evil Steve .
do as you tell me ,i can capture screen.
but can i get the image resource?
Well, you'll be able to accept all calls to DDraw, so when you get a surface unlock call you can just read the contents of the surface.

However, remember that there's about 5 different DirectDraw versions; you'll need to support all of them if you want your DLL to work for all apps that use DirectDraw.
to Evil Steve
read the contents of the surface after surface unlock call,i can get screen,
but i cannot get the image resource.
i want to get the bitmap the application load.
Quote:Original post by zzz822163
i want to get the bitmap the application load.
Short answer: You can't.
Long answer: How do you know it's a bitmap that the application is loading and not a code-generated resource, or some other file format?
Assuming it is actually an image in a file of some sort, the code will load the file, decompress / decrypt it, then create a DirectDraw surface and copy the bits in. That means that there doesn't have to be a source file for the image.
This sort of code is very low level, and you will have no knowledge of where the image came from. It could come from a local file, over the web or be noise generated from a microphone.

If you're wanting to intercept calls to DirectDraw and work it back to which bitmap the game/application originally loaded the data from you're out of luck.

However, if you're wanting to save the data to a disk so that you can load it up in a graphics program you follow Steve's advice and simply write the data to a file yourself. The bitmap format is easy enough to follow and documented in numerous places online. Try wotsit.org.


hth
Jack

EDIT: Too slow!

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

I am appreciated for your Enthusiastic help .
In fact,i want to replace the picture in the game.
Is this an impossible mission?
Quote:Original post by zzz822163
I am appreciated for your Enthusiastic help .
In fact,i want to replace the picture in the game.
Is this an impossible mission?
If you want to replace it, then you don't need to know where it came from. When the application locks the surface and puts data into it, you can just put your own data in. The application presumably creates the resources in the same order each time it runs, and if it doesn't you can always check the bit data going in to see if it's the one you want to replace.

This topic is closed to new replies.

Advertisement