So this is a complete remake of
gmcl_external. It is no longer a module that needs to be loaded by Lua. Instead, you can now inject it into hl2.exe and load Lua through console commands. This is a module to prevent servers from stealing your scripts, and to offer a bit of stealth while doing so.
What's New
As I've said earlier, instead of loading it via require, you may now simply inject it into hl2.exe and load scripts through console commands. There are no more encryption features, mainly because they were shitty anyways. This time around I wanted to focus on becoming a stealthbomber. I've also added a console command to load external binary modules (gmcl_*****_win32.dll files). All files are relative to My Documents\external, so create a file called "external" in your documents folder and put all your files there. One thing to note is that there is no more functionality to load an entire folder of scripts.
You may load external files regardless of the value of sv_allowcslua, which means you do not need a bypasser of any kind.
Console Commands
external takes two arguments, the second one being optional. The first argument is the name of the external script you want to run, and the second one is a
fake source file. Some anti-cheats use the debug library to check where a script is being ran from, and if they detect that it's from an unknown file, they may ban you. You can fake them out with this second argument. If you do not include a second argument, the fake source file will simply be "external". In some cases, you may want to
not fake the source file. In this case, if you specify "!" as the second argument, the source file will not be hidden at all, which means it will show the true name of your file in the debug information. Useful for tracking down errors with many external files being loaded.
Every time you use the
external console command, a raw global function called
external is created. When your script is done running, the function is destroyed. This is for added stealth. Ideally, you should create an external loader.lua that will load other external scripts of yours.
Code:
--[[
Save a copy of the external function because it's going to be destroyed.
This only really needs to be done if the script isn't instantaneous, but
I do it anyways just for uniformity.
--]]
local external = external
-- It works just like the console command.
external("someotherfile.lua")
external("piss_out_my_ass.lua", "lua/includes/init.lua")
external("yummygummybears.lua", "!")
require takes one argument: the binary module to load. Keep in mind that this is also relative to My Documents\external, so put your module there along with your scripts. It does NOT need to be in the gmcl_*****_win32 format. It can be named whatever you want.
Every time you want to join a new server, you should go to the main menu, type the command in again with the name of your module, connect to a new server, and then load the module with the command again. Not doing this procedure can cause Garry's Mod to crash, depending on the module.
Upon injection you should see what's in the picture below.
Virus Scans
Thanks to @
MeepDarknessMeep for dealing with my autism. Use
Extreme Injector to inject the .dll into hl2.exe.
love, peace, and bacon grease.