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 


executeCodeLocal Error:Access violation

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Fri Nov 23, 2018 7:50 pm    Post subject: executeCodeLocal Error:Access violation Reply with quote

If I run this script with the CE process connected in I get this error: Error: Failure determining what func means. But if another process is connected, I get this other: Error: Access violation.
After all, what is wrong?

Code:
autoAssemble([[
    alloc(func, 100)
    registersymbol(func)

    func:
        ret
]], true, false)

executeCodeLocal('func')


Edit: CE 6.8.1 x86

_________________
...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Fri Nov 23, 2018 9:33 pm    Post subject: Reply with quote

I don't know what that first error is, but the second error can be explained by reading documentation in celua.txt:
Quote:
executeCodeLocal(addres, parameter OPTIONAL): address - Executes a stdcall function with 1 parameter at the given address in the target process.

stdcall is callee-cleanup. Regardless of whether or not you passed an argument in Lua, the space for the parameter still exists, and you need to clean that up by using ret 4.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Sat Nov 24, 2018 5:29 am    Post subject: Reply with quote

I was able to find out the reason for the error, it is a bug in CE x86. In the x64 version it works without errors.
The solution I found to this problem was in EC x86 was this.
Code:
executeCodeLocal( getAddress('func', true) )

_________________
...
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