What is lua_shared.dll?

Hey,

This is not a thread about anti virus false-positives but rather an Q&A I guess about what it is. Basically I want to know what methods are inside. I’m asking about this specific dll because 1: It has lua in the name and 2: Iv recently started developing in C Lua and I would like to know if I can use any methods that are inside of this particular dll.

I know this probably belongs in the programming thread and I tossed up between putting it here or there and decided it was more Garry’s Mod related so I do apologize if this is in the wrong forum.

Linux lua_shared.so symbols: https://gist.github.com/mcd1992/1550afa2b09057139200

I don’t belive you can directly use the lua_* functions, at least not without pulling a few strings.

Make sure to look at garry’s github example and the wiki example.

It is mostly just luajit with replacements to integrate into gmod. You can easily try loading it with something like this https://gist.github.com/Python1320/862abef8ad42c2839160 and link with lua_shared_srv.so on linux server and on windows you need files from here: svn://svn.metastruct.org/gbins for the linking.

Thanks heaps for your reply. -snip- On a second look, I noticed it has the type-checking that you can use in Garry’s Mod. I MIGHT looking into making a binary for Garry’s Mod depending on what I need to do. Thanks again.

Download this https://github.com/NHargreave/GMod-Examples/tree/master/module

Run Premake (it’s in the support directory) and you’ll have a working GMod module where you can use the C API ready to be compiled (on Windows at least).

[editline]19th July 2014[/editline]

By the way guys, you only need to include lauxlib.h because it already includes the other required files (except lualib.h which you don’t even need).

Unless you want to insert functions from an injectable dll, mess with things in other lua states, or run lua scripts from a string, I can’t think of many uses that the stuff inside of lua_shared would have. Garry’s module headers serve as a wrapper over CBaseLuaInterface, and the functions after that in the vtable consist of methods that run modules and scripts and other random utility stuff, nothing too useful.

You can last time I tried.

lua_shared.dll contains most lua_* and luaL_* functions, it’s perfectly possible to use them in C or C++ or any other language if you know how.

You can view what functions are in with a hex editor and search for lua_ and to get the signature you can easily just google the name and write DllImports in .NET languages or GetModuleHandle and GetProcAddress in any language.

[editline]19th July 2014[/editline]

CBaseLuaInterface is basically just a wrapper over the functions in lua_shared dll, you can make everything you need using just lua_shared.

You need it if you want to code in C, and it has a shitton of useful features that Garry’s crap wrapper doesn’t.