fenix01/cheatengine-library

C# ISetValue / IGetValue

jurijr opened this issue · 6 comments

Hello, I am having some difficulties figuring out index/id parameter for the ISetValue/IGetValue functions.

I was mostly experimenting with
(0 + zero based result index)
and
(-511 + zero based result index)

Example test usage in Scanner solution :
lib.iSetValue(index, "375", false);

Visual Studio does not catch any exception but app crashes, since it originates in libraries.

Crash report:

Problem signature:
Problem Event Name: APPCRASH
Application Name: Scanner.vshost.exe
Application Version: 14.0.23107.0
Application Timestamp: 559b788a
Fault Module Name: ce-lib64.dll
Fault Module Version: 1.2.0.0
Fault Module Timestamp: 00000000
Exception Code: c0000005
Exception Offset: 0000000000065dea
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1060
Additional Information 1: f97f
Additional Information 2: f97f2be2f101da6d3ae22f6d4820bdcc
Additional Information 3: 1037
Additional Information 4: 10376f909f5019b57f98c6e8b818354c

Hi Jurijr !

Sorry for this late answer I was in holidays and I didn't find the time to answer.
You're probably right it seems to be a bug with the dll. If I remember correctly, the results of the memory scanner are represented in memory with pages of 1024 addresses (from index -511 to index + 512).
I will try to reproduce your bug as soon as possible.
Could you tell me if you did it with a particular process ?

But I can't promise that it will be fix in the next weeks because I'm very busy with my studies. Anyway, I'll do it as soon as possible !

It happend with a certain game, I havent really tested it on different application, but regular CE runs it without any problem do I would assume core library itself shouldnt run into problems.

Initial and second search works and outputs exactly one result as expected. But trying to set it's value would reproduce the problem.
Value type in memory is 32bit integer.

Ok thank you for your feedback :) I will check this bug and come back to you.

Your welcome. Thank you for bothering to check :)

Hi jurijr !
I'm coming back with fresh news and I would like to apologize because I didn't answer correctly to your question.
So, I have figured out where the problem comes from. The index of the IsetValue api should be the index of an item in the virtual cheat table.
To change the value of an address, you should add this address to the virtual cheat table. Then you can use IsetValue with the index equals to 0.

Step 1) Use IaddAddressManually to add an address to the virtual cheat table
Step 2) It's the first call to IaddAddressManually, so the first item is at index 0
Step 3) Call IsetValue with index equals to 0

It should be fine now :) But the library may not crash with an invalid index, so I have to fix this api.

Thank you very much, it works great now.