fenix01 / cheatengine-library

Cheat Engine Library is based on CheatEngine a debugger and coding environment particularly aimed at games, but can also be used for other purposes like debugging applications and used in schools for teaching how computers work
259 stars 79 forks source link

How can I give value to registersymbol address? #28

Open sesey opened 2 years ago

sesey commented 2 years ago

Hi, How can I assign value to registersymbol from library? I tried as below but failed. I don't want to do value assignment with script.

Script:

alloc(testad,8)
registersymbol(testad)

C# code:

lib.iAddAddressManually("testad", TVariableType.vtDword);
lib.iSetValue(0,"100",false);
fenix01 commented 2 years ago

Hi sesey,

I'm note sure it is possible to assign a value to a register symbols without using script. But if you need to dynamically assign a value maybe you can forge the script manually in your code. Something like this :

var
myScript: string;
begin
myScript := "
alloc(testad,8)
registersymbol(testad)
mov testad, %d"
myScript := format(myScript,[1]);
end;