Garrysmod Lua Dumper & Runner, written in Rust.
C:Users<User>autorunlua_dumps<ServerIP>..
(asynchronously to avoid i/o lag)lua_run
and lua_openscript
in an external consoleautorun.lua
), to detour and bypass any 'anticheats'autorun/logs
)autorun/plugins
)Autorun can also be used as a menu plugin / required from lua automatically from the menu state.
gmsv_autorun_win<arch>.dll
file into your garrysmod/lua/bin
folder.require("autorun")
at the bottom of garrysmod/lua/menu/menu.lua
The traditional (but more inconvenient) method to use this is to just inject it.
Autorun features scripthook, which means we'll run your script before any other garrysmod script executes to verify if you want the code to run by running your own hook script.
*This runs in a separate environment from _G
, so to modify globals, do _G.foo = bar
Also note that if you are running in autorun.lua
Functions like http.Fetch
& file.Write
won't exist.
Use their C counterparts (HTTP
and file.Open
)
See an example project using the scripthook here.
C:Users<User>autorun
├── autorun.lua # Runs *once* before autorun
├── hook.lua # Runs for every script
├── lua_dumps # Each server gets a folder with their IP as the name.
│ ├── 192.168.1.55_27015
│ └── X.Y.Z.W_PORT
├── logs # Logs are saved here
│ └── YYYY-MM-DD.log
├── bin # Store binary modules to be used with Autorun.requirebin
│ └── gmcl_vistrace_win64.dll
├── plugins # Folder for Autorun plugins, same behavior as above autorun and hook.lua, but meant for plugin developers.
│ └── Safety
│ ├── src
| | ├── autorun.lua
| | └── hook.lua
│ └── plugin.toml
├── settings.toml # See autorun/src/configs/settings.toml
└── ...
You can find what is passed to the scripthook environment in fields.lua as an EmmyLua definitions file.
This could be used with something like a vscode lua language server extension for intellisense ?
hook.lua
This file runs before every single lua script run on your client from addons and servers.
You can return true
to not run the script, or a string to replace it.
-- Replace all 'while true do end' scripts with 'while false do end' ?
local script = Autorun.CODE
if script:find("while true do end") then
Autorun.log("Found an evil script!")
return string.Replace(script, "while true do end", "while false do end")
end
You can find more here
You can get a 'stable' release from the releases.
You can get the absolute latest download (from code in the repo) in the Github Actions tab
Note it may not work as expected (but I'd advise to try this out before trying to report an issue to see if it has been fixed)
If you are using this as a menu plugin ?, make sure the DLL is named gmsv_autorun_win<arch>.dll
You may want to build this yourself if you want to make changes / contribute (or don't trust github actions for whatever reason..)
build_win_32.bat
or build_win_64.bat
.