i have this pointer
offset7: fc8
offset6: c
offset5: 10
offset4: 0
offset3: 5c
offset2: 20
offset1: 24
"GameAssembly.dll"+01ADFC7C
question is how can i use/compare it in asm table?
Re: how can i compare pointer in asm?
Posted: Sat Jan 02, 2021 8:02 am
by Marc
You'll have to follow the pointers manually. Instead of writing a wall of text here (which would only give you a worse explanation, I'm sure), I'd recommend watching the tutorial video from "Cheat The Game":
You'll have to follow the pointers manually. Instead of writing a wall of text here (which would only give you a worse explanation, I'm sure), I'd recommend watching the tutorial video from "Cheat The Game":
then your current address will be called as symbol and you can directly link to it
Re: how can i compare pointer in asm?
Posted: Fri Jan 22, 2021 10:24 pm
by jgoemat
If you use the symbol the address is calculated when you enable the script. If one of the pointers changes like if this is a pointer for the ship you're in and you get in another ship, that object could get destroyed and you could corrupt the game memory or have an access violation. You could use code to go through the pointers. If you check for null (0) at each step that is usually sufficient:
push eax
mov eax,["GameAssembly.dll"+01ADFC7C]
test eax,eax
jz @f // jumps forward to the next '@@:' label
mov eax,[eax+24]
test eax,eax
jz @f
mov eax,[eax+20]
test eax,eax
jz @f
mov eax,[eax+5c]
test eax,eax
jz @f
mov eax,[eax]
test eax,eax
jz @f
mov eax,[eax+10]
test eax,eax
jz @f
mov eax,[eax+c]
test eax,eax
jz @f
// now eax has the last pointer, I assume the value you want to use is at [eax+fc8]
// say we want to change the value to 1,000
mov [eax+fc8],#1000
@@:
pop eax
Of course it would be better to hook the code that actually uses the value at this address and do something with it there... You mention comparing the pointer. I'll assume the value is a pointer to the current ship you're in let's say, and you have a function that does damage to ships so you want to make it so it does 0 damage to YOUR ship by comparing the ship pointer to this value. The normal way to do this would be to have two scripts. One hooks the code that you know accesses the player's ship and no other and saves that value to an address in memory and registers a symbol for it (pseudo-code here):
Then when you have code that does damage to a ship, you can compare that pointer with the ship pointer (esi here) and skip the instruction that subtracts the damage if it matches: