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 


[HELP] Replace Opcode for all the same calls

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Alexionut6
How do I cheat?
Reputation: 0

Joined: 05 Apr 2019
Posts: 2

PostPosted: Fri Apr 05, 2019 7:27 pm    Post subject: [HELP] Replace Opcode for all the same calls Reply with quote

Hello Cheat Engine community,
My name is Alex and lately i became very passionate with ce. I ran into some problems recently when i had to replace a certain Opcode with mov eax,01. The problem is that there are around 9000 of the same Opcode and i need to replace it all. Is there a script i could use to replace instantly instead of doing it manually?
Please let me know. All the help is appreciated. I'll attach 2 picture to explain the situation further.
In Pic 1 is how the call looks initially.
And In pic 2 is how i want all instances of this specific call to look like
Please refer to the attachment.

Thanks in advance.



ce1 - Copy.PNG
 Description:
 Filesize:  166.45 KB
 Viewed:  2688 Time(s)

ce1 - Copy.PNG


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 147

Joined: 06 Jul 2014
Posts: 4562

PostPosted: Fri Apr 05, 2019 10:30 pm    Post subject: Reply with quote

That instruction is a little harder to find because the instruction pointer is used to calculate the destination.

There's no easy way of accessing the assemblyscan from Lua AFAIK. Maybe use the DissectCode or RIPRelativeScanner classes (see celua.txt for documentation).

If they aren't fast enough, creating a custom type for this shouldn't be too hard. I can write one later if needed.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 465

Joined: 09 May 2003
Posts: 25565
Location: The netherlands

PostPosted: Fri Apr 05, 2019 11:57 pm    Post subject: Reply with quote

or you could hook 16182c5c and write this code there:
Code:

mov eax,1
ret xxx

and change xxx to the number that that function uses

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Alexionut6
How do I cheat?
Reputation: 0

Joined: 05 Apr 2019
Posts: 2

PostPosted: Sat Apr 06, 2019 10:34 am    Post subject: Reply with quote

Hi guys and thank you for your answers. As I just started using ce, I am a noob in creating scripts. I would immensely appreciate if you could write a script if that not much of a trouble. I heard a script could also be written in c to access and modify different calls and I saw 1 guy on it that created a small exe to change all the specific calls although he doesn't show how.
What I tried, was to create a small AutoIt script that replaces the calls one by one very fast but unfortunately, the program resets after some time. This Autoit method is the same as replacing the calls manually just very fast.

Please let me know what you think.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 147

Joined: 06 Jul 2014
Posts: 4562

PostPosted: Sun Apr 07, 2019 8:48 am    Post subject: Reply with quote

Why wouldn't DB's method work? Modifying the function itself is more straightforward than replacing every call to that function.

Just copy/paste this in an AA window:
Code:
16182c5c:
  mov eax,1
  ret

(I'm assuming there are no arguments if replacing the call just works)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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 Lua Scripting 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