View previous topic :: View next topic |
Author |
Message |
enkisama How do I cheat?
Reputation: 0
Joined: 14 Feb 2021 Posts: 2
|
Posted: Sun Feb 14, 2021 10:55 am Post subject: set value to another address value |
|
|
I've been looking at tutorial and searching for what I want to do with no success.
so basically I want address x value to be constantly set to address y value.
Can anyone help me do that?
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4703
|
Posted: Sun Feb 14, 2021 11:37 am Post subject: |
|
|
Add them both to the address list, freeze address x, and set the value of address x to (description of address y) - parenthesis included.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
enkisama How do I cheat?
Reputation: 0
Joined: 14 Feb 2021 Posts: 2
|
Posted: Sun Feb 14, 2021 11:40 am Post subject: |
|
|
Well that was easy.
Thanks a lot
|
|
Back to top |
|
 |
Fatamorgen Cheater
Reputation: 0
Joined: 17 Feb 2021 Posts: 29
|
Posted: Wed Feb 17, 2021 9:03 pm Post subject: |
|
|
ParkourPenguin wrote: | Add them both to the address list, freeze address x, and set the value of address x to (description of address y) - parenthesis included. |
Hello.
This works like the readmem, right mate?
Code: | 00000000:
readmem(00000001,2) |
Is there a way to "freeze" the readmem to constantly copy from one address to another? I mean if I'm to use script (code injection) instead of the direct address available on the list or lua scripting. The easiest way I found to do this is by using lua since I'm familiar to the program language but I would like to know if it's possible to do the same using code injection, because every time I enable the code it will copy only once and then stop.
Sorry to take your time, but I don't know much about the code injection since I'm new to cheat engine. Also I'm reading the information in the wiki, but it will take some time for me to absorb all the info.
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4703
|
Posted: Thu Feb 18, 2021 1:13 am Post subject: |
|
|
Lua would probably be easiest.
Code: | {$lua}
if syntaxcheck then return end
if not mySpecialTimer then
-- initialize timer
mySpecialTimer = createTimer()
mySpecialTimer.OnTimer = function()
writeInteger(address,value)
end
mySpecialTimer.Interval = 1000
end
[ENABLE]
mySpecialTimer.Enabled = true
[DISABLE]
mySpecialTimer.Enabled = false |
You can also use AA by injecting code at instructions that write to the value. Far more reliable since the game can't see any other value other than the one you want, but this requires knowledge of assembly.
Code: | ...
newmem:
// my code
mov ecx,C8
// original code
mov [rdi+20],ecx
... |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
Fatamorgen Cheater
Reputation: 0
Joined: 17 Feb 2021 Posts: 29
|
Posted: Thu Feb 18, 2021 9:00 am Post subject: |
|
|
ParkourPenguin wrote: | Lua would probably be easiest.
Code: | {$lua}
if syntaxcheck then return end
if not mySpecialTimer then
-- initialize timer
mySpecialTimer = createTimer()
mySpecialTimer.OnTimer = function()
writeInteger(address,value)
end
mySpecialTimer.Interval = 1000
end
[ENABLE]
mySpecialTimer.Enabled = true
[DISABLE]
mySpecialTimer.Enabled = false |
You can also use AA by injecting code at instructions that write to the value. Far more reliable since the game can't see any other value other than the one you want, but this requires knowledge of assembly.
Code: | ...
newmem:
// my code
mov ecx,C8
// original code
mov [rdi+20],ecx
... |
|
Hello and good morning
You're absolutely right about lua since is a light programing language (imho).
When using code injection: Do you know if I can put readmen within newmem without crashing the game?
eg.
Code: | newmem:
15903821:
readmem(16760161,2)
mov [rdi+20],ecx //originalcode to avoid crash |
The original instruction or code at the end of line is only there to avoid crash, but it doesn't work . What I'm doing wrong here?
Also, is there a way to use a comparator to copy values from one mem to another?
Thanks for the last answer.
|
|
Back to top |
|
 |
sbryzl Master Cheater
Reputation: 6
Joined: 25 Jul 2016 Posts: 252
|
Posted: Thu Feb 18, 2021 10:42 am Post subject: |
|
|
If you're going to do code injection start with a template (aob or full injection template). Then you will have something to work with.
Putting an address label directly under newmem isn't a good idea. Under newmem you want to put code or data. If you change the address location under newmem it's basically just saying to ignore the newmem address.
|
|
Back to top |
|
 |
Fatamorgen Cheater
Reputation: 0
Joined: 17 Feb 2021 Posts: 29
|
Posted: Thu Feb 18, 2021 11:31 am Post subject: |
|
|
sbryzl wrote: | If you're going to do code injection start with a template (aob or full injection template). Then you will have something to work with.
Putting an address label directly under newmem isn't a good idea. Under newmem you want to put code or data. If you change the address location under newmem it's basically just saying to ignore the newmem address. |
Good afternoon.
You're absolutely right, mate. I did something similar, I used full injection.
What I want to know if is there a way to use comparators (cmp) to analise one address value and then copy this value constantly into another address value.
Eg.
If addressX = 100 then
addressY = 100
If ..... = 99 then
..... = 99
AddressX set the same value to AddressY. If one changes so the other.
Exactly like the readmem procedure but unfortunately readmem copy only once and then stops. Through lua I already managed to do this by simply using read and write instructions, but since I'm learning to use code injection I was looking for some experienced cheaters to help me with that.
Thanks for the tip about aob.
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4703
|
Posted: Thu Feb 18, 2021 11:39 am Post subject: |
|
|
I'm assuming newmem is allocated memory.
Instructions (including pseudoinstructions such as readmem) are written sequentially to the address last specified in the script.
Code: | foo:
mov ecx,[edx+10]
cmp [edi+2C],ecx
cmovge [edi+30],ecx
reassemble(INJECT)
jmp return | In this example, the mov, cmp, cmovge, reassemble, and jmp (pseudo)instructions are written sequentially starting at the address foo.
In your example:
Code: | newmem:
15903821:
readmem(16760161,2)
mov [rdi+20],ecx | newmem specifies an address to write data to, but you don't specify anything to write. Instead, you immediately specify another address, 15903821, which the readmem and mov (pseudo)instructions are sequentially written to.
If you want the game to write a value when the code is run, you'll have to write the code.
Code: | newmem:
push rax
mov ax,[16760161]
mov [15903821],ax
pop rax
mov [rdi+20],ecx // assuming rdi+20 doesn't alias either previous access
jmp return |
Also, there's more to that injection point. "mov [rdi+20],ecx" is only 3 bytes- you need at least 2 more for a jump to your code.
Go through the CE tutorial if you haven't already done so.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
Fatamorgen Cheater
Reputation: 0
Joined: 17 Feb 2021 Posts: 29
|
Posted: Thu Feb 18, 2021 12:11 pm Post subject: |
|
|
I see. It looks harder than lua.
I'll try that, mate. Thank you, Mr. Penguin and sbryzl, may both have a good day.
|
|
Back to top |
|
 |
|