fenix01/cheatengine-library

How to use Pointer

Closed this issue · 7 comments

How to use pointer and offsets from Cheat Engine? I want to change value by it.

Hi A-VORONKIN,

Did you try this API IProcessAddress ? You should pass the address of the pointer and this call will read the value pointed by your pointer.

For instance :
Suppose you have a pointer at address 0x1000.
The memory at 0x1000 is equal to : 0x2000 (it points to another address)

You should pass the value 0x1000 to IProcessList and this API will read the value stored at 0x2000

But how to use offsets with pointer adress? Can you write some example? For now I just use ReadProcessMemory to get adress. But I want to use only cheatengine-library.

Poiner adress: "fifa16.exe"+034DB268
Offsets: 230, 160, 148, b8, 3a4

Here it's an example I made in c#.
But I think, there is a tip with the IProcessAddress api because it doesn't work. I will try to fix it as soon as possible.

        long baseAddress = 0x3BBAAF0000;
        int offset = 0;
        long pointer = baseAddress + offset;
        string ptr = "$" + pointer.ToString("X16");
        string out_;
        lib.iProcessAddress(ptr, TVariableType.vtDword, false, false, 1, out out_);
        MessageBox.Show(out_);

It will be greate if we can add pointer and offsets to cheatengine virtual table like it is in Cheat Engine app.

Yes you're right, I will look at this new feature. But I can't promise when it will be available.
I don't have lot of time to work on the library :s

Hi Voronkin :)

So I did some investigations and I found the solution to the problem. I did a small mistake in the example.
IProcessAddress will get the current value of an address. So, to read the value pointed you need to make a second call to IProcessAddress.

        long baseAddress = 0xCECB6F0000;
        int offset = 0;
        long pointer = baseAddress + offset;
        string ptrAddress = pointer.ToString("X16");
        string ptrValue;
        lib.iProcessAddress(ptrAddress, TVariableType.vtQword, true, false, 1, out ptrValue);

        string pointedValue;
        lib.iProcessAddress(ptrValue, TVariableType.vtDword, false, false, 1, out pointedValue);
        MessageBox.Show(pointedValue);

It's working fine, thanks!