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 


What does it do?

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

Joined: 11 Jan 2014
Posts: 2

PostPosted: Sat Jan 11, 2014 3:59 pm    Post subject: What does it do? Reply with quote

Hello ^^
i am from Germany so I am not very good in English...
lets start. I have here a little script:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
label(whatever)
registersymbol(whatever)
aobscan(aob1,D9 58 58 D9 45 E4 D9 58 50)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

originalcode:


exit:
jmp returnhere

aob1:
whatever:
jmp newmem
nop
nop
nop
returnhere:




[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
whatever:
db D9 58 58 D9 45 E4 D9 58 50
unregistersymbol(whatever)

I tried to do that in C++ but there was something wrong. So please help me to understand what this Script exactly do so that I can do the same in C++.
If I nop the function there is a wrong result but when I start the script the result is right..
Thank you Smile
Back to top
View user's profile Send private message
Keule
Cheater
Reputation: 0

Joined: 08 Aug 2012
Posts: 25

PostPosted: Sun Jan 12, 2014 11:42 am    Post subject: Reply with quote

Code:
OriginalBytes:
D9 58 58 D9 45 E4 D9 58 50

Translated, after Script got activated:
E9 ?? ?? ?? ?? 90 90 90 50

jmp (E9) newmem (allocated memory address in hex, 4 bytes = ?? ?? ?? ??)
nop (90)
nop (90)
nop (90)
push eax (50)


But there is no Code to execute in the "newmem" written, so i guess patching the Bytes to the following will does the same as the Script:

Code:
OriginalBytes:
D9 58 58 D9 45 E4 D9 58 50

Patch:
90 90 90 90 90 90 90 90 50
Back to top
View user's profile Send private message
xR0fl
How do I cheat?
Reputation: 0

Joined: 11 Jan 2014
Posts: 2

PostPosted: Sun Jan 12, 2014 12:39 pm    Post subject: Reply with quote

I am not sure..
I did a pattern scan in c++ and it found the right one.. the script only nop 3 times or? and you nop 9 times... I only know that when I manually nop the function there isnt a result but when I launch the script it work very good..
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 891

PostPosted: Sun Jan 12, 2014 11:16 pm    Post subject: Reply with quote

xR0fl wrote:
I am not sure..
I did a pattern scan in c++ and it found the right one.. the script only nop 3 times or? and you nop 9 times... I only know that when I manually nop the function there isnt a result but when I launch the script it work very good..


It should probably be eight nops... five for the jump, and three for the existing nops. The bottom line, however, is that if you don't understand how to do it in CE then you're not going to understand how to do it in C++.
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