 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
deama1234 Master Cheater
Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Wed Feb 18, 2015 6:25 pm Post subject: How to transfer value to script? |
|
|
So, I hope the image explains things, cause I donno how to explain it...[/img]
Basically, how do I make it so that whenever I change the value it uses it in the "sub" opcode? So I don't have to keep going to the script and changing it, or when the value changes by-itself it updates it in the script. |
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Wed Feb 18, 2015 8:10 pm Post subject: |
|
|
Not sure if this is the best way but this should work.
Add this script
| Code: | [Enable]
alloc(Cave,128)
registersymbol(Cave)
Cave+8:
mov [Cave+4],ecx
mov ecx,[Cave]//<- Value of Cave
sub [ebx+00000480],ecx
mov ecx,[Cave+4]
jmp Tutorial-i386.exe+25001
Tutorial-i386.exe+24FFB:
jmp Cave+8
db 90
[Disable]
Tutorial-i386.exe+24FFB:
sub [ebx+00000480],eax
unregistersymbol(Cave)
dealloc(Cave) |
Now manually add an address and call if Cave
Whatever value you change the address, the instruction will sub that.
If you change this line in the script
to something like
| Code: | | mov ecx,[Whatever Address You Want] |
The value of that address will be subbed. _________________
|
|
| Back to top |
|
 |
deama1234 Master Cheater
Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Thu Feb 19, 2015 11:24 am Post subject: |
|
|
| Pingo wrote: | Not sure if this is the best way but this should work.
Add this script
| Code: | [Enable]
alloc(Cave,128)
registersymbol(Cave)
Cave+8:
mov [Cave+4],ecx
mov ecx,[Cave]//<- Value of Cave
sub [ebx+00000480],ecx
mov ecx,[Cave+4]
jmp Tutorial-i386.exe+25001
Tutorial-i386.exe+24FFB:
jmp Cave+8
db 90
[Disable]
Tutorial-i386.exe+24FFB:
sub [ebx+00000480],eax
unregistersymbol(Cave)
dealloc(Cave) |
Now manually add an address and call if Cave
Whatever value you change the address, the instruction will sub that.
If you change this line in the script
to something like
| Code: | | mov ecx,[Whatever Address You Want] |
The value of that address will be subbed. |
Isn't there a simpler way? I just want a value from the cheat table to be used in my script. |
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Feb 19, 2015 2:05 pm Post subject: |
|
|
His code is relatively simple. A few things I would've done differently, but that's the beauty of programming. There is no one right answer!
I'll start with CE's generated code to try to help you see what's going on.
| Code: | [ENABLE]
// create a custom variable
alloc(myvar,4)
registersymbol(myvar)
myvar: // initialize it to zero
db 00 00 00 00
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
newmem:
originalcode:
push ecx // save the value incase it is needed later
mov ecx,[myvar] // get our custom variable
sub [ebx+00000480],ecx // subtract our value from the address
pop ecx // restore the value we previously pushed
exit:
jmp returnhere
Tutorial-i386.exe+24FFB:
jmp newmem
nop
returnhere:
[DISABLE]
unregistersymbol(myvar)
dealloc(myvar)
// other generated code |
Then create a custom variable in the table as he said and set the address to myvar. |
|
| Back to top |
|
 |
deama1234 Master Cheater
Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Thu Feb 19, 2015 3:24 pm Post subject: |
|
|
| Zanzer wrote: | His code is relatively simple. A few things I would've done differently, but that's the beauty of programming. There is no one right answer!
I'll start with CE's generated code to try to help you see what's going on.
| Code: | [ENABLE]
// create a custom variable
alloc(myvar,4)
registersymbol(myvar)
myvar: // initialize it to zero
db 00 00 00 00
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
newmem:
originalcode:
push ecx // save the value incase it is needed later
mov ecx,[myvar] // get our custom variable
sub [ebx+00000480],ecx // subtract our value from the address
pop ecx // restore the value we previously pushed
exit:
jmp returnhere
Tutorial-i386.exe+24FFB:
jmp newmem
nop
returnhere:
[DISABLE]
unregistersymbol(myvar)
dealloc(myvar)
// other generated code |
Then create a custom variable in the table as he said and set the address to myvar. |
How do I make "myvar" point to an adress? Like say if I got an adress on my table that has a value of 59, how do I point "myvar" to it?
EDIT: Nvm, I figured it out, thanks for the help guys! |
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Thu Feb 19, 2015 7:10 pm Post subject: |
|
|
@Zanzer
Your way is much better i'd say.
I never really did much ASM coding. _________________
|
|
| 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
|
|