 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
ogpayne Cheater
Reputation: 0
Joined: 08 Dec 2014 Posts: 45
|
Posted: Thu Aug 20, 2015 9:34 am Post subject: |
|
|
| deama1234 wrote: | So you just wanna multiply it by 2 or 3?
Let's see, since it's a "mov" and not an "add" that makes it more annoying; and you can't find an "add" anywhere nearby it seems; so I guess you can just make a fomular.
| Code: | push eax
mov eax,r15d
sub eax,[rbx+00F8]
add r15d,eax
pop eax
mov [rbx+00F8],r15d
|
This will multiply the result by 2.
Uhh, you know how to create a script template right? |
I do know how to create a script haha, and this works! You are awesome man. I don't mean to be a nuisance but is there any way you could explain to me what exactly is happening in this script? I don't want to just C&P code, I want to be able to create it! Thanks a lot!
|
|
| Back to top |
|
 |
deama1234 Master Cheater
Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Thu Aug 20, 2015 10:55 am Post subject: |
|
|
Well, the tutorial I posted explains the basics (why push eax for example); I'll just tell you in general what it does.
"mov [rbx+00F8],r15d"
In this scenario, "r15d" has the "new" value, pretty much what it supposed to be, and "[rbx+00F8]" has the "old" value, the overall command just copies and pastes "r15d"'s value to "[rbx+00F8]".
All I did was use a fomular to find the difference between the "new" and the "old" value, then add the difference onto the "new" then tell it to execute the code normally.
Think of it as (maths):
| Code: | eax = r15d //eax now is r15d
eax - [rbx+00F8] = eax //subtract [rbx+00F8] from eax and store result in eax
r15d + eax = r15d //add r15d and eax together then store the result in r15d |
So if you have a score of 0, and you do something that increases it to 5, then the fomular finds out that the difference between the two is "5", so it adds it onto the new one again, so you get a score of 10 instead.
|
|
| Back to top |
|
 |
ogpayne Cheater
Reputation: 0
Joined: 08 Dec 2014 Posts: 45
|
Posted: Thu Aug 20, 2015 11:11 am Post subject: |
|
|
| deama1234 wrote: | Well, the tutorial I posted explains the basics (why push eax for example); I'll just tell you in general what it does.
"mov [rbx+00F8],r15d"
In this scenario, "r15d" has the "new" value, pretty much what it supposed to be, and "[rbx+00F8]" has the "old" value, the overall command just copies and pastes "r15d"'s value to "[rbx+00F8]".
All I did was use a fomular to find the difference between the "new" and the "old" value, then add the difference onto the "new" then tell it to execute the code normally.
Think of it as (maths):
| Code: | eax = r15d //eax now is r15d
eax - [rbx+00F8] = eax //subtract [rbx+00F8] from eax and store result in eax
r15d + eax = r15d //add r15d and eax together then store the result in r15d |
So if you have a score of 0, and you do something that increases it to 5, then the fomular finds out that the difference between the two is "5", so it adds it onto the new one again, so you get a score of 10 instead. |
Ohh much more sense, adding it into higher level language terms simplifies it for me. But one thing I don't understand is the push, which I need to go read about more, I'm assuming its pushing new data (eax) from what I read of that other tutorial.. But I don't understand why the pop eax and then the original code at the bottom though.. Also, sorry if I am a nuisance but how could we make this triple the score? I could easily do it in C++, but obviously this is asm and I'm not thinking in asm right now, so I'm not sure how you could make it triple, 4x, or 5x or something like that.. I've been trying different things to make it triple but I can't seem to make it work..
The way I'm trying to make it work is a bad approach for this language I believe, I am thinking, r15d * 3 == (newValue), for example. But I don't know how to approach this.. I need to go view some more tutorials more in depth I believe.
|
|
| Back to top |
|
 |
