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 


Feature request: NOP multiplier

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 841
Location: Maryland, United States

PostPosted: Sun Jun 23, 2019 12:33 pm    Post subject: Feature request: NOP multiplier Reply with quote

When dealing with code caves, it's often hard for the developer to assign proper padding after the JMP to line up the assembly viewer with what it was before.

However, while I was reading an Intel assembler's handbook, I found that there's several instructions that are multibyte wide, that consume a similar operation as NOP. Generally, we don't even care about the efficiency cycles of these instructions, because it's just a spacer between the JMP to codecave, and the label of where the JMP RETURN needs to happen.

I have found someone has already documented up to 11 bytes of instructions that do absolutely nothing, and Cheat Engine seems to parse these fairly well. I suggest that instead of just generating something like 5 NOP instructions, it does something like:

Code:
jmp newmem
nop x4
return:


Where x4 is the number of bytes to consume.

Here is the table I mentioned: https://stackoverflow.com/questions/25545470/long-multi-byte-nops-commonly-understood-macros-or-other-notation
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Sun Jun 23, 2019 1:41 pm    Post subject: Reply with quote

I just glanced at it but it looks like the bytes/instructions used change... probably a lot simpler to just write nops, and if you happen to need a lot you can use lua to generate it
Code:
...
{$lua}
return 'db ' .. ('90 '):rep(42)
{$asm}
...

could probably make an AA command for that like DONOP(42) but... I don't actually use it that much.

Though perhaps it's simpler to do for DB than I'd imagine /shrug

_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun Jun 23, 2019 3:13 pm    Post subject: Reply with quote

that is already in next CE, assuming your CPU supports multibyte NOP's ce will use it (of course not for the script template as there can be cpu's without that support)
_________________
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
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 841
Location: Maryland, United States

PostPosted: Sun Jun 23, 2019 5:20 pm    Post subject: Reply with quote

FreeER wrote:
I just glanced at it but it looks like the bytes/instructions used change... probably a lot simpler to just write nops, and if you happen to need a lot you can use lua to generate it
Code:
...
{$lua}
return 'db ' .. ('90 '):rep(42)
{$asm}
...

could probably make an AA command for that like DONOP(42) but... I don't actually use it that much.

Though perhaps it's simpler to do for DB than I'd imagine /shrug

That's a terrible solution since you're still flooding the disassembler with NOP instructions.

The multibyte opcodes have been a thing since at least the Pentium 4s: https://software.intel.com/pt-br/forums/watercooler-catchall/topic/307174

I don't see a reason not to implicitly use the multibyte NOP instructions for padding.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun Jun 23, 2019 11:18 pm    Post subject: Reply with quote

There are still users on cpu's older than 8 year old that use CE and not all AMD systems back then did not support multibyte (It's also not sse3 it's a separate feature )

and freeer there's also 'align 0c 90'

_________________
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
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 841
Location: Maryland, United States

PostPosted: Wed Jul 17, 2019 5:33 pm    Post subject: Reply with quote

Dark Byte wrote:
There are still users on cpu's older than 8 year old that use CE and not all AMD systems back then did not support multibyte (It's also not sse3 it's a separate feature )

and freeer there's also 'align 0c 90'

Why do the many have to suffer for the few? Just make the instruction nop x5 check if the CPU can handle multibyte NOP instructions and if it can't, have the assembler spit out 5 NOP instructions instead of the 5 byte NOP.
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