Hello all i do not know if this forum is still active but if it is can someone please help me. my code example is bellow
static void Plants_Vs_Zombies(int hex, int off) { try { var PlantsVsZombies = new MemorySharp(ApplicationFinder.FromProcessName("popcapgame1").First()); if (PlantsVsZombies.IsRunning) { var Hex_Main = PlantsVsZombies.Read<IntPtr>(new IntPtr(hex), false); var offsets = new[] { off }; foreach (var offset in offsets) { Hex_Main = PlantsVsZombies[Hex_Main + offset, false].Read<IntPtr>(); // false is here to avoid rebasing Console.WriteLine("Sun: "+Hex_Main); Console.ReadLine(); Console.Clear(); Plants_Vs_Zombies(0x0018FA04, 0x5578); } } else { Console.BackgroundColor = ConsoleColor.Red; Console.WriteLine("Sorry but the Application popcapgame1 can not be found, please run Plants Vs. Zombies to start it!."); Console.ReadLine(); } }
This code works in giving me the value of sun in Plants Vs Zombies but i cant figure out how to edit the sun value using the Static Address and Offset i found using cheat engine what i want the program to do is each time it goes through the loop it adds 100 Sun to the game, i know the address works because it displays the sun in the console but i can not figure out how to edit it.