Hello! I was wondering if there was any way to check an integrity of a script by reading its source.
I am attempting to make a script checker that reads a scripts source to check the integrity if its code. I have tried Script.Source but its for Plugins only. (Plugin Security)
Is there anyway I can achieve this or is there an alternative of checking integrity of scripts?
You could do something similar to how I reverse engineer those free model backdoors. Though you will have to do some manual labor.
The concept behind the hood is to wrap the entire environment that the “insecure” script uses. What I will do is have the script require my module, and upon the module’s returned function being called I get the environment calling the script and I start wrapping functions such as require and variables such as game.
You can get the environment calling a given function by using getfenv(2). Setting variables is trivial
local callingEnvironment = getfenv(2)
local newGame = wrap(game) --// assumed predefined `wrap` function that logs all __index's
callingEnvironment.game = newGame
I suggest you look into this for a tutorial on how to wrap userdatas in a recursive way.