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 


How to allocated Function then calling that function

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Twistedfate
Expert Cheater
Reputation: 1

Joined: 11 Mar 2016
Posts: 231

PostPosted: Fri Apr 10, 2020 3:21 pm    Post subject: How to allocated Function then calling that function Reply with quote

Caller

Code:

push eax
mov eax,[skill_id]
call is_target_skill
cmp eax,1
pop eax
je code

..
...

callee
Code:

alloc(is_target_skill,2048)
registersymbol(is_target_skill)


is_target_skill:
cmp eax,#1100
jne next1
mov eax,1
ret
next1:
cmp eax,#30000
jne next2
mov eax,1
ret
//upper code is replaced with no reason
next2:
cmp eax,442
jne next3
mov eax,1
ret
next3:
cmp eax,#1095
jne not_found
mov eax,1
ret
not_found:
mov eax,0
ret



is that a good practice to call a Function ?
when I do this game Crash some times
and I found some of my allocating memory is released or written with another code .
the entry point of my functions is replaced with garbage code .
I have many Questions :
why some of my function got written ?

is that proper way for calling function or I'm doing big mistake?

labels named nex1,next2 ... could I Create label for each one like label(next1) ?



Capture.JPG
 Description:
 Filesize:  34.97 KB
 Viewed:  1297 Time(s)

Capture.JPG


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25839
Location: The netherlands

PostPosted: Fri Apr 10, 2020 4:37 pm    Post subject: Reply with quote

did you execute another script before this where you registered next1 and next2?

if in doubt, add labels.
Code:

{$strict}

helps as well

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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