| View previous topic :: View next topic |
| Author |
Message |
spoofy Cheater
Reputation: 0
Joined: 19 Sep 2015 Posts: 33
|
Posted: Wed Oct 12, 2016 7:06 am Post subject: How to use pointers in assembler ? |
|
|
I've stored the value of a custom address with
mov [combataddress],ebx
The value I'm looking to track via the pointer, is ebx+08
Then later in code, I want to check the value of what was ebx+08
But not sure how to do it ? something like below obv wouldn't work
cmp byte ptr [[combataddress]+08],01
|
|
| Back to top |
|
 |
sbryzl Master Cheater
Reputation: 6
Joined: 25 Jul 2016 Posts: 252
|
Posted: Wed Oct 12, 2016 9:16 am Post subject: |
|
|
Push a register to use then pop it when done, or find a register that will be changed anyway and you can use that without worrying. Then mov [combataddress] to your register to use it.
So if it's eax
mov eax,[combataddress]
cmp byte ptr [eax+8],1
If you just want to change the pointer without keeping the base then you can add 8 to [combataddress] and use it that way.
|
|
| Back to top |
|
 |
spoofy Cheater
Reputation: 0
Joined: 19 Sep 2015 Posts: 33
|
Posted: Fri Oct 14, 2016 8:37 am Post subject: |
|
|
| cheers sbryzi, worked great !
|
|
| Back to top |
|
 |
|