You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 12, 2025. It is now read-only.
This is a Rust library that contains bindings for tinkering with the lua c api in garrysmod through bindings using rust-dlopen.
3
+
This is a crate that contains bindings for using the lua c api in garrysmod through bindings using rust-dlopen.
5
4
Can be used for either binary modules or just manual injections into gmod, like with [Autorun-rs](https://github.com/Vurv78/Autorun-rs)
6
5
7
-
More information on binary modules: https://wiki.facepunch.com/gmod/Creating_Binary_Modules
6
+
This works by finding a ``lua_shared.dll`` file relative to the currently running program, so you need to make sure your file is either in ``GarrysMod/bin/`` or ``GarrysMod/garrysmod/bin`` for srcds servers. The library will panic if the file is not found otherwise until it is eventually needed.
8
7
9
-
An example module can be found below.
8
+
More information on binary modules can be found on the garrysmod wiki: [Creating Binary Modules](https://wiki.facepunch.com/gmod/Creating_Binary_Modules) and an example can be found at the bottom of this file.
10
9
11
-
## How to build
10
+
## Usage
12
11
13
-
Add this to your Cargo.toml.
12
+
Add this to your ``Cargo.toml`` file
14
13
```toml
15
14
[lib]
16
15
crate-type = ["cdylib"] # This tells rust we want to create a .dll file that links to C code.
@@ -19,17 +18,18 @@ crate-type = ["cdylib"] # This tells rust we want to create a .dll file that lin
Also do this if you have never compiled to 32 bit, to get rustup to install 32 bit versions of everything you need
26
26
``rustup target add i686-pc-windows-msvc``
27
27
28
28
## Notes
29
-
The nature of this crate is super unsafe.
30
-
Using rust sort of defeats the purpose because of the sheer amount of times you'll have to convert strings from and to C, and call lua c api functions.
29
+
* I have never tested this outside of Windows and won't.
30
+
If there are any issues on other platforms, I will gladly accept any PRs you may make but I won't be able to help you myself.
31
31
32
-
Also, I have never tested this outside of Windows and won't. If there are any issues on other platforms, I will gladly accept any PRs you may make but I won't be able to help you myself.
32
+
* The nature of this crate is super unsafe and sort of defeats the purpose of rust's safety because of the interfacing you require to unsafe C code and the nature of linking to them.
0 commit comments