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 


Bit of script trouble

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
onvoloper
Master Cheater
Reputation: 0

Joined: 05 Jul 2006
Posts: 294

PostPosted: Wed Jul 18, 2007 11:17 pm    Post subject: Bit of script trouble Reply with quote

Hey, I'm having trouble making my code injection script into one I can put on my CT. I've got it so I can put it on my table and enable it but I cant disable it...Here are the 2 scripts;
The CT one;
Code:
[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

00502A83:
jmp newmem
nop
nop
returnhere:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here, or edit the code below like I did xD


originalcode:
add [edx],a
jmp 00502a97
fld [ebx+08]

exit:
jmp returnhere

[DISABLE]
add [edx],eax
jmp 00502a97
fld [ebx+08]
dealloc(newmem,2048)


The Code Injection One;
Code:
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

00502A83:
jmp newmem
nop
nop
returnhere:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here, or edit the code below like I did xD


originalcode:
add [edx],a
jmp 00502a97
fld [ebx+08]

exit:
jmp returnhere


I'm gathering theres something wrong with my disable section...
These scripts are for Hit the Ball...a sample game from game maker. I thought it'd be a nice easy program to make my 1st script for Very Happy
If you can help thanks Very Happy
Edit: Could it be that it just won't turn off and the disable section is right? Laughing to make meh better at scripts.
AND do you have to have the game to help me cuz that would limit who could help... Crying or Very sad
One more thing can you say if theres nothing wrong with it?
Back to top
View user's profile Send private message
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6301

PostPosted: Thu Jul 19, 2007 8:34 am    Post subject: Reply with quote

You have dealloc in there wrong. You dont need to specify a size when deallocating. Also it can be at the end like you have it or beginning under disable. I found it makes no difference.
Also you need to put the address of the instructions that need to be written back to. If not it doesnt know where to write the code when disabled.

*Also the code is doing nothing, Because you didn't write anything to inject.


Fixed:
Code:
[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

00502A83:
jmp newmem
nop
nop
returnhere:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here, or edit the code below like I did xD


originalcode:
add [edx],a
jmp 00502a97
fld [ebx+08]

exit:
jmp returnhere

[DISABLE]
dealloc(newmem)<------Just deallocate like this.
00502A83:<--- Missing "it needs to know where to write original code back
add [edx],eax
jmp 00502a97
fld [ebx+08]
Back to top
View user's profile Send private message
onvoloper
Master Cheater
Reputation: 0

Joined: 05 Jul 2006
Posts: 294

PostPosted: Fri Jul 20, 2007 6:47 pm    Post subject: Reply with quote

Thanks Very Happy I'll try n do this to some other ones now.
yay
I didn't wanna just use urs so I tried to edit mine
Code:
[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

00502A83:
jmp newmem
nop
nop
returnhere:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here, or edit the code below like I did xD


originalcode:
add [edx],a
jmp 00502a97
fld [ebx+08]

exit:
jmp returnhere
 
 
[DISABLE]
dealloc(newmem)
00502a97:
add [edx],eax
jmp 00502a97
fld [ebx+08]

What happened with is that it kept saying error in line 2 then I fixed that...I had alloc in Disable section. BUT once I fixed that it said that back could not be compiled. So I got rid of it...I tried it and it worked but this time I disabled it and then I hit a ball Very Happy and it just froze...
EDIT: I know whats wrong with my script I used
Code:
00502a97
in my Disable section instead of
Code:
00502A83
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 Gamehacking 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