PostHelpC# memory editing (problems with base address ?)

Posts 13 of 3 · Page 1 of 1
C# memory editing (problems with base address ?)
Once again I started making a hack for a game, last time was what, two years ago? And now I can't remember anything which pisses me off so f***ing much coz I've done this before . But yeah, I'm having problems with getting the right address...



("gta-sa.exe"+007FC7D8 -> 0C38DF88)

007FC7D8 is a static offset to get the base address which I can get player's health etc from, so I just need the "gta-sa.exe" module's base address right?

Main()

Code:
        static void Main(string[] args)
        {

            string game = "gta-sa";

            int oHealth = 540;
            Memory memory = new Memory(game);
            Console.WriteLine(memory.getBaseAddress());
            Console.WriteLine((BaseAddress() + 0x7FC7D8).ToString("X"));
            IntPtr Base = GetModuleBaseAddress(game, "gta-sa.exe");
            Console.WriteLine(Base.ToString("X"));

            Console.WriteLine(Base.ToString("X") + " + " + 0x007FC7D8.ToString("X") + " = " + (Base + 0x7FC7D8).ToString("X"));
        }
One of the functions to get base address:

Code:
        static IntPtr BaseAddress()
        {   
            string game = "gta-sa";
            Process[] pList = Process.GetProcesses();         
            foreach (Process process in pList)
            {
                if (process.ProcessName == game)
                {
                    Console.WriteLine(process.ProcessName.ToString() + " : " + process.Id.ToString());
                    //IntPtr hProcess = process.Handle;

                    Console.WriteLine("Base Address from BaseAddress() : " + process.MainModule.BaseAddress.ToString("X2"));
                    IntPtr Base = process.MainModule.BaseAddress;
                    Console.WriteLine("Module name : " + process.MainModule.ModuleName);

                    return Base;
                }   
            }

            return IntPtr.Zero;
        }
And the output is:



The three base addresses are all from different sources, one is my own function, one is from one website I copied it from to compare and the last one is from the memory library.

I checked the module's address from CE and:



I'm guessing something is wrong with my converting? But what
What you're doing is just calculating 0x1090000 + 0x7FC7D8, while you're probably interested in the value that resides on the calculated address. You need to read the value that's in <base address> + 0x7FC7D8. I don't know what library or class you're using but it should be something like

Code:
uint basePointer = ReadMemoryUInt32(Module.BaseAddress + 0x7FC7D8);
@Biesi, apparantly he got helped on another site already. OP forgot to notify us about it.
Posts 13 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?