Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Dmg reflect?
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Tue Jan 17, 2023 6:56 pm    Post subject: Reply with quote

This is where break and trace is useful. You need to know when that branch is taken. If it's skipped then your edx comes from somewhere else.
Back to top
View user's profile Send private message
Einhuhn
Cheater
Reputation: 0

Joined: 06 Apr 2022
Posts: 38

PostPosted: Tue Jan 17, 2023 7:07 pm    Post subject: Reply with quote

cooleko wrote:
This is where break and trace is useful. You need to know when that branch is taken. If it's skipped then your edx comes from somewhere else.


So i should test the Codes about edx with "Replacing Nothing" and see, if the HP doesnt reduce anymore? And so can i find the right Code for the EDX? Or is there a better method for?

Here is the Trace List. But showing only as EDX up sub [rax+60],edx

Edit: I have found the Point. It was on "mov edx,[rax+70]"

mov edx,[rax+70]
mov rcx,[rbx+28]


If i change it to "mov edx,#5" the Dmg points be are 5.

Now, how i can replace the edx with the Enemy HP([rax+60])? So, every time on Attack from the Enemy the HP([rax+60]) reduce to 0?
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Tue Jan 17, 2023 11:26 pm    Post subject: Reply with quote

Now you need to learn what RAX is in the new instruction. Is it the same RAX as used in the HP decrement? If so, you can use the current health from the same instruction.

First, identify whether it is enemy or player
Second, if player, set EDX to zero or RAX+70 to zero before it is assigned; if enemy, set EDX to #99999 or use a placeholder register such as:

Code:
push rbx
mov rbx, [rax+60]
mov [rax+70],rbx
pop rbx
mov edx,[rax+70]


You will need to figure out what differentiates the player from the enemy.

Code:
cmp [rax+???],???
JE Player
{Code for Enemy}
Player:
{Code for Player}
Back to top
View user's profile Send private message
Einhuhn
Cheater
Reputation: 0

Joined: 06 Apr 2022
Posts: 38

PostPosted: Wed Jan 18, 2023 1:33 pm    Post subject: Reply with quote

cooleko wrote:
Now you need to learn what RAX is in the new instruction. Is it the same RAX as used in the HP decrement? If so, you can use the current health from the same instruction.

First, identify whether it is enemy or player
Second, if player, set EDX to zero or RAX+70 to zero before it is assigned; if enemy, set EDX to #99999 or use a placeholder register such as:

Code:
push rbx
mov rbx, [rax+60]
mov [rax+70],rbx
pop rbx
mov edx,[rax+70]


You will need to figure out what differentiates the player from the enemy.

Code:
cmp [rax+???],???
JE Player
{Code for Enemy}
Player:
{Code for Player}


Its Player, so on attack the Player do the amount of dmg. So set to 0, right?

Code 1:

//mov edx,[rax+70]
mov edx,0
mov rcx,[rbx+28]


Code 2:

//sub [rax+60],edx
cmp [rax+70],1 Enemey has on [rax+70] 1, and Player 0
JE Enemy
mov [rax+60],#500 Set Player HP to 500
Enemy:
mov [rax+60],0 Set Enemy HP to 0


Or must be both in Code 1 and dont change the sub [rax+60],edx Code?
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Wed Jan 18, 2023 2:56 pm    Post subject: Reply with quote

That depends on how the code runs, but if you do an AA script or an injection since it is the simple tutorial then you can just do it all at either location.

I find that only changing the register and not the source address for scripts is less reliable. So instead of setting EDX to 0 it is better to set [RAX+70] to zero and then let the EDX populate with the zero.

Lastly, because you likely don't know how the script evaluates the outcome of the subtract, you shouldn't skip it. It could be the case that the code looks for flags set by the subtraction or something similar, so best to let the code run:

Code:
cmp [rax+70],1
JE Enemy
mov [rax+60],#500
mov EDX, 0
sub [rax+60],edx
ret
Enemy:
mov [rax+60],0
sub [rax+60],edx
ret
Back to top
View user's profile Send private message
Einhuhn
Cheater
Reputation: 0

Joined: 06 Apr 2022
Posts: 38

PostPosted: Wed Jan 18, 2023 5:45 pm    Post subject: Reply with quote

cooleko wrote:
That depends on how the code runs, but if you do an AA script or an injection since it is the simple tutorial then you can just do it all at either location.

I find that only changing the register and not the source address for scripts is less reliable. So instead of setting EDX to 0 it is better to set [RAX+70] to zero and then let the EDX populate with the zero.

Lastly, because you likely don't know how the script evaluates the outcome of the subtract, you shouldn't skip it. It could be the case that the code looks for flags set by the subtraction or something similar, so best to let the code run:

Code:
cmp [rax+70],1
JE Enemy
mov [rax+60],#500
mov EDX, 0
sub [rax+60],edx
ret
Enemy:
mov [rax+60],0
sub [rax+60],edx
ret


This Code set my HP to 500 after a hit on me. And the Enemy HP to 0, after I hit the Enemy. I think i explained my problem wrong.

I would like this:

"Enemy cant shot anymore. If Enemy try to shot -> No shot but reduce HP to 0"

So i though i can change the Attack Code to a Self Hit Code
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Wed Jan 18, 2023 9:49 pm    Post subject: Reply with quote

Yeah, you explained your desires well but a few posts back you changed your line of questioning. It seemed odd to me but I figured you just wanted to make anything work first. If you are returning to what you asked before, then I do recommend you reread the advice earlier in the thread and look in the function calls a bit further to see which one is possible based on how the code is written.
Back to top
View user's profile Send private message
Einhuhn
Cheater
Reputation: 0

Joined: 06 Apr 2022
Posts: 38

PostPosted: Thu Jan 19, 2023 10:03 am    Post subject: Reply with quote

cooleko wrote:
Yeah, you explained your desires well but a few posts back you changed your line of questioning. It seemed odd to me but I figured you just wanted to make anything work first. If you are returning to what you asked before, then I do recommend you reread the advice earlier in the thread and look in the function calls a bit further to see which one is possible based on how the code is written.


Its not possible to change the EDX Register with the Enemy HP Register? Because on every attack the Enemy access the EDX Register with
"sub [rax+60],edx"

So i though, i can change EDX with the Enemy HP. So that EDX be not more a Number, but the Enemy HP Register.

As Example:

Normal Code: "sub [rax+60],edx"

New Code with same function: "sub edx,#1000" <- edx replacing Enemy HP

Or is this not possible?


Your Codes on the Top changing the Dmg from the Enemy to 0 and another the HP from the Enemy to 0
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Thu Jan 19, 2023 11:52 pm    Post subject: Reply with quote

Isnt EDX the damage done? So it only hurts the enemy when [rax+60] is the enemies HP.

For damage reflect, you need to know the enemies addresses when the game gives you the player hp at [rax+60].

Ive given a few options for hunting for those addresses in real time or storing them as you go so you can hit them with their own projectiles.
Back to top
View user's profile Send private message
Einhuhn
Cheater
Reputation: 0

Joined: 06 Apr 2022
Posts: 38

PostPosted: Fri Jan 20, 2023 7:22 pm    Post subject: Reply with quote

cooleko wrote:
Isnt EDX the damage done? So it only hurts the enemy when [rax+60] is the enemies HP.

For damage reflect, you need to know the enemies addresses when the game gives you the player hp at [rax+60].

Ive given a few options for hunting for those addresses in real time or storing them as you go so you can hit them with their own projectiles.


EDX is Dmg. But on [rax+60] is the Player and the Enemy HP.

On [rax+70] has the Player "0" and the Enemy "1"

So i can use [rax+70] with "0" for no Player Dmg.


But if i set [rax+70] with "1" to 0 HP, then i must 1 hit to the Enemy to kill they.

1. But the Enemy should kill his self after a Hit on me.

2. Or if the Enemy try to use the Attack Code in the Tutorial Game
"sub [rax+60],edx"

I want only 1 of the 2 ways

On your Code:

push rbx
mov rbx, [rax+60]
mov [rax+70],rbx
pop rbx
mov edx,[rax+70]

crash the Tutorial Game
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Sat Jan 21, 2023 12:32 am    Post subject: Reply with quote

That was based off an assumption you provided me that [rax+70] was what populated EDX (damage). If it isnt, then that code wont work as written.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites