Lua Modules / Binary Modules

I am sorry that I may not understand but I am curious. I saw this tutorial:

I have heard about modules for gmod before but…

What exactly do they do?
What is the point of it?
What are they used for?
What can they be used for?
How is it better then a lua script in the lua folder?

Sorry if these questions seem a bit noobish but this is how I learn, I ask questions. Also please note I have done some searching and have found not a lot of information, which is why I decided to make a thread for this.

What exactly do they do?: They add lua bindings to engine functions/custom functions that garry has not added, will not add, etc.

What is the point of it: Say you take a binary modules such as…RawIO for example. Garry made it so that raw lua can not write or read files outside of the garrysmod folder, making this module useful for reading information outside of the folder.

What are they used for: They are typically used for people who need extra functions that can’t be done in lua

What can they be used for: They can be used for pretty much anything you can code in C++. This ranges from cheats, to useful modules connecting lua functions to API’s (such as the Steamworks API, allowing you to make chat clients in lua, or to interact with the steam program via lua functions)

How is it better then a lua script in the lua folder: Like I said, most of the time a binary module is only made/used when it cannot be done in lua, otherwise it just isnt as portable since you can’t stream the module to the client when they join.

The questions are kind of redundant, but I tried to answer them the best I can.

Binary modules are just DLL’s loaded into gmod to add extra lua functions that you simply cannot make in lua, that’s it. Sometimes they fix things, sometimes they add things, sometimes they don’t do a whole lot.

Is it possible to put all your lua code into a module, and then put that dll in the addons folder so people cant get your lua source? Also if you make a dll though doesnt it have a high chance of getting you vac banned if it is just lua code that does not edit memory? And thank you for your answer, it was quite useful.

In Garry’s Mod certain features in VAC are disabled, so your module can edit memory and do pretty much whatever you want it to do, without being detected by VAC. Unless Garry manually blocks your module, then you are safe.

You can’t stop someone who knows what they are doing from getting the lua source that you are loading into the gamestate, whether its stored as a large string in the module, or downloaded from a webserver. You can encrypt strings, encrypt your lua, obfuscate your lua, etc but nothing can stop someone who knows how to reverse. As far as I know, you can essentially stop them from seeing your actual lua source via compiling your lua and loading it into the gamestate pre-compiled, but even then it may be possible to decompile it and view raw lua.

Assuming you are trying to cheat, if you were to make a private cheat, and didn’t give it out to anyone, the chances of you getting banned are almost 0, but as soon as Garry/ValVe got a hold of it you would be fucked (since I doubt you have enough knowledge of C++ to make custom modules for each user, no offense).

I take no offense, I don’t know a lot of C++. This week I have just been learning lua coding and I have been coding in for 4 years though. I saw a guide on making a binary module but when you say getting your module blocked, is it basically they update VAC to detect your encrypted strings? So technically making a polymorphic module would be undetectable forever? Als its not that I plan on making a cheat its that I would love to try put my scripts into a dll and then use my hwid system to load the dll.

I don’t really care what you want to do, I’m just here to help ;).

Basically, once Garry grabs a hold of your module(assuming he wants to block it because he knows it’s a cheat) he will manually add your dll to a list of shit to trigger a VAC ban. I believe he uses CRC32 amongst other things I’m sure. Basically VAC will never automatically assume your cheating, no matter how much shit you do to the game (unless of course Garry as manually blocked your personal module).

So to answer your question, yes, polymorphism will keep VAC off your ass if you do it right. encrypting your strings doesn’t really matter in the case of GMOD

Ok, because I actually don’t want to make a cheat but I am also paranoid of getting a VAC ban. Lol just make an ingame webbrowser, timer, calculator and screen recorder but just to be safe, gotta have polymorphism. Also I know that scriptenforcer blocks all clientside lua scripts but if I make a dll will it still block it? I kinda wanna be able to use my own scripts because I play on a few perp servers and I want to be able to use my calculator, timer, and screen recorder in there. How could I use it without having to pp_pixelrender it?

The Lua scripts are still blocked since Scriptenforcer works inside Garry’s Lua interface. Besides, there’s no way you could load your module in the game and get the client interface (without hacking of course).

It’s incredibly easy to hook the client interface and run your scripts with a module loaded in the menu state, and you won’t be VAC banned.

How do you do this? This is new information to me.

What I don’t understand:
-Hooking the client interface
-Module loaded in the menu state (What is the menu state?)

I think you should take a step back and try and learn some more programming before trying to tackle what you are doing now.

Currently out of boredom I have now made:
All players in server SteamID and UniqueID Fetcher
Name & IP Logger (Finally got it working properly)
Admin Box Notifier (Little box in top left corner tells all Administrators and Super Administrators)

What else should I learn to do? I have read through all the lua tutorials on the GMod wiki and I understand it all completely and have tested everything and modifying it to see what does what.

So you’re replacing your SethHack…?

Not true. The features that are in CSS et al are enabled, garry just doesn’t flag stuff as cheats.

Not true. If you join a VAC enabled game and garry has decided to mark anything identifying your module as a cheat; you’re as good as banned unless you unload it beforehand.

Do I have a “hack” in there?
Is there anything that would give me an unfair advantage in the game?
I am not making and aimbot or ESP, I don’t understand why you are stalking my threads just to post about old news.

[editline]3rd February 2012[/editline]

What do you mean by this (Can you reword this or explain it in more detail please)?

Obviously. So they aren’t disabled, they just aren’t…enabled?

Who is Garry to say what is ‘cheating’ there is so many legit uses for modifying anything. Just like Deco, using the module deco can be used for many things rather then coding nospread, so he cannot assume one is cheating unless he has solid evidence or else people will randomly get VAC’d and that will cause lots of trouble.

What did Deco do?

HawkMan was caught sethhacking on my server.

Deco is a module which was most commonly used for manipulating bullet flight. Like I said earlier that’s not it’s only use, just a common one.

Custom Bullet Flight Trajectory + Tracer = Bullets tha make hearts around the target before killing it?
…Seems… Legit…