A Garry's Mod Script Enforcer bypass to allow lua_openscript_cl
commands to execute.
- 💫 Easy to use
- 💡 Simple and safe
- 💥 64-bit and 32-bit support
- Copy
steamapps\common\GarrysMod\garrysmod\bin\client.dll
(x86) orsteamapps\common\GarrysMod\bin\win64\client.dll
(x64) to the current directory. - Run
python patch.py
(get Python3 here). - Copy the patched
client.dll
intosteamapps\common\GarrysMod\garrysmod\bin\client.dll
(x86) orsteamapps\common\GarrysMod\bin\win64\client.dll
(x64). - Start Garry's Mod.
- Load scripts from your
lua/
directory withlua_openscript_cl <filename>
using the console.
Get the latest .dll from the releases page.
- Drag and drop
client.dll
intosteamapps\common\Garrysmod\bin
. - Restart Garry's Mod
- Load scripts from your
lua/
directory withlua_openscript_cl <filename>
.
This isn't guaranteed to work if client.dll
in this repository has not been updated and patched for a new version of Garry's Mod.
This NOPs the JNZ
branch called by lua_openscript_cl
and adds mov byte ptr [ecx + b8], 1
(x86) or mov byte ptr [rcx + 168], 1
(x64) aka byte patch C681B800000001FF 90 84 01 00 00 5E 5D C3
to the end of the function call to escalate lua execution privileges and change where the file loader searches for your script. For more info see this article.
This patch does NOT modify the sv_allowcslua
convar whatsoever which can easily be detected by servers, and otherwise is fully undetectable (there are no sigchecks on client.dll
) + can't get you VAC banned (no VAC on garry's mod).
To obfuscate your scripts, run this Python3 script which outputs a new script that base64 encodes the script into base64 and then decodes it. Alternatively, you should override render.capture
which can be used by server admins to take screenshots.
Check out Chrollo which lets you block anti-cheat scripts among many other things.
code = ""
print("Input the path to your script:")
path = input()
with open(path, 'r') as file:
code = file.read()
from base64 import b64encode
code = b64encode(bytes(code, 'utf-8'))
final = "local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \
function dec(data) \
data = string.gsub(data, '[^'..b..'=]', '') \
return (data:gsub('.', function(x) \
if (x == '=') then return '' end \
local r,f='',(b:find(x)-1) \
for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end \
return r; \
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x) \
if (#x ~= 8) then return '' end \
local c=0 \
for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end \
return string.char(c) \
end)) \
end \
RunString(dec(\"" + code.decode("utf-8") + "\"))"