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 


DB explanation

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

Joined: 21 May 2015
Posts: 17

PostPosted: Sun Aug 06, 2023 10:26 pm    Post subject: DB explanation Reply with quote

Here is an infinite pet sprint script from a No Man's Sky table.

Code:
aobscanmodule(petinfsprint,NMS.exe,76 EA F3 0F 11 89 * * 00 00 C3)
registersymbol(petinfsprint)
petinfsprint+5:
db 81
[DISABLE]
petinfsprint+5:
db 89
unregistersymbol(petinfsprint)


I understand hex 81 is replacing hex 89 in the 5th position of the array, but not sure how how the person making the script knew what 81 means. Normally, I would just nop the instruction - Just trying to get a better understanding of this. Is this what's known as a db script?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4307

PostPosted: Sun Aug 06, 2023 11:28 pm    Post subject: Reply with quote

All instructions are stored in memory as bytes. In this case, that script is changing the instruction `movss [rcx+0000????],xmm1` to `movss [rcx+0000????],xmm0`.

It's a clever way of avoiding the offset in the AOB pattern. This can also be used when you simply don't feel like allocating memory to do something. e.g. turning a jcc into a jmp, replacing an instruction with `nop`, etc.

Modifying code inline like that (as opposed to a more standard code injection) is a little dangerous. You need to know exactly how many bytes an instruction will assemble to. If you're off by a single byte, you'll crash the game. It's often safer to "assemble" the instruction(s) yourself and modify the bytes manually- that way, you have full control over how many bytes you're overwriting.

The safest thing you can do to create such scripts yourself is to allocate some memory and play around there. e.g. assemble the instruction(s) you want to replace the original code with in that allocated memory, compare it against the injection point, and you'll know what bytes to modify and how.
It's faster to do it inline at the injection point, but more dangerous. Make sure the game won't run that section of code while you're playing around with it. Pause the process in the "Advanced Options" window if needed. I also enable write logging (Edit -> Settings) to more easily fix something if I screw it up.

_________________
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
prosportal1
Newbie cheater
Reputation: 0

Joined: 21 May 2015
Posts: 17

PostPosted: Mon Aug 07, 2023 6:07 pm    Post subject: Reply with quote

Thanks for the insight!
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