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 


Call Function Crash how to ?

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

Joined: 20 Sep 2015
Posts: 1

PostPosted: Sun Sep 20, 2015 6:52 am    Post subject: Call Function Crash how to ? Reply with quote

Hi, i try to call a function via lua / thread but i donīt get it work. It executes and workes but instantly crashes after that.
Lua:
[code]
alloc(TThread_,100)
createthread(TThread_)
TThread_:
mov edx,#111
push edx
call reverseme.AddBy1
ret
[/code]
reverseme.AddBy1:
[code]
reverseme.AddBy1 - 55 - push ebp
reverseme.AddBy1+1- 8B EC - mov ebp,esp
reverseme.AddBy1+3- 8B 45 08 - mov eax,[ebp+08]
reverseme.AddBy1+6- 50 - push eax
reverseme.AddBy1+7- 68 08210E01 - push reverseme.GS_ExceptionPointers+8 // Number:%s
reverseme.AddBy1+C- E8 AFFFFFFF - call reverseme.printf
reverseme.AddBy1+11- 83 C4 08 - add esp,08
reverseme.AddBy1+14- 5D - pop ebp
reverseme.AddBy1+15- C3 - ret
[/code]
It displays the printf but instantly crashes after it.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sun Sep 20, 2015 10:20 am    Post subject: Reply with quote

AddBy1 looks like it uses the cdecl calling convention(ret has no number behind it but takes one parameter), so the caller is responsible for cleaning up the stack

add
Code:

add esp,4

after
Code:

call reverseme.AddBy1


(before ret)

_________________
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
SlicerHeicer
How do I cheat?
Reputation: 0

Joined: 20 Sep 2015
Posts: 1

PostPosted: Sun Sep 20, 2015 9:13 pm    Post subject: Reply with quote

Dark Byte wrote:
AddBy1 looks like it uses the cdecl calling convention(ret has no number behind it but takes one parameter), so the caller is responsible for cleaning up the stack

add
Code:

add esp,4

after
Code:

call reverseme.AddBy1


(before ret)

Thank you :D
But iīve tick the wrong box for my age on registering can you switch me o.O ? (I am 15)
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