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# help me about "Game.exe"+00EEBB74 and multi poi

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
reavenz
Newbie cheater
Reputation: 0

Joined: 24 Apr 2012
Posts: 11

PostPosted: Sat May 12, 2012 9:35 pm    Post subject: C# help me about "Game.exe"+00EEBB74 and multi poi Reply with quote

Hii Sir Very Happy

i want to make some trainer in C#
but im so frustrating bcause my address Health is
"Game.exe"+00EEBB74 , 0x1936C , 0x42C4

But if i write code like this,
and i freeze the value use timer 1ms interval
thats not effect in my health

i think thats address has been protect
Please help me code unprotect address
Code:
Process[] aProcesses = Process.GetProcessesByName("Laghaim");
if (aProcesses.Length != 0)
{
      oMemory.ReadProcess = aProcesses[0];
   oMemory.Open(); //Open Process

   int iStep2_Address = Addr.ToDec("12EBB74");
   int[] iStep2_Offsets = { 0x1936C, 0x42C4 };
   int bytesWritten;

   int iValue_To_Write = 1000;
   byte[] bValue_To_Write = BitConverter.GetBytes(iValue_To_Write); //Turns 1000 into bytes

   string sWritten_Address = oMemory.PointerWrite((IntPtr)iStep2_Address, //PointerWrite starting with our Step2 Address
                     bValue_To_Write, //The value to write (as bytes)
                     iStep2_Offsets, //Our offsets
                     out bytesWritten); //Stores the # of Written Bytes

   if (bytesWritten == bValue_To_Write.Length) //If writing was successful
      MessageBox.Show("Wrote " + iValue_To_Write.ToString() + " to " + sWritten_Address + "!"); //Notify the user of success
   else
      MessageBox.Show("There was an error writing " + iValue_To_Write.ToString() + " to " + sWritten_Address + "."); //Notify the user of failure

   oMemory.CloseHandle(); //Close Memory Handle
}


Thanks For Helping
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Sun May 13, 2012 6:38 am    Post subject: Reply with quote

First get the process and store it instead of finding it each time.
So at the top of the class or form add this for storage
Needed references
using System;
using System.Globalization;
using System.Diagnostics;
using System.Text.RegularExpressions;

Code:
Process[] Proc;
public bool ProcActive;


Now add this to your timer. It'l keep searching if the process is unactive or closes. It'l stop searching if found.
Code:
        if (!ProcActive)
        {
            Proc = Process.GetProcessesByName(_Name);
            ProcActive = Proc.Length != 0;
        }
        try { ProcActive = !Proc[0].HasExited; }
        catch { ProcActive = false; }


Now for the pointer, remember Game.exe+00EEBB74 + 0x1936C value will be your next base. So reading that value as an address and adding 0x42C4 will be the base after that which happens to be your address. Then you can write your value to that address.

Heres an example using the game base module NOT modules from the collection since that would require different code.
Code:
    public int BasePointer(string Address, int[] Offset)
    {
        int Addy = -1;
        if (ProcActive & Address != string.Empty)
        {
            byte[] buff = new byte[4];
            int Base = 0;
            if (Address.Contains("+"))
                Base = Proc[0].MainModule.BaseAddress.ToInt32() + int.Parse(Address.Split('+')[1], NumberStyles.HexNumber);
            else Base = int.Parse(Address, NumberStyles.HexNumber);
            ReadProcessMemory(Proc[0].Handle, Base, buff, 4, 0);
            Addy = BitConverter.ToInt32(buff, 0);
            for (int i = 0; i < Offset.Length; i++)
            {
                ReadProcessMemory(Proc[0].Handle, Addy + Offset[i], buff, 4, 0);
                Addy = i != (Offset.Length - 1) ? BitConverter.ToInt32(buff, 0) : Addy += Offset[i];
            }
        }
        return Addy;
    }


Using your pointer info, you would use it like
Code:
int _Address = BasePointer("Game.exe+00EEBB74", new int[] { 0x1936C, 0x42C4} );

or
Code:
int _Address = BasePointer("12EBB74", new int[] { 0x1936C, 0x42C4} );


That should return your address, then you can either read or write to it.

_________________
Back to top
View user's profile Send private message
reavenz
Newbie cheater
Reputation: 0

Joined: 24 Apr 2012
Posts: 11

PostPosted: Sun May 13, 2012 1:49 pm    Post subject: Reply with quote

Great !!
thanks for your helping Very Happy
thanks..
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