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 


[C#] Write String into memory + ProcessModule

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

Joined: 19 Jul 2013
Posts: 5

PostPosted: Fri Jul 19, 2013 2:09 pm    Post subject: [C#] Write String into memory + ProcessModule Reply with quote

Hello i'm using memory api from this forum (viewtopic.php?t=530207)

what i found by cheat engine is in attachment

and this is my code and i can't find out what's wrong, could you pls help me out ?

Code:

        Memory myMemory = new Memory();
        Process[] myProcess;
        //string Pointer = "00ACE9E4";
        int[] Offsets = { 0x80, 0x4, 0x0, 0x8, 0x21C};
        public static int base_adress;

                myProcess = Process.GetProcessesByName("name of process");
                myMemory.ReadProcess = myProcess[0];
                myMemory.Open();

                ProcessModuleCollection modules = myProcess[0].Modules;
                foreach (ProcessModule module in modules)
                {
                    if (module.ModuleName == "Game.dll")
                    {
                        base_adress = module.BaseAddress.ToInt32();
                    }
                }

               // int pointerAddress = HexToDec(Pointer);
                int Adress = base_adress + 0x00ACE9E4;   //+ pointerAddress;

                int bytesWritten;
                byte[] valueToWrite = Encoding.ASCII.GetBytes(textBox2.Text);
                string writtenAddress = myMemory.PointerWrite((IntPtr)Adress, valueToWrite, Offsets, out bytesWritten);
                myMemory.CloseHandle();



cheatengine.jpg
 Description:
 Filesize:  96.42 KB
 Viewed:  6277 Time(s)

cheatengine.jpg


Back to top
View user's profile Send private message
johan010
How do I cheat?
Reputation: 0

Joined: 11 Aug 2013
Posts: 1

PostPosted: Sun Aug 11, 2013 5:02 am    Post subject: Reply with quote

change "name of process" to your process.
like hl2.exe without the ".exe"
for example:
Code:
 Process.GetProcessesByName("hl2");
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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