Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Reading protected Remory/Process in C# || lua script in C#

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
FranzLander
How do I cheat?
Reputation: 0

Joined: 27 Jan 2016
Posts: 1

PostPosted: Wed Jan 27, 2016 12:14 pm    Post subject: Reading protected Remory/Process in C# || lua script in C# Reply with quote

Hello everybody,

i am trying to read some memory adresses. I was only able to scan them with "Open Process", "Query memory region routines" and "Read/Write Process Memory" enabled in Cheat Engine.

Now that i know the specific offest. I would like to read those adressvalues in C# in my own program.

Code:
Process.EnterDebugMode();

            Process[] arrProcess = Process.GetProcessesByName("OPERATION7");

     
            IntPtr myWinHandle = arrProcess[0].Handle;
     

            int myBaseAddress = arrProcess[0].MainModule.BaseAddress.ToInt32();
            //this line will error with ACCESS_IS_DENIED

            IntPtr myMemHandle = OpenProcess(PROCESS_WM_READ, false, arrProcess[0].Id);
correct


Is there any way to access those adresses and read the value?

Best regards
Franz

(sorry for bad englisch && beeing a newbie)
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Wed Jan 27, 2016 1:45 pm    Post subject: Reply with quote

You do not need to use OpenProcess in C# since you have a fully qualified handle already from the process class.

Be sure that you are starting Visual Studio as an Administrator.
Be sure that you are compiling your code for 32bit if the target process is 32bit and 64bit if the target process is 64bit.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites