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 


Why this script does not work

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
simbim
Newbie cheater
Reputation: 0

Joined: 14 Jun 2016
Posts: 21

PostPosted: Fri Jun 24, 2016 11:25 am    Post subject: Why this script does not work Reply with quote

Hi!
Im still trying to learn basic. The game Im practicing at is the witcher 3. I know there is lots of scripts here but thouse are really professionell.
Im trying to learn something so I have to try to write by myself so I can find where I do misstakes. I dont like copy and paste.

In this script Im trying to jump to stamina after unlimited health but it wont work. My question is why unl.health working but not stamina?
Also the stamina working if I change the original code as you see.


Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,1000,"witcher3.exe"+E37853)
label(health)
label(stamina)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
health:
cmp dword ptr [rax+20],3
jne originalcode
movss xmm6,[rax+rcx*4+4]
movss [rax+rcx*4],xmm6
jmp stamina

stamina:
cmp dword ptr [rax+20],7
jne originalcode
movss xmm6,[rax+rcx*4+10]
movss [rax+rcx*4+0C],xmm6
jmp returnhere

originalcode:
//cmp dword ptr [rax+20],7
//movss xmm6,[rax+rcx*4+10]
//movss [rax+rcx*4+0C],xmm6
movss [rax+rcx*4],xmm6

exit:
jmp returnhere

"witcher3.exe"+E37853:
jmp newmem
returnhere:


Thanks in advance!
Back to top
View user's profile Send private message
Matze500
Expert Cheater
Reputation: 8

Joined: 25 Jan 2012
Posts: 241
Location: Germany

PostPosted: Fri Jun 24, 2016 11:46 am    Post subject: Reply with quote

The first jmp is wrong.

The first compare checks if it is health. If it is wrong you execute the originalcode but you shoud check if it is stamina instead. The check in the stamina section of your code is always false because you only would reach it if [rax+20] is 3.

Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,1000,"witcher3.exe"+E37853)
label(health)
label(stamina)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
health:
cmp dword ptr [rax+20],3
jne stamina
movss xmm6,[rax+rcx*4+4]
jmp originalcode

stamina:
cmp dword ptr [rax+20],7
jne originalcode
movss xmm6,[rax+rcx*4+10]
movss [rax+rcx*4+0C],xmm6
jmp returnhere

originalcode:
//cmp dword ptr [rax+20],7
//movss xmm6,[rax+rcx*4+10]
//movss [rax+rcx*4+0C],xmm6
movss [rax+rcx*4],xmm6

exit:
jmp returnhere

"witcher3.exe"+E37853:
jmp newmem
returnhere:


Greets Matze

_________________


Last edited by Matze500 on Fri Jun 24, 2016 11:50 am; edited 1 time in total
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Fri Jun 24, 2016 11:47 am    Post subject: Reply with quote

Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,1000,"witcher3.exe"+E37853)
label(health)
label(stamina)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
health:
cmp dword ptr [rax+20],3
jne stamina
movss xmm6,[rax+rcx*4+4]
movss [rax+rcx*4],xmm6
jmp exit

stamina:
cmp dword ptr [rax+20],7
jne originalcode
movss xmm6,[rax+rcx*4+10]
movss [rax+rcx*4+0C],xmm6
jmp exit

originalcode:
movss [rax+rcx*4],xmm6

exit:
jmp returnhere

"witcher3.exe"+E37853:
jmp newmem
returnhere:


The problem was that if [rax+20] is not "3" you already jump to originalcode instead of checkinf for stamina first.

EDIT:
Hehe, Matze was a bit faster ^^
Back to top
View user's profile Send private message
simbim
Newbie cheater
Reputation: 0

Joined: 14 Jun 2016
Posts: 21

PostPosted: Fri Jun 24, 2016 11:53 am    Post subject: Reply with quote

Thank you so much guys for helping me understand it, you saved me alots of time! <3
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Page 1 of 1

 
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