Giter Site home page Giter Site logo

vurv78 / autorun-rs Goto Github PK

View Code? Open in Web Editor NEW
89.0 6.0 9.0 236 KB

Modern scripthook with lua execution and filesteal. Replacement for gluasteal and most lua executors

License: Apache License 2.0

Batchfile 0.69% Rust 95.18% Lua 4.12%
garrysmod gmod lua glua scripthook dll script game-hacking reverse-engineering windows autorun rust garrys-mod

autorun-rs's Issues

Crash on joining

<---> Autorun-rs <--->
Type [help] for the list of commands
Failed to allocate console. 5
<---> Autorun-rs <--->
Type [help] for the list of commands
Failed to open Autorun module. [Failed to set sender.]
Loaded into menu state.
Joining Server with IP XXXXXXXXXX!
warning: Unknown nb_ctl request:  4
warning: Unknown nb_ctl request:  4
warning: Unknown nb_ctl request:  4
warning: Unknown nb_ctl request:  4
warning: Unknown nb_ctl request:  4
warning: Unknown nb_ctl request:  4
thread '<unnamed>' panicked at 'byte index 3 is not a char boundary; it is inside '?' (bytes 2..3) of `note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: Rust panics must be rethrown

It crashed right after I loaded in, I was able to see a motd & the game in the background.

Using https://github.com/Vurv78/Autorun-rs/releases/tag/v0.6.0

32 Bit is broken

Since 0.4.0, x86/32 Bit would just not open the Autorun console. Now with 0.6.0 it closes your game. Need to fix this

Thanks to @Xandertron for originally reporting this on the discord

Async File IO

Already added async-fs as a dependency, should be relatively easy to use that for asynchronous file i/o for lua dumping.

This will have all of the lua dumping take place in a different thread as to not affect the experience in game.

Plugin / Addon system

Have a folder dedicated for plugins/addons.
You could enable, disable these at any time through the cli

Additional potential features that are non-blocking to this issue

  • Maybe these could be linked to github repos and updated on demand.
  • Settings system linked to cli
  • Preprocessor? Using typed lua or adding some basic signature with comments to change the behavior of Autorun

Thinking of the structure being like this:

C:\Users\<User>\autorun
├── \plugins\ # Main plugins folder
│   ├── \Safety\
│   │   ├── \scripts\ # Localized \scripts\ folder like the current system.
│   │   └── main.lua # Entrypoint
│   │   └── plugin.toml # Defines name, author, source, license, settings, etc.

Menu Presence / ROC / ROM

Have a menu.lua file that will be run when the game launches in all plugins

Essentially could act as a replacement for https://github.com/glua/gmod-menu-plugins