deama1234 Master Cheater
Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Thu Aug 20, 2015 11:33 am Post subject: |
|
|
Triple huh?
| Code: |
push eax
mov eax,r15d
sub eax,[rbx+00F8]
add r15d,eax
add r15d,eax
pop eax
mov [rbx+00F8],r15d |
You just add in another "add", you got 3x now!
Well, if you wanna go for something like 100x, and you don't wanna copy paste or make your code look "big"; then there's a couple of different ways to do it.
| Code: | push eax
push ecx
push edx // we don't use the edx here, but I think the "mul" opcode uses it
mov eax,r15d
sub eax,[rbx+00F8]
mov ecx,0A //this is the multiplier, in this case it's gonna be 10
mul ecx //this opcode multiplies anything you put with "eax" and stores result in eax
add r15d,eax
pop edx
pop ecx
pop eax
mov [rbx+00F8],r15d |
I don't like doing this anymore (sometimes doesn't work, only works with integers)
I prefer using the FPU stack these days; but I'm not sure if you'll get it, or get confused:
| Code: | push eax
mov eax,r15d
sub eax,[rbx+00F8]
mov [mine],eax
fild [mine]
mov [mine],0A //multiplier
fimul [mine] //multiplication
fistp [mine] //put it back into [mine]
add r15d,[mine]
pop eax
mov [rbx+00F8],r15d |
I'm sure you've noticed something new "[mine]"; well, that's a custom address. Think of it as a "variable"; just like one, you first have to "define" it before using it. If you look at the top you should see something like:
| Code: | [enable]
...
alloc(newmem,2046)
... |
well, after the "alloc", add in:
| Code: | alloc(mine,4) //you create it and assign it the space of "4 bytes"
registersymbol(mine) // you tell cheat engine that it's a "variable" |
then at the end find something like "dealloc(newmem)"; then straight after it type in:
| Code: | dealloc(mine) //you remove it from memory
unregistersymbol(mine) //you tell cheat engine that it isn't a "variable" anymore |
this last part is for when you disable the script.
|
|
| Back to top |
|
 |
ogpayne Cheater
Reputation: 0
Joined: 08 Dec 2014 Posts: 45
|
Posted: Thu Aug 20, 2015 11:41 am Post subject: |
|
|
| deama1234 wrote: | Triple huh?
| Code: |
push eax
mov eax,r15d
sub eax,[rbx+00F8]
add r15d,eax
add r15d,eax
pop eax
mov [rbx+00F8],r15d |
You just add in another "add", you got 3x now!
Well, if you wanna go for something like 100x, and you don't wanna copy paste or make your code look "big"; then there's a couple of different ways to do it.
| Code: | push eax
push ecx
push edx // we don't use the edx here, but I think the "mul" opcode uses it
mov eax,r15d
sub eax,[rbx+00F8]
mov ecx,0A //this is the multiplier, in this case it's gonna be 10
mul ecx //this opcode multiplies anything you put with "eax" and stores result in eax
add r15d,eax
pop edx
pop ecx
pop eax
mov [rbx+00F8],r15d |
I don't like doing this anymore (sometimes doesn't work, only works with integers)
I prefer using the FPU stack these days; but I'm not sure if you'll get it, or get confused:
| Code: | push eax
mov eax,r15d
sub eax,[rbx+00F8]
mov [mine],eax
fild [mine]
mov [mine],0A //multiplier
fimul [mine] //multiplication
fistp [mine] //put it back into [mine]
add r15d,[mine]
pop eax
mov [rbx+00F8],r15d |
I'm sure you've noticed something new "[mine]"; well, that's a custom address. Think of it as a "variable"; just like one, you first have to "define" it before using it. If you look at the top you should see something like:
| Code: | [enable]
...
alloc(newmem,2046)
... |
well, after the "alloc", add in:
| Code: | alloc(mine,4) //you create it and assign it the space of "4 bytes"
registersymbol(mine) // you tell cheat engine that it's a "variable" |
then at the end find something like "dealloc(newmem)"; then straight after it type in:
| Code: | dealloc(mine) //you remove it from memory
unregistersymbol(mine) //you tell cheat engine that it isn't a "variable" anymore |
this last part is for when you disable the script. |
This actually is making it very simple man thanks so much, you're a lot of help.. Would you mind PMing me? I'm too new to the forum to PM you first. Thanks!
|
|
| 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
|
|