 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Misteraaargh Newbie cheater
Reputation: 0
Joined: 20 Dec 2012 Posts: 14
|
Posted: Sun Apr 07, 2013 10:36 pm Post subject: [Q] Reading an address and writing its value to another (?) |
|
|
( I just realized I may have posted this post earlier in the wrong section. I am posting it here now. I request the moderators to please delete the other one or this one, whichever is at the wrong place. Sorry for the inconvenience)
Hi,
I have two memory addresses of a game ( Permanent pointers to both). What I want to do is to be able to make a script or something that -
1. Reads from address A
2. Does a simple arithmetic operation on the value A
3. Overwrites the value at address B with the result of arithmetic operation.
The idea is to be able to tie A and B together. 'something' read constantly from address A ( + arithematic on A) and keeps writing the value to address B. In case you should know it, A is the location of an object, and B is one of the pre-provided sliders relating to game-physics.
I have no prior programming experience, apart from writing hello world in at least ten languages . I have basically two questions and would like them to be answered separately.
A) Is there any easy way to achieve this in cheat engine itself?
B) Are there certain languages that are more suited to memory manipulation than others? If yes, then what language would you suggest to a newbie to be able to start making simple scripts to read and write memory as quickly and easily as possible?
I may come up with ingenious ways to do it. As an example of ingenious - I once found a value for Z acceleration. I couldn't reach the actual gravity value for it after trying hard . So I set up -0.1 with a hotkey to Z-accel in CE. Then I downloaded an auto-key-clicker. And I set it to clicking the hotkey again and again. This resulted in creating a high gravity situation.
Though I love these kinds of problem solving ways, I would like to have your advice so that I do not have to create my own methods everytime to do simple memory manipulations..
|
|
| Back to top |
|
 |
