xXMADEXx Posted August 7, 2014 Share Posted August 7, 2014 Hello. First of all I don't know if there's another method to this, because I haven't really looked into it very much, but I think MTA should make getCommandHandlers. I think that MTA should make the function getCommandHandlers that returns a table of commands so that players could try to detect if a script has a backdoor or not. Maybe there should be an argument of the resource you want to get, but if it's not set then it will just return all commands. This way people could just run a basic script such as: for i, v in pairs ( getCommandHandlers ( resourceRoot ) ) do outputChatBox ( "Command: ".. tostring ( i ).." | Callback: "..tostring ( v ) ) end and they would know if the script has an obvious backdoor, even if it's compiled. The returned table should be something like the following: { ['CommandName'] = { resource = "The resource element where the command is located", callback = "The function the command executes", restricted = "restricted from addCommandHandler", caseSensitive = "is the command case sensitive" }, -- example: ['newcar'] = { resource = getResourceFromName ( "core_commands" ), callback = function ( ) end, restricted = false, caseSensitive = true } } Link to comment
DiSaMe Posted August 7, 2014 Share Posted August 7, 2014 local addCommandHandler_real = addCommandHandler function addCommandHandler(...) local added = addCommandHandler_real(...) if added then local commandName = ... outputChatBox("Added command: "..commandName) end return added end Link to comment
xXMADEXx Posted August 9, 2014 Author Share Posted August 9, 2014 local addCommandHandler_real = addCommandHandler function addCommandHandler(...) local added = addCommandHandler_real(...) if added then local commandName = ... outputChatBox("Added command: "..commandName) end return added end I'm a freaking idiot idk why i didn't think of just re-writing the function :C Link to comment
myonlake Posted August 28, 2014 Share Posted August 28, 2014 It is not a rewrite. It is a wrapper function. Link to comment
Bonsai Posted August 29, 2014 Share Posted August 29, 2014 It is not a rewrite. It is a wrapper function. ... He obviously meant you can do most stuff with existing functions somehow, but its still better to have it built-in. Link to comment
qaisjp Posted September 11, 2014 Share Posted September 11, 2014 This is useless as a means of backdoor prevention. Command arguments and any other method of input can be used. Think konami code. Link to comment
Recommended Posts