View previous topic :: View next topic |
Author |
Message |
WalterWilliams How do I cheat?
Reputation: 0
Joined: 17 Jan 2017 Posts: 2
|
Posted: Tue Jan 17, 2017 4:02 pm Post subject: Detect when game switches to and from main menu |
|
|
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
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
|
Posted: Wed Jan 18, 2017 1:24 am Post subject: |
|
|
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 |
|
 |
WalterWilliams How do I cheat?
Reputation: 0
Joined: 17 Jan 2017 Posts: 2
|
Posted: Wed Jan 18, 2017 7:36 pm Post subject: |
|
|
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 |
|
 |
|