TsTg Master Cheater
Reputation: 5
Joined: 12 Dec 2012 Posts: 340 Location: Somewhere....
|
Posted: Sun Apr 07, 2013 11:34 pm Post subject: |
|
|
a script example for copying a value from address to another in assembler(if that's what you want).
mov eax,[Address1] <---the DWORD value of your address (which you see in CE's table)
add eax,5 <---Some math operation or what ever
mov [Address2],eax <---now store the copied value in the second address
as simple as that
|
|
| Back to top |
|
 |
Misteraaargh Newbie cheater
Reputation: 0
Joined: 20 Dec 2012 Posts: 14
|
Posted: Sun Apr 07, 2013 11:52 pm Post subject: |
|
|
| TsTg wrote: | a script example for copying a value from address to another in assembler(if that's what you want).
mov eax,[Address1] <---the DWORD value of your address (which you see in CE's table)
add eax,5 <---Some math operation or what ever
mov [Address2],eax <---now store the copied value in the second address
as simple as that  |
First of all, thanks for replying
I Understand what you are telling me here. Let me go into more detail -
The value A ranges from -170 to +170. While, Value B has the range of 0-100.
The closer the object is to the edges, the higher I want the slider to go.. Slider remains at 0 when object location is 0.
So I want to be able to create a conditional mechanism that reads address B , performs a complex arithmetical operation ( not easily possible in ASM) , applies the result to A. Its good if this calculation is done outside and simply value written to the slider. To code the whole thing in ASM doesn't seem like a good idea.
The idea is to create zones based on object location, and the moment the object enters a certain zone , the script makes the change.
|
|
| Back to top |
|
 |
TsTg Master Cheater
Reputation: 5
Joined: 12 Dec 2012 Posts: 340 Location: Somewhere....
|
Posted: Mon Apr 08, 2013 12:02 am Post subject: |
|
|
So you mean there's a ratio between the values A and B, and that ratio you determine it by calculating your 'arithmetical operation' mentioned ??
and assuming you know how to calculate that operation, so, calculating it without using asm is your problem or what ?.
|
|
| Back to top |
|
 |
Misteraaargh Newbie cheater
Reputation: 0
Joined: 20 Dec 2012 Posts: 14
|
Posted: Mon Apr 08, 2013 12:16 am Post subject: |
|
|
| TsTg wrote: | | So you mean there's a ratio between the values A and B, and that ratio you determine it by calculating your 'arithmetical operation' mentioned ?? |
Lets just say there are just 10 zones divided between -170 and +170 ( 34 length units to each). I want the slider to have different value at different zones. How would you achieve that in ASM?
The idea is to have a bunch of conditional statements reading from Address A, and if a certain condition is met, make appropriate change to Address B.
The ratio is not a question. That is to be decided later on and may even require a lot of tweaking to achieve what I want. The question here is how to make such a link between Address A and B,
| Quote: | | and assuming you know how to calculate that operation, so, calculating it without using asm is your problem or what ?. |
All the worry about how out Arithmetical operation will translate into machine code should be of the language or script we are using, not ours. It would be terribly inefficient and demanding to write all the conditional code yourself in ASM. I am not saying it cannot be done in ASM. It just doesn't make sense to do complex operations yourself when you have a device that can do it for you. Perhaps some language or some script. Or may be some software.
|
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Mon Apr 08, 2013 12:44 am Post subject: |
|
|
Use a simple compare to determine zone (by comparing zone values). Jump to zone. Include modifier at each zone to alter the value at address B.
Example; let's say zone 1 has a value between 150 and 170, zone 2 has a value between 130 and 149 etc. etc.:
| Code: |
//code above
label(returnhere)
label(zone1)
label(zone2)
label(zone3)
cmp [zoneaddress],150 //assuming value 150 is hex
jge zone1 //jump if greater than or equal to 150
cmp [zoneaddress],130
jge zone2 //jump if greater than or equal to 130
cmp [zoneaddress],110
jge zone3 //jump if greater than or equal to 110
//continue code
zone1:
mov [addressb],#999
jmp returnhere
zone2:
mov [addressb],#888
jmp returnhere
zone3:
mov [addressb],#777
jmp returnhere
//code below |
In order to minimize code, you could simplify the compare as shown, without having to do a second compare at each zone, to determine if value is 'less than'. However, you can do it however you like. If you're comparing float values, you can write it as follows:
| Code: | cmp [zoneaddress],(float)150
jge zone1 |
|
|
| Back to top |
|
 |
Misteraaargh Newbie cheater
Reputation: 0
Joined: 20 Dec 2012 Posts: 14
|
Posted: Mon Apr 08, 2013 12:55 am Post subject: |
|
|
GNIREENIGNE, great!
I understand the scheme here.
1. Would you explain the procedure to make the script active in game? Do I just go to auto-assembler and paste it there?
2.These addresses keep changing. How do I implement pointers into this script?
3. Will this script constantly keep reading from A and writing to B?
And, Value A is float and Value B is Byte..
Is there a manual included with cheat engine about all the syntax and functions you can use? ..
|
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Mon Apr 08, 2013 1:06 am Post subject: |
|
|
Once you have found your injection point in memory viewer, go to tools, and select auto assemble. A new window will open, click on template. Select cheat table framework code. Click on template again. Select code injection.
Once everything is set up, you can paste your code and edit/remove code as required.
Once you have found a reliable set of pointers, you can write it out like this:
| Code: | | cmp [[[zoneaddress]+A5]+140],(float)150 |
Whether or not the script is constantly being read will depend on your injection point.
If you've completed the CE tutorial you can focus on learning assembly. Practice writing codes for different games, read the forum, learn from others and study their work etc.
|
|
| Back to top |
|
 |
Misteraaargh Newbie cheater
Reputation: 0
Joined: 20 Dec 2012 Posts: 14
|
Posted: Mon Apr 08, 2013 3:31 am Post subject: |
|
|
| GNIREENIGNE wrote: | Once you have found your injection point in memory viewer, go to tools, and select auto assemble. A new window will open, click on template. Select cheat table framework code. Click on template again. Select code injection.
Once everything is set up, you can paste your code and edit/remove code as required.
Once you have found a reliable set of pointers, you can write it out like this:
| Code: | | cmp [[[zoneaddress]+A5]+140],(float)150 |
Whether or not the script is constantly being read will depend on your injection point.
If you've completed the CE tutorial you can focus on learning assembly. Practice writing codes for different games, read the forum, learn from others and study their work etc. |
Thanks a bunch!
|
|
| 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
|
|