When the application locks the surface and puts data into it, you can just put your own data in.
Well,I just don't know how to check the bit data if it's the one i want to replace on the surface ,because there is lots of bit data .
I only want to replace some content of the surface,not all content.
how to steal texture from directdraw application?
Quote:Original post by zzz822163There's two steps:
Well,I just don't know how to check the bit data if it's the one i want to replace on the surface ,because there is lots of bit data .
I only want to replace some content of the surface,not all content.
1. Recognise that this is the surface you're interested in
2. Replace the data you need
First, you'll want to save the surface to a BMP file every time it's Unlock()ed, and then you can see what surface you need, and what it looks like after it's been unlocked.
You now know the dimensions and the bit data of the surface you're interested in, so your code can ignore any surfaces that aren't the correct dimensions (At Lock() to save you buffering the data to check in Unlock()).
Then, each time a surface of the correct size is Unlock()ed, you can check the surface bit data to see if it's what you're looking for. You can probably get away with only checking some parts of the surface, I doubt you'll have to check the whole thing.
Once you've identified that this is the surface you want to update, you can update it in your proxy Unlock() function and then call the real DDraw surface Unlock() function.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement