Dissection Help

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
zachillios
Table Makers
Table Makers
Posts: 905
Joined: Fri Mar 03, 2017 9:05 am
Reputation: 760

Dissection Help

Post by zachillios »

So I'm new to scripting, but essentially I'm trying to do a God Mode script, and I've managed to find the code that reduces health which is

Code: Select all

13FFF0043 - 29 87 94000000  - sub [rdi+00000094],eax
And so I dissected off of the damage everyone took, and I'm pretty sure I've found the identifier in question.

Image

15:Players
31:Enemies

So my question is how exactly would I set the script up? I tried following a few of the tutorials and everything I've tried has either had no effect, or has had me die in one hit rather than make me invisible. Because following the tutorials had me end up with:

Code: Select all

add [rdi+00000094],eax
cmp [rdi+00000070],15
jne +6
mov eax,[rdi+00000098]
mov [rdi+00000094],eax
And this ended up with me being killed in one hit. Any help would greatly be appreciated.

0094 was current health, and then 0098 was Maximum health.

Bloodybone
Table Makers
Table Makers
Posts: 336
Joined: Thu Aug 03, 2017 6:19 am
Reputation: 206

Re: Dissection Help

Post by Bloodybone »

Maybe try this out:

Code: Select all

add [rdi+00000094],eax
cmp [rdi+00000070],(int)15
jne @f
mov eax,[rdi+00000098]
mov [rdi+00000094],eax
@@:

zachillios
Table Makers
Table Makers
Posts: 905
Joined: Fri Mar 03, 2017 9:05 am
Reputation: 760

Re: Dissection Help

Post by zachillios »

Bloodybone wrote:
Wed Dec 12, 2018 4:40 pm
Maybe try this out:

Code: Select all

add [rdi+00000094],eax
cmp [rdi+00000070],(int)15
jne @f
mov eax,[rdi+00000098]
mov [rdi+00000094],eax
@@:
Thank you for help! So this got me a little closer. I'm now invincible, and enemies health decreases, however they never die. So the code I ended up with that does this is:

Code: Select all

sub [rdi+00000094],eax
cmp [rdi+00000008],0
jne +6
mov eax,[rdi+00000098]
mov [rdi+00000094],eax
jmp return
So I'm still confused on how this should be setup to also include their deaths. These are all the codes that execute when an enemy is killed.

Image

Again, thank you for your help.

JohnFK
Expert Cheater
Expert Cheater
Posts: 59
Joined: Tue Aug 29, 2017 10:50 am
Reputation: 27

Re: Dissection Help

Post by JohnFK »

You subtract eax from [rdi+94], then later you write eax to [rdi+94]. So [rdi+94] will ALWAYS be what EAX is. You should write it like this:

is player?
jump if not to original code
(else)
write max health in [rdi+98] to eax
write eax to [rdi+94]

In assembly it can look like this:

Code: Select all

cmp [rdi+8],0
jne @f //jumps to the next anonymous label
mov eax,[rdi+98]
mov [rdi+94],eax 
jmp return //skip original code for player and exit script

@@: //anonymous label you dont need to declare
sub [rdi+00000094],eax //originalcode
But since it subtract a value you can also write it differently

Code: Select all

cmp [rdi+8],0
jne @f //jumps to the next anonymous label
xor eax,eax //clears eax, so for player it subtracts 0 which doesnt change the health

@@: //anonymous label you dont need to declare
sub [rdi+00000094],eax //originalcode

zachillios
Table Makers
Table Makers
Posts: 905
Joined: Fri Mar 03, 2017 9:05 am
Reputation: 760

Re: Dissection Help

Post by zachillios »

JohnFK wrote:
Thu Dec 13, 2018 11:47 am
You subtract eax from [rdi+94], then later you write eax to [rdi+94]. So [rdi+94] will ALWAYS be what EAX is. You should write it like this:

is player?
jump if not to original code
(else)
write max health in [rdi+98] to eax
write eax to [rdi+94]

In assembly it can look like this:

Code: Select all

cmp [rdi+8],0
jne @f //jumps to the next anonymous label
mov eax,[rdi+98]
mov [rdi+94],eax 
jmp return //skip original code for player and exit script

@@: //anonymous label you dont need to declare
sub [rdi+00000094],eax //originalcode
But since it subtract a value you can also write it differently

Code: Select all

cmp [rdi+8],0
jne @f //jumps to the next anonymous label
xor eax,eax //clears eax, so for player it subtracts 0 which doesnt change the health

@@: //anonymous label you dont need to declare
sub [rdi+00000094],eax //originalcode
This helped so much, I was able to get it. Thank you so much!

Post Reply

Who is online

Users browsing this forum: No registered users