Coder Social home page Coder Social logo

avisix / glua-steal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lewisclark/glua-steal

0.0 0.0 0.0 367 KB

A cross-platform Garry's Mod tool that retrieves client-side Lua files from servers

License: GNU General Public License v3.0

C++ 96.67% CMake 3.33%

glua-steal's Introduction

gluasteal

CI Badge Downloads Badge Version Badge License Badge Issues Badge

gluasteal retrieves client-side & shared Lua files from Garry's Mod servers that you join. gluasteal also allows you to execute your own Lua code on any server.

Windows usage Linux usage

Currently working on Windows & Linux (32-bit & 64-bit). Testing is required on macOS.


Features

  • Lua Dumper - Saves Lua files that are executed
  • Lua Executor - Allows you to execute your own Lua scripts
  • Lua Blocker - Block Lua scripts of your choosing
  • Concurrent IO - The Lua dumper does IO in its own thread to eliminate bottleneck and ensure maximum in-game performance
  • Supports the 32-bit and 64-bit versions of the game
  • Supports Linux and Windows

How to Use

  1. Either Download pre-built from the Releases section or build from source.
  2. Inject gluasteal into Garry's Mod, at the main menu.
  3. Optionally, set up your Lua file to be loaded.
  4. Join a server.
The gluasteal Directory

Logs and Lua files will be written to the gluasteal folder, in your home directory.

  • Windows: C:/Users/username/Documents/gluasteal/
  • Linux: /home/username/gluasteal/
  • macOS: /Users/username/gluasteal/

How to Inject

Windows

  1. Obtain an injector
  2. Add the gluasteal dll to the injector
  3. Select the Garry's Mod process
  4. Inject at the main menu

Linux

Method 1

linux-inject

Method 2

Editing the Garry's Mod launch script (hl2.sh) to preload the gluasteal library.

LD_PRELOAD=$LD_PRELOAD:/home/lewis/gluasteal.so

Method 3 (Recommended)

Using gdb

macOS

Using DYLD_INSERT_LIBRARIES (see LD_PRELOAD above)


Lua Loader (Load Before Autorun)

Place your Lua code in your gluasteal directory, in a file named gluasteal.lua This file is executed in a separate environment, not in _G, Though you will still able to access everything in _G.

This file will be executed every time a Garry's Mod Lua script is about to be executed. You can return false to stop the current file (gluasteal.SCRIPT) from being executed.

-- All scripts with the string 'derma' in their name will be blocked from executing
if (gluasteal.SCRIPT:match("derma")) then
	return false
end

gluasteal variables and functions

  • gluasteal.SCRIPT -- The path of the Garry's Mod Lua script that is about to be executed. e.g. init.lua
  • gluasteal.SOURCE -- The source code of the script that is about to be executed. e.g. do return end
  • gluasteal.VERSION -- The version of gluasteal being used
  • gluasteal.include -- A function to execute other gluasteal Lua files, relative to the gluasteal directory. e.g. gluasteal.include("other.lua")

Note that gluasteal.SCRIPT and gluasteal.SOURCE will be an empty string in files included by gluasteal.include.


Building From Source

If building with GCC, ensure you are using at least version 8 or above.

Windows

Using the Visual Studio Developer Command Prompt (requires VS build tools)

git clone https://github.com/lewisclark/glua-steal
cd glua-steal
git submodule update --init --recursive
mkdir build
cd build
cmake --help	Find a suitable generator, such as "Visual Studio 15 2017"
Select either Win32 or x64 below for the -A flag (32bit or 64bit)
cmake .. -A Win32/x64 -G <GENERATOR> -DCMAKE_TOOLCHAIN_FILE=../toolchains/msvc.cmake 
msbuild gluasteal.sln /p:Configuration=Release
Unix
git clone https://github.com/lewisclark/glua-steal
cd glua-steal
git submodule update --init --recursive
mkdir build && cd build
choose the 32bit or 64bit toolchain below (toolchains are in toolchains/ folder)
cmake .. -DCMAKE_TOOLCHAIN_FILE=../toolchains/gcc-<32bit/64bit>.cmake
make

License

Copyright (C) 2019 Lewis Clark

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

glua-steal's People

Contributors

heyter avatar lewisclark avatar ravmda avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.