Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Detect when game switches to and from main menu

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
WalterWilliams
How do I cheat?
Reputation: 0

Joined: 17 Jan 2017
Posts: 2

PostPosted: Tue Jan 17, 2017 4:02 pm    Post subject: Detect when game switches to and from main menu Reply with quote

I'm working on an OBS plugin and need to know the current "view" of the game (main menu, ingame, match results, etc). For the purposes of this example, we can just focus on if the user is switching to the main menu or away from the main menu. I'm particularly interested in Dota 2 but if someone would like to use a different game as an example, that works too Smile

Most tutorials I've read / watched are focused on finding specific values which are fairly easy to search for. Since I'm looking for something a bit more nebulous, I've struggled to figure out how to find the relevant function. I tried dbvm but wasn't able to narrow down the list of functions to anything manageable.

Any tips or tutorials that might get me on the right track?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Wed Jan 18, 2017 1:24 am    Post subject: Reply with quote

This is something that comes down to game specifics.

Some games may store an id that holds what 'state' the game is in. Or a menu index of sorts. For example, an MMO I develop things for stores the game state as a single byte value.
    0 = The game was started but nothing is prepared yet.
    1 = The game is at the login screen.
    5 = The game is at a loading screen.
    7 = The game is logged in and playable.


While this works great for this game, it does not mean all games are similar.

Another game I develop for requires checking of a menu pointer and reading a menu sub-name. So the pointer is null if no menu is available.
Then if a menu is open/focused, a menu pointer is set and a sub-name can be read, which looks something like:
menu_login_frame

Using this it is somewhat easy to tell if the player is logged in or not.

Another game I used to develop tools for used a state machine based setup where a list of pointers were held and indexed. For this, there was two ways to determine the current state:
    1. Locate the state indexer and read what pointer is being used currently.
    2. Locate the state pointer and compare to the list to find the index.


With option 2, the states were in a set order everytime the game launched.
Something on the lines of:
    <Logo State>
    <Splash State>
    <Login State>
    <Server Select State>
    <Character Select State>
    <Game Playing State>


These states were guaranteed to be in this order every time, so you could find the current state pointer then go compare it to the list and find its index. Then know what state the game is in based on that index.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
WalterWilliams
How do I cheat?
Reputation: 0

Joined: 17 Jan 2017
Posts: 2

PostPosted: Wed Jan 18, 2017 7:36 pm    Post subject: Reply with quote

Thanks for your reply!

What is your process for figuring this out for a given game? If you want to pick a specific game to walk me through, that would be awesome.

(I'm happy to compensate you for your time)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites