Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have a problem with memory editing in C#.
I need a way to find out the memory value of 'gta-sa' (0x2C0000) in C# as it changes every time the application starts.
Image[^]

Any help would be greatly appreciated :)

What I have tried:

I tried looking on Google but I dont think I'm wording the question correctly.
Posted
Updated 2-Mar-16 5:18am
v3

Your going about it wrong. You open the process as if it was a file and start reading from the beginning of the process, an example of which you can find at Minesweeper, Behind the scenes[^].
 
Share this answer
 
Comments
QuantumDev 2-Mar-16 11:09am    
I use the MemorySharp library to write to memory.
http://binarysharp.com/products/memorysharp/

Any way to do it with MemorySharp?
Dave Kreskowiak 2-Mar-16 11:13am    
I don't know. I've never used that library and don't intend to start now.
I have found a solution.
C#
Process proc = Process.GetProcessesByName("gta-sa").First();
IntPtr startOffset = proc.MainModule.BaseAddress; 
IntPtr endOffset = IntPtr.Add(startOffset ,proc.MainModule.ModuleMemorySize); 


This will find the base address of the process I need.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900