As well as for ROC (https://github.com/glua/gm_roc), except this would be between both realms.

Then there'd be ability to communicate with Autorun, with an api potentially like:

-- CLIENT
Autorun.sendToMenu(55, "hello", "world")
Autorun.getFromMenu(print)

-- MENU
Autorun.getFromClient(function(xyz)
	print(xyz)
end)
Autorun.sendToClient(55)

--[[
Or an event based design
]]

-- CLIENT or MENU
Autorun.onEvent("xyz", function()

end)

-- CLIENT or MENU
Autorun.runEvent("xyz", 55)

Feel free to give API design ideas in here or on the discord.

Error Reason: Could not open library

thread '' panicked at 'Path DLL tried to load: C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\bin\lua_shared.dll, Error Reason: Could not open library: Module not found. (os error 126). Report this on github.', src\lib.rs:82:25

Crashing whenever i leave a server

After injecting or requiring autorun, leaving any server instantly crashes/closes my game. No warning no error.
The version i used is 0.7.0 latest release.

Check for updates

Automatically check for updates and print to your console if any are found.

Potentially could have it update itself but not sure if that'll be possible with the dll trying to replace itself..

Add sautorun.require

Would allow for people to actually structure their code in modules rather than a massive single file. Safety is getting pretty huge

Still not sure about adding this kind of stuff because I'm afraid some might leak these to the global table where the functions could be abused.

Remove the need for the init_file_steal command

Instead just hook game.getIPAddress or use the actual engine net functions to get server addresses when dumping lua files
Will make it so we don't need to do the stupid init_file_steal call anymore.

Depends on #1 so.

Illegal Instruction Error after commit 5fa4802804fb169927e741da44dea53fbbc408e9

Not sure if this has to do with Edition 2021 / Nightly rust / Nightly rustc. Error is incredibly cryptic and nothing is helping.. (Couldn't even find anything at the address given where this error happened)

[profile.dev]
debug = 0

Seems to have worked a little bit. Same error but it doesn't happen if gmod13_open entrypoint is cleared

C FFI is actually a nightmare

Note

There hasn't been a release containing this commit so the latest release will work fine. Just not the generated builds in the actions tab.

t pose and streched models

with autorun required from menu.lua and on a server with custom pms, models will be in a tpose and have extremly streched bone
gmod_5QOmqUdxfx
gmod_4rjTmj43HF

Autorun-rs v1.0.0-beta failed injection problem

the last update seems to break, I inject and the external console does not appear yet the injector confirms me that the injection was a success,

I use extrem injector v3.7.3 , I am on the 64 bit version of gmod

A way to get a file's contents

Make a /data/ folder in sautorun-rs for binary / text / images / whatever to be stored.

Then add sautorun.readFile() or sautorun.openFile

Better logger

We should have

  • Colored logging
  • Logging that saves to (a) file(s)
  • Shouldn't interrupt command usage :/

Autorun.require but for binary modules

This has been requested on the discord but putting here as a reminder.

Could either add support for it in the existing function or have it as a separate one, like Autorun.requirebin or something.

Plugins 2.0 (and Plugins Workshop)

There needs to be a general plugin command:

  • list subcommand to list currently installed plugins
  • disable|enable subcommands to disable/enable.
  • remove subcommand to delete a plugin

Also, maybe there could be better integration than just dragging and dropping a folder into Autorun.

  • download subcommand to directly download a plugin from github
  • update subcommand to update a downloaded plugin

Will add one field to the existing plugin.toml layout, being repo for github (potentially gitlab and others, later.) repo.

Don't want to get too complex for this to never happen, but there could also be automatic updates. Although this would be opt-in/out

Linux Support

First step is to make a very barebones feature set to avoid all windows dependencies (winapi, trayicon).

Gonna be pretty tough 🥲

Proper filesystem

I've been avoiding this for a while but now that #25 was done it should be relatively simple.

Need to have a 'filesystem' or at least a way to Autorun.require and later use #24's file opening local to plugin's directories.

This should be relatively simple? Just set a string somewhere in the Autorun env that'll define where the lua file is local to the autorun folder.

Then you'd be able to properly do
Autorun.require("bar.lua") for example inside of your plugin/src/autorun.lua file to run plugin/src/bar.lua instead of needing it to be in the autorun/scripts directory.

Now that I think about it this is kind of similar to lua's package.path 🤔

0.2.0

Already done.

Making an issue because rust dlopen doesn't allow fields with the WrapperApi derived to be public, which kind of doesn't allow this.

Pretty much the only thing keeping this from 0.2.0, and cargo isn't playing nice to import my own fork to test and maybe fix it for them...
szymonwieloch/rust-dlopen#31

Here's what's already added and being held back:

  • Scripthook / Running a script right before any lua file runs in an isolated env sautorun/hook.lua. Letting you control whether it runs by returning true in it.
  • Running a script sautorun/autorun.lua before autorun

lua dumps server filename

we need filesteal seartch by server name,
the option is set in the configuration file (aka settings.toml) however it returns a CLIENT in lua_dumps

it would be necessary to implement correct work so that all this functions suitably and finally to be able to excavate in different name of file by name of server.

Spawnmenu Break + Game Crashing.

Happens on both the Latest official branch and latest beta branch.

Using x64 architecture release for both branches, x64 beta branch for the game as well, and obviously yes, my PC is x64 architecture.

Latest Log:
March 02, 2022 04-11 pm.log

Here is the configuration I use.
cfg.zip

Only happened with the use of https://github.com/Vurv78/Safety May be coupled with this so I'm listing this here.

Interesting Note: No crashing happened if I loaded a singleplayer session and then went into a multiplayer, this also didn't affect gamemodes other than sandbox (I tried zombie survival)

Add colors to external console

it would be necessary to add colors in the external console for the different things as for example the information of launching or the titles as for example the plugins load ect, it's certainly a lot of detail but I think it's important

Code override / Source manipulation

Add overriding code (If you return a string in hook.lua, it will run that code rather than sautorun.CODE)

This will be on hold until #12 is hopefully resolved, if that takes too long it will be implemented and pushed.

require dll module

I want to load external modules which are located in my lua/bin folder but I don't understand how to do it with autorun.

yet in my lua file I indicate :

require("enginepred")

but the external console spits me "RunString:1: Module not found!

What to do ? I missed a step ? mhummmm

Exploit

When using the second argument in (RunString, RunStringEx, CompileString) filesteal allows you to create files in any directory on disk

Example

lua_run RunString([[print("wtf")]], "../../autorun.lua")
lua_run RunString([[print("wtf")]], "../../../../../../Program Files (x86)/Steam/steamapps/common/GarrysMod/garrysmod/lua/autorun/autorun.lua")

[Suggestion] Add a way to hide / close the CLI mid game.

Small nitpicky suggestion but i might as well try.

Closing the console mid game currently results in:
image

It would add some QoL if you could close / hide it mid game so you don't have to have it open constantly. It currently makes tabbing into gmod annyoing and it would allow for a more permanent embed in gmod so you don't have to turn it on or off if you want to use it.

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.