 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
LeglessQuasimodo Newbie cheater
Reputation: 0
Joined: 01 Jun 2015 Posts: 18 Location: Amerika
|
Posted: Mon Aug 31, 2015 6:10 am Post subject: Clarifications needed |
|
|
hello there,slowly learning CE,atm I using MG:GZ as a learning base
1- Question
I have changed my max ammo using 4 bytes which was easy considering the value in game was the same in cheat engine,but this was not true for the ammo clip,a total of 8 ammo was being show 7 in cheat engine,and 7 in-game as being 6 in cheat engine,why is this?
2 - Question
Using someone else table to learn,I was able to learn how to make a no-reloaded script,the problem is only the first part I could understand,the second part was a total nonsense to me,and am additional xmm1 which I don't know where the hell that come from
this is what I gathered
Code: |
newmem:
movss xmm1,[rcx+00000450] //mov xmm1 to max ammo clip
movss [rcx+0000044C],xmm1 //mov current ammo clip to max ammo clip (xmm1)
originalcode:
mov eax,[rcx+0000044C]
|
original code is mov [rcx+0000044C],eax instead of mov eax,[rcx+0000044C],why it was to be changed?
and why movss instead of mov,and xmm1 instead of eax
the table is working,but I don't to use it before I actually understand why the changes,thanks in advance.
|
|
Back to top |
|
 |
Stregum Advanced Cheater
Reputation: 0
Joined: 17 Jun 2014 Posts: 56 Location: We make baguettes there !
|
Posted: Mon Aug 31, 2015 6:39 am Post subject: |
|
|
Hey
1.
It's the developer choice to make the ammo system, the value is shifted by one right ? so an empty magazine would have a value of -1 (probably) instead of zero, that's reasonable, it's the way the game is coded.
2.
I wanna get your attention here:
"mov x,y"
actually means
"x = y" and not "y = x"
x<<y if you prefer
mov and movss are the same kind of instruction, but movss is for floats (floating point value)
xmm1 is a register that can contain some floats or doubles.
So what it does;
Code: |
newmem:
movss xmm1,[rcx+00000450] //Store the max ammo clip into a temporary register (remember, right to left, so xmm1 takes the value of [rcx+450]
movss [rcx+0000044C],xmm1 //Set the current ammo clip to the value stored in xmm1, which is max ammo.
originalcode:
mov eax,[rcx+0000044C]
|
The idea is to do:
Code: |
[PseudoCode]
currentAmmo = maxAmmo
|
But since you can't do memory to memory modification like
Code: |
mov [rcx+00000450],[rcx+0000044C] //WONT WORK !!
|
A intermediate register must be used, and this is where xmm1 comes in, and does a bridge between 2 memory values.
And for your question:
eax is probably your decreased ammo value, it is your current ammo decreased by 1, and the new xmm1 is the max ammo for your brand new filled clip.
_________________
Rhaa Stregum Vitae 
Last edited by Stregum on Mon Aug 31, 2015 8:32 am; edited 1 time in total |
|
Back to top |
|
 |
LeglessQuasimodo Newbie cheater
Reputation: 0
Joined: 01 Jun 2015 Posts: 18 Location: Amerika
|
Posted: Mon Aug 31, 2015 7:50 am Post subject: |
|
|
so reading your answer I have this
Code: |
newmem:
movss xmm0,[rcx+00000450] //store max ammo clip into a temporary register (temp register < max ammo)
movss [rcx+0000044C],xmm0 //set current ammo clip to temporary register (current ammo > temp register/max ammo)
originalcode:
mov eax,[rcx+0000044C] //decrease < current ammo/temporary register(xmm0)
|
is this about right or there is anything off that I need to know/understand?
|
|
Back to top |
|
 |
