How to detect when a game calls a certain function, such as Save or Load.
Hey guys, I'm looking to re-write Grand Theft Auto: San Andreas's Save/Load system, with an asi that will intercept the calls made by the game when a user want's to Save and Load a game file.
Now, I know how to use Cheat Engine to find the Ammo, heath addresses etc.
But how do I find out if a player is Saving or Loading a game file?
I've already written the code that checks for "gta_sa.exe", since an asi loader will load it with the game.
Any help is extremely appreciated!

Find the functions that are called when saving/loading and hook them.
A common method to find functions like that are to look for common strings that pertain to the function at hand. Such as:
- The name of the save game files.
- The name of the folder the save games are made in.
Another method is tracing back to the function by using API breakpoints. In this case, a file is being edited, so you could try setting breakpoints on:
- CreateFileA
- CreateFileW
Then if those are used in the call to save the file/load the file, you can trace back to the function that invoked the API.