Why editing stats fail to "stick" and how to prevent this.
This isn't meant to actually give you C&P code or even a download to fix your problems.
This is meant for those who can reverse engineer properly and are actually having trouble figuring out why stats don't save after editing.
Some tips before starting:
- Don't edit your stats. ( You'll see why. You'll also see how you can edit them )
- Don't use Cheat Engine ( Please. PLEASE Do not use Cheat Engine without first modifying the binary. )
Ok let's get started. I'll explain how stats are loaded first off:
- When you start the game, Steam loads all the necessary playing information ( Steam Name, Steam ID etc. ) into the game.
- Next, the game then initializes it's sub-systems.
- After this, it proceeds to connect to the Activision servers.
- The connection to the Activision servers then return information such as:
-> Is the person banned?
-> Message Of The Day shit etc.
What happens next is the main part for loading:
- Various functions in the game are hashed and stored in a hash block by type etc. The functions are pretty complicated to prevent users from understanding them and possibly provide a measure to avoid copying them and forging signatures.
- This also occurs for stats. When your game first retrieves stats, it downloads them from the servers and performs hash verifications on them.
-> If the calculated hash doesn't match the hash stored in the stats itself, it is discarded ( Aka your rank is reset )
- How can you prevent this? Personally, I haven't tried this method but you can attempt to force the validation result to always match by one of two ways:
-> The validation checking code that prevents invalid stats from loaded could simply be removed
-> You can calculate the hash of the updated stats before saving it to the servers.
- This is common across all CoDs:
-> Upon joining a server/starting a match, your stats file is sent to the host. The host itself performs calculations on your stats file to determine if your stats hash matches the one stored in it. ( Same like the above except it's host-sided. ) If the host detects a mismatch, it zeros out your stats file ( Meaning rank reset -> Invalid stats when leaving server )
-> Once a game ends leave a server, the server sends you back a copy of your updated and properly hashed stats file which is then uploaded to Activision.
Well, that should be enough for you to figure out the rest.
P.S. Why doesn't data_validation_allow_drop not work? Because simply disabling the dvar doesn't stop an invalid hash from being calculated.