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
View previous topic :: View next topic  
Author Message
Hieroglyphics
I post too much
Reputation: 0

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

PostPosted: Sun Jul 06, 2008 7:37 pm    Post subject: [Tutorial] How to nop and make cleaner scripts! Reply with quote


Credits: Me 100%

I just posting this, because I noticed I never posted it o CEF

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 how to nop and script neater!

_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
reload01
Advanced Cheater
Reputation: 0

Joined: 22 Oct 2006
Posts: 96

PostPosted: Sun Jul 06, 2008 7:44 pm    Post subject: Reply with quote

good job on this tut Very Happy
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 5

Joined: 04 May 2007
Posts: 960
Location: Why do you care?

PostPosted: Sun Jul 06, 2008 7:50 pm    Post subject: Reply with quote

This is covered in one of my AA tuts.
_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Hieroglyphics
I post too much
Reputation: 0

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

PostPosted: Sun Jul 06, 2008 7:53 pm    Post subject: Reply with quote

Lol oh. I posted this a long time ago so this WAS actually my work =]

Original Post

_________________

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

Joined: 25 Jan 2006
Posts: 5557
Location: 127.0.0.1

PostPosted: Sun Jul 06, 2008 11:17 pm    Post subject: Reply with quote

This doesn't deal with programming but instead a feature of CE, moved.
_________________
- Retired.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6246
Location: /dev/null

PostPosted: Mon Jul 07, 2008 4:50 am    Post subject: Reply with quote

It might be neater but will someone with little knowledge be able to read it?
Back to top
View user's profile Send private message MSN Messenger
Blazin
Grandmaster Cheater
Reputation: 0

Joined: 17 Sep 2006
Posts: 770
Location: Somewhere over the rainbow.

PostPosted: Fri Jul 18, 2008 11:40 pm    Post subject: Reply with quote

noz3001 wrote:
It might be neater but will someone with little knowledge be able to read it?


Being a person with only a little ASM knowledge, even I am able to read what is going on in those scripts. It's not really all too difficult. Very Happy
Back to top
View user's profile Send private message
xzatoichix
Cheater
Reputation: 0

Joined: 17 Jul 2008
Posts: 32
Location: DownUnder - BrisVegas

PostPosted: Tue Aug 05, 2008 5:42 pm    Post subject: Reply with quote

For a n00b, this is something which would help ~ thanx Smile
_________________
Currently...a Newbie....

GGO - Lv 4x Glove Assassin
G Maple - Lv 6x Cleric
G Maple - Lv 5x Fire Mage
Back to top
View user's profile Send private message
Butcher
Expert Cheater
Reputation: 0

Joined: 04 Mar 2009
Posts: 125
Location: lAS vEGAS no joke

PostPosted: Thu Mar 19, 2009 6:53 pm    Post subject: Reply with quote

thanks this helped me a LOT
Back to top
View user's profile Send private message
immediate
How do I cheat?
Reputation: 0

Joined: 05 Sep 2010
Posts: 1

PostPosted: Sun Sep 05, 2010 8:41 am    Post subject: Reply with quote

Thanks for this tutorial it makes clear on how to make scripts which nop.

However im confused about something about the memory, it seems when you change the opcode into nop.
It displays 5 nops with an offset of 1 between them.

I guess up till now, i assumed how the os stores memory was in 32 bits for each address? it seems like it stored the the nop over the push like this:

000859A: 90 90 90 90 90

sorry just a concept confusion, can someone please explain about the memory allocation?
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 93

Joined: 05 Feb 2010
Posts: 5151

PostPosted: Sun Sep 05, 2010 9:44 am    Post subject: Reply with quote

It depends on what do You mean by "address". One address does not take 4 bytes. Every byte has an address and one byte is 8 bit only.

So this

Code:
000859A: 90 90 90 90 90


in reality looks like this:

Code:
000859A   90
000859B   90
000859C   90
000859D   90
000859E   90


You replace each byte with one NOP.

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
rfreeman
Newbie cheater
Reputation: 0

Joined: 26 Jan 2010
Posts: 17

PostPosted: Sat Mar 26, 2011 6:57 am    Post subject: Reply with quote

Much thanks. You've cleared up a problem I had, I was forgetting to put db in front of the bytes, haha. Cheers.
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 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)