Detecting game state from rendering calls within directx hook

Started by
2 comments, last by Mercurialol 11 years, 4 months ago

Hi,

i'm working on a Smart Directx Hook that should render its things only when game is not in main menu / paused game / with console open, and i'm looking for some way to detect this knowing what directx functions are called.

My first idea was to get a crc from every loaded texture, and knowing what textures are drawed i could know what was the game state.

Only problem is that this method is not reliable: the game i hook ( Fallout : New Vegas / Fallout 3 ) it's a very modded game, and also the loading screens can be changed, and i want to be able to support mods without breaking the game state detection.

Are there other ways to accomplish this?

Google didn't help me

Roby

Advertisement
Hmm. Never did anything like this myself. Depending on the loaded stuff and the version of the application (defining offset in the heap to where the menu-related stuff is kept),
there's bound to be a byte that changes back and forth when you enter/exit the menu.
Try to grab a dump of the memory allocated for the application in and outside the menu several times to find it,
then look into means of accessing this place from your app.

But I've got no idea whether it would work. Just seems less hackish than looking at loaded textures...
Hmm. Never did anything like this myself. Depending on the loaded stuff and the version of the application (defining offset in the heap to where the menu-related stuff is kept),
there's bound to be a byte that changes back and forth when you enter/exit the menu.
Try to grab a dump of the memory allocated for the application in and outside the menu several times to find it,
then look into means of accessing this place from your app.

But I've got no idea whether it would work. Just seems less hackish than looking at loaded textures...

This would be my 2nd idea, but it's not reliable too:

this game has a lot of versions and the user could be using one of these, so i should find the offset for every game version, and if the game gets a new update, this would break the state detection until i find the new offset.

Also the uk, eu and usa version has different offsets too, so for every version i should do the offset find 3 times.

Roby

Just wondering, why don't you solve this on the application level using state pattern?

This topic is closed to new replies.

Advertisement