google-site-verification: googlebaca44933768a824.html [GMod 13] [Lua] Automatically find a server's whitelisted identifier to hook with - Old Royal Hack Forum

Announcement

Collapse
No announcement yet.

[GMod 13] [Lua] Automatically find a server's whitelisted identifier to hook with

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [GMod 13] [Lua] Automatically find a server's whitelisted identifier to hook with

    A friend of mine told me about servers detecting lua hooks that aren't supposed to be by checking the client's hook table against a whitelist the server has for it's known addon hooks, so I made this little feature as a preventative measure for any gmod anticheats that happen to spring up(the only prominent enough server(s) I've run into that checks for hooks like this would be Lifepunch's server(s)). As such, the code below is more of a PoC than anything.

    What this function does is it goes through the server's own list of addon's hooks and tries to find any that hook the particular function you want to find, and if it does, it returns the first identifier used for that particular function you want to hook. With the whitelisted identifier to your preferred hooked function, you can then run your own hook with the same identifier, so that you can fly by undetected by any whitelist checking for hooks.
    Code:
    local function GetWhitelistedIdentifier(hookfunction)
    	for k, v in pairs(hook.GetTable()) do --for loop to grab each key and it's value from the hook table
    		if (k == hookfunction) then --if hook.GetTable()[k] == our hooked function's name then
    			local availableidentifier = table.FindNext(hook.GetTable()[k]) --the location of the availableidentifier we can hook.. (I left this the way it is in this post for better documentation, optimize it if you do happen to use it.)
    			return (table.KeyFromValue(hook.GetTable()[k],availableidentifier)) --return the actual name of the availableidentifier we can hook.
    		end
    	end
    	return -1 --return failure, passed all and didn't find a whitelisted identifier for our hook.. 
    end
    This concept could be utilized in anticheats as well. If you really wanted to use it in such a way, you could compare your server's known hooks to the client's hooks, then act accordingly. I'm sure this is an old idea, but I thought I'd share this with royalhack, as I've not even contributed to the community itself in the longest while.

    #2
    Re: [GMod 13] [Lua] Automatically find a server's whitelisted identifier to hook with

    just detour hook['Run']
    Originally posted by extern4ever
    weaboo assburger world

    Comment


      #3
      Re: [GMod 13] [Lua] Automatically find a server's whitelisted identifier to hook with

      Originally posted by p0mf View Post
      just detour hook['Run']
      Even though garry's too dumb to utilize vac to it's fullest extent in his own game, I'd rather not risk anything more than I'd need to if I can do just as well staying within lua's confines, but I understand your argument and where you're coming from with it. I would just prefer to use lua because of it's ease of access, but I still do what I absolutely have to outside of lua, i.e. cvar bypasses, nospread, and other such things. I keep everything else lua, otherwise. Call me what you want, but I'm content with my current situation. In future gmod versions, if I'm even still interested in it then, as long as garry's dumb when it comes to restricting lua, I'm not going to be using straight up injected cheats. If I did though, I'd probably use rh for any hooking I'd do, anyways.

      Comment


        #4
        Re: [GMod 13] [Lua] Automatically find a server's whitelisted identifier to hook with

        Originally posted by lolmaoman View Post
        Even though garry's too dumb to utilize vac to it's fullest extent in his own game, I'd rather not risk anything more than I'd need to if I can do just as well staying within lua's confines, but I understand your argument and where you're coming from with it. I would just prefer to use lua because of it's ease of access, but I still do what I absolutely have to outside of lua, i.e. cvar bypasses, nospread, and other such things. I keep everything else lua, otherwise. Call me what you want, but I'm content with my current situation. In future gmod versions, if I'm even still interested in it then, as long as garry's dumb when it comes to restricting lua, I'm not going to be using straight up injected cheats. If I did though, I'd probably use rh for any hooking I'd do, anyways.
        detour it in lua lol
        Code:
        _G['hook']['Run'] = Detour( _G['hook']['Run'], function( name, args )
        	// do shit
        	return detours[_G['hook']['Run']]( name, args );
        end );
        Originally posted by extern4ever
        weaboo assburger world

        Comment


          #5
          Re: [GMod 13] [Lua] Automatically find a server's whitelisted identifier to hook with

          Originally posted by p0mf View Post
          detour it in lua lol
          Code:
          _G['hook']['Run'] = Detour( _G['hook']['Run'], function( name, args )
          	// do shit
          	return detours[_G['hook']['Run']]( name, args );
          end );
          I didn't know you could do such a thing with gmod's lua. I'm going to hold to my excuse of only starting to mess with gmod since a couple days ago, but your method blows mine out of the water either way. :x

          Comment

          Working...
          X