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 


Changing an opcode multiple times in a script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Flux.
Advanced Cheater
Reputation: 0

Joined: 10 Nov 2016
Posts: 88
Location: Another World - N5X2 106311411+2123518

PostPosted: Tue Apr 02, 2019 9:52 am    Post subject: Changing an opcode multiple times in a script Reply with quote

Another day another question.

Is there an easy way to create a script that will allow me to change xmm0 multiple times,
Code:
movss [ecx+50],xmm0


For instance to xmm1, xmm2, xmm3 and xmm5, and revert back to original.

It works using multiple scripts, just asking if there's an easy way to do it with one script without using child scripts.

Thank you for any help.
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 959

PostPosted: Tue Apr 02, 2019 10:54 am    Post subject: Reply with quote

compile, alloc and dealloc every time is unsafe,
it should be better redirect execution with flag.
Code:

globalalloc(WhereToSet,4)
...
// test if set to xmm0, original
cmp  byte ptr[WhereToSet],0
jne  @f
  movss [ecx+50],xmm0
@@:
// test if set to xmm1
cmp  byte ptr[WhereToSet],1
jne  @f
  movss [ecx+50],xmm1
@@:
// test if set to xmm2
cmp  byte ptr[WhereToSet],2
jne  @f
  movss [ecx+50],xmm2
@@:
// test if set to xmm3
cmp  byte ptr[WhereToSet],3
jne  @f
  movss [ecx+50],xmm3
@@:
// test if set to xmm5
cmp  byte ptr[WhereToSet],5
jne  @f
  movss [ecx+50],xmm5
@@:
...

It is like switch-cases.

_________________
- Retarded.
Back to top
View user's profile Send private message
Flux.
Advanced Cheater
Reputation: 0

Joined: 10 Nov 2016
Posts: 88
Location: Another World - N5X2 106311411+2123518

PostPosted: Tue Apr 02, 2019 1:19 pm    Post subject: Reply with quote

panraven Thank you for the help its much appreciated.
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
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