How could I know where the variables in a certain opcode come from?
Posted: Tue Jul 05, 2022 2:27 am
I was reading the script for Inf.health(or Godmode whatever) of a certain game.
the principle of Inf.health script for that game was like below:
1. get a value of the variable that saves or manages the health of the player.
2. compare the value with another value of a variable at the address in health subtraction function part.
3. if the values of the variables are the same, make it skip the health subtraction function
4. so the result is that player's health is not subtracted and the monsters' health is normally subtracted.
My question is, how could the writer of that script trace the variables?
The location of the address of player's health information was not near that of the health subtraction function part.
I think he could trace the variables and I wanna know that.
Let's simply say the opcode of health subtraction function was "sub edi,(int)100"
and let's say the edi was saving player's health at the moment.
So I want to know where that edi comes from so that I could know where the player's health is managed.
Is it possible to trace?
And one more thing, if there's some kind of variables like edi,rax,eax or whatever, those variables indicate the same thing? from 000000 to FFFFFFF?
For example, the rax in 0000ABC is the same rax in 512ABC3?
Pre-thanks to all replies!
the principle of Inf.health script for that game was like below:
1. get a value of the variable that saves or manages the health of the player.
2. compare the value with another value of a variable at the address in health subtraction function part.
3. if the values of the variables are the same, make it skip the health subtraction function
4. so the result is that player's health is not subtracted and the monsters' health is normally subtracted.
My question is, how could the writer of that script trace the variables?
The location of the address of player's health information was not near that of the health subtraction function part.
I think he could trace the variables and I wanna know that.
Let's simply say the opcode of health subtraction function was "sub edi,(int)100"
and let's say the edi was saving player's health at the moment.
So I want to know where that edi comes from so that I could know where the player's health is managed.
Is it possible to trace?
And one more thing, if there's some kind of variables like edi,rax,eax or whatever, those variables indicate the same thing? from 000000 to FFFFFFF?
For example, the rax in 0000ABC is the same rax in 512ABC3?
Pre-thanks to all replies!