View previous topic :: View next topic |
Author |
Message |
sreeragh2009 Cheater Reputation: 0
Joined: 21 Oct 2014 Posts: 33 Location: UNKNOWN
|
Posted: Sat Nov 22, 2014 1:01 pm Post subject: variables |
|
|
I want to make a variable which can store addresses and values. I want this to solve this problem.
I got a value in this address [eax+???] (??? can be any offset)
I want it to move to this address [eax-???]
From the AA tutorial i knew that we cant move value of one to another. But there was a indirect way given. It used ebx. But if i use ebx in my code it can do undesirable changes in game code. so i want to make a variable like this. short example :-
Code: |
mov variable,[eax+???]
mov [eax-???],variable
|
Hope you understand the problem. Please help and post an example if possible.
_________________
PROFESSIONAL "LEARNER" |
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Nov 22, 2014 1:20 pm Post subject: Re: variables |
|
|
Code: |
push ebx
mov ebx,[eax+???]
mov [eax-???],ebx
pop ebx
|
_________________
|
|
Back to top |
|
|
sreeragh2009 Cheater Reputation: 0
Joined: 21 Oct 2014 Posts: 33 Location: UNKNOWN
|
Posted: Sat Nov 22, 2014 2:09 pm Post subject: |
|
|
so it wont change value of ebx right. Push pop is used to save earlier value right ? . just asking to confirm. i dont want my ebx to change
_________________
PROFESSIONAL "LEARNER" |
|
Back to top |
|
|
zm0d Master Cheater Reputation: 7
Joined: 06 Nov 2013 Posts: 423
|
Posted: Sat Nov 22, 2014 4:09 pm Post subject: |
|
|
Yes, EBX current value gets pushed to the stack and the old value gets restored with POP
|
|
Back to top |
|
|
sreeragh2009 Cheater Reputation: 0
Joined: 21 Oct 2014 Posts: 33 Location: UNKNOWN
|
Posted: Sun Nov 23, 2014 1:46 am Post subject: |
|
|
Thank you for the info. BTW does that mean we cant make variable thingy ?
_________________
PROFESSIONAL "LEARNER" |
|
Back to top |
|
|
|