• Export data out of garry's mod
    8 replies, posted
I need to get some data (valid UTF-8, and I can use base64 anyway) to an external program, using something like sockets, for now the only thing I found was using the http library (but that looks bad) or use files (less dirty, but doesn't look as good as sockets for transmitting data). So my question is : Is there any other way I can get data from a lua script running in gmod to an external program•?
Maybe you could use [URL="https://facepunch.com/showthread.php?t=1393640"]gm_bromsock[/URL]?
[QUOTE=geferon;52657620]Maybe you could use [URL="https://facepunch.com/showthread.php?t=1393640"]gm_bromsock[/URL]?[/QUOTE] Thanks, this looks like exactly what I wanted, is there anything that says how to install it on a dedicated server (linux VM)•?
[QUOTE=dunkare;52658079]Thanks, this looks like exactly what I wanted, is there anything that says how to install it on a dedicated server (linux VM)•?[/QUOTE] Just throw the appropriate module in /lua/bin
[QUOTE=txike;52658088]Just throw the appropriate module in /lua/bin[/QUOTE] This probably felt like a stupid question, I actually found this before I saw your answer [url]https://wiki.garrysmod.com/page/Creating_Binary_Modules[/url] Do you think this is a security issue, I mean, it lets you load arbitrary shared libraries…
Well, lua scripts too, but you can read those, while modules you cant at least if you read source code of it
[QUOTE=dunkare;52658131]This probably felt like a stupid question, I actually found this before I saw your answer [url]https://wiki.garrysmod.com/page/Creating_Binary_Modules[/url] Do you think this is a security issue, I mean, it lets you load arbitrary shared libraries…[/QUOTE] Gmod tries to load the library and call gmod13_load(), and fails if the function isn't available, so it's not really a security issue
[QUOTE=gonzalolog;52658311]Well, lua scripts too, but you can read those, while modules you cant at least if you read source code of it[/QUOTE] Yes, but lua scripts are sandboxed (removing dangerous functions) and gmod doesn't load precompiled code to prevent malicious bytecode, so lua scripts should be much safer. [QUOTE=Luni;52658447]Gmod tries to load the library and call gmod13_load(), and fails if the function isn't available, so it's not really a security issue[/QUOTE] Checking if a function exists doesn't fix the fact that arbitrary bytecode can be loaded, it can be safe only if it uses some very good sandboxing (like this [url]https://github.com/mniip/sandbox[/url] even if this one prevents network sockets and only works on linux, but you get the point), but I doubt gmod uses any.
You wouldn't use modules if there's something you can do in Lua, that's pretty basic to understand Can't see why are you bothering that much about if this allows you or it doesn't allow you to run arbitrary code, modules are intended to allow you to have full control, thing that I would love for developers in Gmod within lua
Sorry, you need to Log In to post a reply to this thread.