문제

I'm trying to modify a value for Solitaire such as the score.

Anyways I found the addresses (using CheatEngine) that the pointers point to but I'm having difficult injecting code to modify the score. I'm almost certain it's the way I'm adding the offsets to the base value and not Windows DEP, my injecting method, or anything else.

Here's the code I'm using.

#define BASE    0xFFAEAFA8
#define fOFFSET 0x50
#define sOFFSET 0x14
#define VALUE   55555


*(int*)(((*(int*) BASE) + fOFFSET) + sOFFSET) = VALUE;

Whenever I inject this code my game crashes. Works fine if I modify the values in Cheat Engine but not in code.

도움이 되었습니까?

해결책 2

What I was doing wrong: I needed to use the ReadProcessMemory() API to find the address that a pointer points to. And then add the offsets.

다른 팁

try:

volatile int * pScore = (int*)( BASE + fOFFSET + sOFFSET );
*pScore = VALUE;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top