Stregum Advanced Cheater
Reputation: 0
Joined: 17 Jun 2014 Posts: 56 Location: We make baguettes there !
|
Posted: Mon Aug 31, 2015 8:24 am Post subject: |
|
|
Wrong ! :p (I don't know if it's a typo you've made)
Code: |
movss [rcx+0000044C],xmm0 //set current ammo clip to temporary register (current ammo > temp register/max ammo)
|
Right !
Code: |
movss xmm0,[rcx+00000450] //store max ammo clip into a temporary register (temp register < max ammo)
|
So, what you need to understand is whatever there is on the right or left parameters (x and y in the above example) in mov instructions*, this is always the same way of handling these instructions, from right to left**.
(Do you know what "[rcx+###]" means btw ?)
Code: |
mov x,y // x < y , WHATEVER THE x AND y ARE
|
So, as mentionned, this
Code: |
movss [rcx+0000044C],xmm0 //set current ammo clip to temporary register (current ammo > temp register/max ammo)
|
should be this
Code: |
movss [rcx+0000044C],xmm0 //set current ammo clip to temporary register (current ammo <<<<<<<<<<<< temp register/max ammo)
|
this doesn't changes anything in the code, but you're interpretation is wrong, it's still right to left.
As for this
Code: |
originalcode:
mov eax,[rcx+0000044C]
|
I don't think it is needed, you could try to erase this part (don't forget to erase the label(originalcode) declaration if it works), if it crashes I guess it's probably necessary ^.^
__________________________________
*There are other instructions that does that, such as
Code: |
add x,n (x = x + n) : add eax,3
sub x,n (x = x - n) : sub ecx,4C
|
The list is way longer than that, but it's so you can understand what i mean
**I don't want to confuse you, currently, you're writing in Intel syntax, but there is an other notation called "AT&T", that reverses the order
Code: |
mov %eax,%ebx //eax > ebx
sub $C,%esp // esp = esp - 0xC
|
But you don't have to care neither about the notation nor the $ and % symbols, it's just so you don't blame me if you read that somewhere else ^^
_________________
Rhaa Stregum Vitae  |
|
Back to top |
|
 |
LeglessQuasimodo Newbie cheater
Reputation: 0
Joined: 01 Jun 2015 Posts: 18 Location: Amerika
|
Posted: Mon Aug 31, 2015 8:57 am Post subject: |
|
|
fixed it,thank you.
Code: |
movss xmm0,[rcx+00000450] //store max ammo clip into a temporary register (temp register < max ammo)
movss [rcx+0000044C],xmm0 //set current ammo clip to temporary register (current ammo < temp register/max ammo)
|
but I still need some info on this one,to make sure I get it right.
Code: |
mov eax,[rcx+0000044C] //decrease < current ammo/temporary register(xmm0)
|
[rcx+0000044C] being xmm0,does this mean that eax will now be handled as xmm0 (decrease ammo < xmm0/current/max ammo) ??
|
|
Back to top |
|
 |
Stregum Advanced Cheater
Reputation: 0
Joined: 17 Jun 2014 Posts: 56 Location: We make baguettes there !
|
Posted: Mon Aug 31, 2015 9:11 am Post subject: |
|
|
Quote: |
[rcx+0000044C] being xmm0,does this mean that eax will now be handled as xmm0 (decrease ammo < xmm0/current/max ammo) ??
|
eax = xmm0, yes, if that's what you mean.
That's why I don't think this mov is necessary, but we never know..
_________________
Rhaa Stregum Vitae  |
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Aug 31, 2015 5:49 pm Post subject: |
|
|
Assuming the value is 4-byte and you're using XMM1 for no reason, it sounds like the code you want is.
Code: | mov eax,[rcx+00000450] // move max ammo into EAX
dec eax // decrease by 1, because you said that's how it's stored
mov [rcx+0000044C],eax // move max ammo minus 1 into current ammo |
|
|
Back to top |
|
 |
Stregum Advanced Cheater
Reputation: 0
Joined: 17 Jun 2014 Posts: 56 Location: We make baguettes there !
|
Posted: Thu Sep 03, 2015 3:39 pm Post subject: |
|
|
The xmm1 register didn't make sense to me either, but it was in his code, oddly
_________________
Rhaa Stregum Vitae  |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|