Results 1 to 3 of 3
  1. #1
    JustWorkHereLUL's Avatar
    Join Date
    Nov 2017
    Gender
    male
    Posts
    180
    Reputation
    10
    Thanks
    2
    My Mood
    Angry

    Post 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() + " : " + proces*****.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

  2. #2
    Biesi's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    4,993
    Reputation
    374
    Thanks
    8,808
    My Mood
    Twisted
    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);
    Last edited by Biesi; 02-03-2020 at 07:57 AM.

  3. #3
    defaulto's Avatar
    Join Date
    Aug 2017
    Gender
    male
    Posts
    461
    Reputation
    427
    Thanks
    347
    My Mood
    Angelic
    @Biesi, apparantly he got helped on another site already. OP forgot to notify us about it.

    #LOGS
    12-02-2020 ⌨ [MPGH]defaulto got gifted the Premium Membership from [MPGH]Azuki - sponsored by [MPGH]Flengo.
    27-11-2019 ⌨ [MPGH]defaulto captured the GFX Team Base together with [MPGH]Howl & [MPGH]Poonce.
    08-14-2017 ⌨ defaulto joined the game.

Similar Threads

  1. Problem with reship address
    By Saee2 in forum Marketplace Talk
    Replies: 4
    Last Post: 09-02-2018, 11:19 PM
  2. [Help] Writing/Reading data with base address + offset
    By mikewu63 in forum C# Programming
    Replies: 4
    Last Post: 07-29-2018, 01:49 AM
  3. [Help Request] Help with base addresses and pointers.
    By Whalemart in forum Grand Theft Auto 5 (GTA V) Help
    Replies: 2
    Last Post: 06-29-2018, 05:33 PM
  4. Problem searching base address
    By josereveron in forum Suggestions, Requests & General Help
    Replies: 0
    Last Post: 08-24-2017, 02:02 PM
  5. [Help] Basic memory editing problem c++ GTA
    By base187 in forum C++/C Programming
    Replies: 4
    Last Post: 11-24-2013, 09:47 PM