What if the memory has been modified?
Memory, also known as main memory, is the storage space that can be directly addressed by CPU. Memory is the main component of computer, which is relative to external memory. Memory is the main part of computer, it is relative to external memory.
Next, let’s take a look at how to prevent the eight door artifact from modifying data.
1. Let’s talk about how to protect the important data of the application from being modified by multi data association through a demo.
This demo is very simple, with only one textview and one button. Click button, textview plus one.
2. Run the eight door artifact, lock the gold memory address, and change the value to 999. Then click button. In the click method, the code reads the modified gold value from memory and displays it + 1 to textview. Textview displays 1000, and the data is modified successfully.
3. Next, we modify the code and add a variable goldmd5 to store the encrypted gold value. In this way, we use two variables to store the gold value, one encrypted and one unencrypted.
4. Every time the gold value is used, the obtained gold is encrypted with MD5, and then compared with goldmd5. If not, the gold value has been modified. We can judge it as cheating. My treatment for cheating here is to change the gold value to 0 and prompt cheating. If DES algorithm is used to encrypt data, the real gold value can be obtained by decrypting goldmd5.
5. Next, test whether the demo can be modified. Use eight door artifact to change gold to 999.
6. Then click button and the data modification fails.