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 


[Tutorial] How to nop and make cleaner scripts!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials
View previous topic :: View next topic  
Author Message
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Sun Mar 23, 2008 12:14 pm    Post subject: [Tutorial] How to nop and make cleaner scripts! Reply with quote

This was first posted on MMOVision by me Smile

Original Post by me

Sponsered by MMOVision

This tutorial may not matter much, but is useful for people who like things neat Smile

I will be showing you how to do this with nopping in this tutorial.

First Step: Find an opcode that you would like to nop.

The Bytes are what you will be using instead of opcodes to make this Auto-Assembly script looking neat. So for this address the bytes are:
Code:
68 e0 17 08 00

and the opcode which you would put in a normal script is:
Code:
push 000817e0


So now you can make your disable section which is:
Code:
[disable]
0008359A: //This is the address of the opcode which always before the opcode or bytes
db 68 e0 17 08 00 //db means define byte so now you put this here since it is the original opcode/bytes so you can  restore the code once you disable the cheat


but the original disable section would be:
Code:
[disable]
0008359A: //This is the address of the opcode which always before the opcode or bytes
push 000817e0 //This is the original opcode so it can restore the code when you disable the cheat





Second Step: Now we nop that address by right clicking and clicking replace with code that does nothing.



Third Step: Once we nop the address we count how many opcodes change to nop or how many bytes change to 90 in a row below it.



Fourth Step: In this case there are 5 nops or 90s so now we can build our enable section.

The original script would look like this:
Code:
[enable]
0008359A: //This is the address of the opcode which always before the opcode or bytes
nop //This is the amount of opcodes that changed to nop when you replaced with a code that does nothing
nop
nop
nop
nop



but this script annoys some people and looks messy so to make it neater we can insert the bytes instead and make the script like this:

Code:
[enable]
0008359A: //This is the address of the opcode which always before the opcode or bytes
db 90 90 90 90 90 //This is the amount of nops and one nop in bytes is 90 so we put define byte and 5 nops



Then we would combine the enable and the original script would be:

Code:
[enable]
0008359A: //This is the address of the opcode which always before the opcode or bytes
nop //This is the amount of opcodes that changed to nop when you replaced with a code that does nothing
nop
nop
nop
nop
[disable]
0008359A: //This is the address of the opcode which always before the opcode or bytes
push 000817e0 //This is the original opcode so it can restore the code when you disable the cheat


A much neater version of this script using bytes would be:

Code:
[enable]
0008359A: //This is the address of the opcode which always before the opcode or bytes
db 90 90 90 90 90 //This is the amount of nops and one nop in bytes is 90 so we put define byte and 5 nops
[disable]
0008359A: //This is the address of the opcode which always before the opcode or bytes
db 68 e0 17 08 00 //db means define byte so now you put this here since it is the original opcode/bytes so you can  restore the code once you disable the cheat


See how the clean script without my commentary is 6 lines while the original script would be 10 lines long.

You have just learned hop to nop and script neater!

_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
Labyrnth
Moderator
Reputation: 9

Joined: 28 Nov 2006
Posts: 6285

PostPosted: Sun Mar 23, 2008 3:26 pm    Post subject: Reply with quote

I dont know about the script being cleaner, but it is a method beginners can maybe understand.
nop is very common for novices to do.

Instead of nop, you could find out what it is being pushed.
Jump to a cave, edit your own and push your address instead of that one.
It would be a very nice script.


But props to you on your tutorial.


P.S. too many comments in it makes it look cluttered as well.

_________________

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

Joined: 17 Mar 2008
Posts: 3688
Location: Pernambuco - Brazil

PostPosted: Fri Apr 11, 2008 10:19 am    Post subject: Reply with quote

I agree that where NOP solves the problem it should be used. Smile

But care should be taken when "nopping" some instructions. It is not a good practice to "nop" instructions that is related to stack (for exemple: PUSH, POP, STP, etc). Sooner or later the application will crash.

Cheers.
Back to top
View user's profile Send private message Send e-mail
Tahayassen
Advanced Cheater
Reputation: 0

Joined: 04 Sep 2007
Posts: 74

PostPosted: Sat Jan 03, 2009 1:55 pm    Post subject: Reply with quote

Lol nice job Razz
_________________
Back to top
View user's profile Send private message
Sora
Grandmaster Cheater Supreme
Reputation: 0

Joined: 14 May 2008
Posts: 1471

PostPosted: Sat Jan 03, 2009 11:03 pm    Post subject: Reply with quote

Nice job on the tut.
Back to top
View user's profile Send private message
sven3107
Expert Cheater
Reputation: 0

Joined: 04 Feb 2009
Posts: 118
Location: Belgium

PostPosted: Sun Mar 08, 2009 10:05 am    Post subject: Reply with quote

defining bytes is neater indeed and i use that method as well but it comes with a major disadvantage: you don't know what the bytes mean when you or someone else wants to edit the script.

Always think twice before cutting into your script by defining bytes.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials 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