I'm trying to modify a C++ program using ollydb and cheat engine.
For whatever reason I want to remove a memory address and replace it with the number 0 (or anything that ends in the same result).
There are four spots in the code I need to replace with 0.
Here is my problem:
CPU Disasm Before
01411E38 |. 8BD0 MOV EDX,EAX
01411E3A 3315 0020A701 XOR EDX,DWORD PTR DS:[1A72000]
01411E40 |. 8995 B8FCFFFF MOV DWORD PTR SS:[EBP-348],EDX
Changed to:
01411E38 |. 8BD0 MOV EDX,EAX
01411E3A 83F2 00 XOR EDX,00000000
01411E3D 90 NOP
01411E3E 90 NOP
01411E3F 90 NOP
01411E40 |. 8995 B8FCFFFF MOV DWORD PTR SS:[EBP-348],EDX
Upon saving/reloading:
01111E38 . 8BD0 MOV EDX,EAX
01111E3A 83 DB 83
01111E3B F2 DB F2
01111E3C . 00906090 DD 90609000
01111E40 /. 8995 B8FCFFFF MOV DWORD PTR SS:[EBP-348],EDX
So why does changing
XOR EDX,DWORD PTR DS:[1A72000]
to
XOR EDX,0
work when i make the changes, but if I save the exe and reload it, the modified assembly is changed/broken.