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 


Problem with label, alloc

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

Joined: 14 Mar 2012
Posts: 6

PostPosted: Wed Mar 14, 2012 10:38 pm    Post subject: Problem with label, alloc Reply with quote

hi all,

i have a problem with my script.

[enable]
label (mylabel)

3000000:
jmp mylabel

mylabel:
mov [eax],FFFFFFFF
jmp mylabel

[Disable]
3000000:
add [eax],al



it says "Error on line 2: "label(mylabel)": this instruction could not be compiled.

i gett the same error when using alloc/dealloc. I want my script to put -1 into the address and loop it to get a "freeze" effect. i cant see anything wrong with the script, i dont know why it wont compile. if it helps im on windows 7 64bit.

any help?

thanks


Last edited by Firev2 on Thu Mar 15, 2012 3:29 am; edited 2 times in total
Back to top
View user's profile Send private message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Thu Mar 15, 2012 1:39 am    Post subject: Reply with quote

1) There should be no space between label and (mylabel)
it should be label(mylabel) (at line 2)
2) You have created an infinite loop at line 9
3)add eax, al // this instruction can't be compiled. you should add registers/memory of equal size. (at line 13)
you can use
add eax, eax
4) At disable you should also specify address (here 3000000: )

Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,500) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)

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

originalcode:
mov dword ptr [eax],(int)-1

exit:
jmp returnhere

3000000:
jmp newmem
nop
nop
returnhere:


 
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
3000000:
add eax,eax

Is this what you want?

_________________
Back to top
View user's profile Send private message Send e-mail
Firev2
How do I cheat?
Reputation: 0

Joined: 14 Mar 2012
Posts: 6

PostPosted: Thu Mar 15, 2012 3:24 am    Post subject: Reply with quote

sorry, forgot to put address in disable section. add eax,al is the addresses opcode at rest (original opcode).


basically the problem was that you arnt supposed to put a space between label and the name. thanks for the post ^^


this is my script now:

Code:
[enable]
label(tumble)
342a72a0:
jmp tumble

tumble:
342a72a0:
mov [eax],FFFFFFFF
jmp tumble

[disable]
342a72a0:
add [eax],al


but it still only puts -1 into the address once. Sad

freezing the value at -1 acts as a no cooldown on the skill.
Back to top
View user's profile Send private message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Thu Mar 15, 2012 6:38 am    Post subject: Reply with quote

you should alloc some space and then jump to the allocated space
Code:
[enable]
alloc(tumble,24)

342a72a0:
call tumble

tumble:
mov [eax],FFFFFFFF
ret

[disable]
dealloc(tumble)
342a72a0:
add [eax],al


also ... if the size of the original code is equal to your code do so

Code:
[enable]

342a72a0:
mov [eax],FFFFFFFF

[disable]

342a72a0:
add [eax],al

/* but in this case it will not work because
mov [eax],FFFFFFFF
and
add [eax],al
have different bytes number */

_________________
... Fresco
Back to top
View user's profile Send private message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Thu Mar 15, 2012 7:40 am    Post subject: Reply with quote

tumble:
342a72a0:
mov [eax],FFFFFFFF
jmp tumble

this code will freeze complete thread of the game where you are injecting this code. I think this is not what you want.

If you want to freeze it through script use lua script.

_________________
Back to top
View user's profile Send private message Send e-mail
biex
How do I cheat?
Reputation: 0

Joined: 30 Jan 2012
Posts: 5

PostPosted: Fri Mar 16, 2012 4:13 am    Post subject: Reply with quote

What you are doing is completely unnecessary, all you wish to do is to have it at -1 while enabled..
this is all you need:

[enable]
342a72a0:
mov [eax],#-1

[disable]
342a72a0:
add [eax],al
Back to top
View user's profile Send private message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Fri Mar 16, 2012 7:02 am    Post subject: Reply with quote

biex wrote:
What you are doing is completely unnecessary, all you wish to do is to have it at -1 while enabled..
this is all you need:

[enable]
342a72a0:
mov [eax],#-1

[disable]
342a72a0:
add [eax],al

not at all ... have you calculated the length of the instruction ?
"add [eax],al" have less bytes than "mov [eax],#-1" therefore when you enable the code some instructions after 342a72a0 will be replaced ... therefore the code i suggested works better, because it doesn't replace any of the original instructions Smile

Code:
[enable]
alloc(tumble,24)

342a72a0:
call tumble

tumble:
mov [eax],FFFFFFFF
ret

[disable]
dealloc(tumble)
342a72a0:
add [eax],al


PS: for better code ... use auto assemble
anyways if you could give us 4 the instructio before and after 342a72a0: add [eax],al
that would help to make a real working code

_________________
... Fresco
Back to top
View user's profile Send private message
Firev2
How do I cheat?
Reputation: 0

Joined: 14 Mar 2012
Posts: 6

PostPosted: Sat Mar 17, 2012 1:11 pm    Post subject: Reply with quote

biex wrote:
What you are doing is completely unnecessary, all you wish to do is to have it at -1 while enabled..
this is all you need:

[enable]
342a72a0:
mov [eax],#-1

[disable]
342a72a0:
add [eax],al


this was the most obvious and first thing to try. it didnt work at all. all it does it put it in once.
Back to top
View user's profile Send private message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Sat Mar 17, 2012 4:47 pm    Post subject: Reply with quote

just give us a few instructions before and after the code, so that we can help you develop your script.
_________________
... Fresco
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