Getting Memory Dynamic address from pointer

Hello, im making one personal trainer for game, in cheat engine i found correct pointer which point still at correct dynamic value after restart. Problem is, how to use this in C# Visual Studion. When i use dynamic memory which pointer point at after restart, then its works, but when i use pointer not dyn.address, then its not work, getting value 0. Question is how to get for example dynamic value 239FD94C010 from pointer 0x01616728. value 239FD94C4E4 i know how to get, when u make dynamic value + offset.

Thanks for help.

http://prntscr.com/c98fr1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace NMS_Units_Simple_Trainer
{
    class Program
    {
        public static long Base = 0x0151A7A8;
        public static long dBase = 0x239FD94C010;
        public static int Off1 = 0x4D4;


        public static long fBase = Base + Off1;


        static void Main(string[] args)
        {
            VAMemory vam = new VAMemory("NMS");

            long memoryValue = dBase + 0x4d4; //this works, because i use dynamic memory
            //long memoryValue = Base + 0x4d4; //this doesn;t work, this is pointer and i need to get value 'dBase' from 'Base'.

            while (true)
            {
                Console.WriteLine(vam.ReadInt32((IntPtr)memoryValue));
                //Console.WriteLine(vam.WriteInt32((IntPtr)memoryValue, 300000));
                Thread.Sleep(500);
            }
        }
    }
}
Last edited on
0x151A7A8 + 0x1616728] : 0x239FD94C010
The underlined part is a pointer, so you'll have to dereference(read the memory) to get the value.
So
1
2
3
4
long memoryValue = vam.ReadInt32((IntPtr)Base + 0x1616728);
// memoryValue is now 0x239FD94C010
memoryValue = vam.ReadInt32((IntPtr)memoryValue + 0x4D4);
// memoryValue is now 300002 


I believe you'll need to create the program in 64bit to read those 64bit addresses, though I'm not 100% sure.

I would recommend posting on other forums focused on game hacking and trainers, as this forum is just programming in general.
Last edited on
Topic archived. No new replies allowed.