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 can i detect overriding

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
exohaxor
Expert Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 101

PostPosted: Sun Mar 17, 2019 9:57 am    Post subject: how can i detect overriding Reply with quote

how can i detect overriding
for example string.reverse
how can i detect if they add

Code:

function string.reverse(a)
print(a)
end

and print out override detected
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sun Mar 17, 2019 7:18 pm    Post subject: Reply with quote

Just limit enviroment ( sandbox ).
Or if you dont want users breaking your app, initialize new lua state/enviroment.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Mon Mar 18, 2019 12:20 am    Post subject: Reply with quote

override print
_________________
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
exohaxor
Expert Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 101

PostPosted: Tue Mar 19, 2019 12:03 pm    Post subject: Reply with quote

it gives me stackoverflow if i override print and idk how to limit sandbox
_________________
hi
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Tue Mar 19, 2019 1:58 pm    Post subject: Reply with quote

If you are getting a stack overflow you are overriding incorrectly or causing a loop. Make sure that if you are re-calling an override that you use the original call and not your new override. For example:

Code:

local orig_print = print;

print = function(str)
    -- Make sure to call orig_print here instead of you want to still print!
    orig_print('[Override] ' .. tostring(str));
end

print('hello world');

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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