lewisclark / glua-steal

Retrieves client-sided Lua files from Garry's Mod game servers
GNU General Public License v3.0
151 stars 15 forks source link

i need a tut on yt #51

Closed dasd46785 closed 1 year ago

dasd46785 commented 1 year ago

hello i am new and i need a tut on yt because i dont get it

shockpast commented 1 year ago

Requirements

Steps to Use

  1. Download
  2. Place DLL on your Desktop or somewhere that is good for you
  3. Process Hacker 3.1. (If your's GMod is 64bit, then find "gmod.exe", else "hl2.exe") 3.2. RMB (Right Click) at (gmod.exe/hl2.exe) and select Miscellaneous 3.3. LMB (Left Click) at "Inject DLL..." and select gluasteal-v%.%-%bit.dll
  4. Garry's Mod might be still running, so you will need to try joining some servers and then checking folder "Documents/gluasteal/servers/"
  5. fin

Uhh...

folders in Documents/gluasteal/servers/ will be named as IP:PORT i can't do video, so i hope i wrote this pretty good

maplepy commented 1 year ago

What about for Linux @shockpast ?

shockpast commented 1 year ago

What about for Linux @shockpast ?

idk

lewisclark commented 1 year ago

hello i am new and i need a tut on yt because i dont get it

Be specific? What don't you get? Have you looked at the readme?

What about for Linux @shockpast ?

There are instructions on how to build and use glua-steal on Linux in the readme.

maplepy commented 1 year ago

The instructions

Recommended: [gdb](https://github.com/AimTuxOfficial/AimTux/blob/master/load)
    [linux-inject](https://github.com/gaffe23/linux-inject)
    using [LD_PRELOAD](https://man7.org/linux/man-pages/man8/ld.so.8.html), e.g. by modifying the Garry's Mod launch script (hl2.sh)

Im not too sure how to inject it tbh, I have tried linux inject and gdb but none of those seems to work

lewisclark commented 1 year ago

The instructions

Recommended: [gdb](https://github.com/AimTuxOfficial/AimTux/blob/master/load)
    [linux-inject](https://github.com/gaffe23/linux-inject)
    using [LD_PRELOAD](https://man7.org/linux/man-pages/man8/ld.so.8.html), e.g. by modifying the Garry's Mod launch script (hl2.sh)

Im not too sure how to inject it tbh, I have tried linux inject and gdb but none of those seems to work

gdb injection works great for me and others - here's a script you can use: https://github.com/lewisclark/glua-steal/issues/21#issuecomment-876401038

maplepy commented 1 year ago

here's a script you can use: #21 (comment)

I think I used it correctly,

  1. used the built .so file from glua steal,
  2. setup my .lua file to run in the toml file at first then tried in the include section of the "default" lua file
  3. got the pid from the top command and looked at gmod.exe
  4. used the script with (pid from top) (.so file)
  5. nothing happened
maplepy commented 1 year ago

either I built the .so wrong, or my glua steal folder is fucked or somethign

lewisclark commented 1 year ago

Are you matching the build instructions with the version of the game you are running (32 bit or 64 bit)? You also must specify the full path to the library file, not a relative one.

maplepy commented 1 year ago

Ooh maybe thats why, I was using the relative path!

When do you inject it and how do you check the pid and version (32 or 64) of the executable? I'm not sure which version it is (should be Chromium 64, but there is a way to start it in 32) ?

Other than that, do you recon I'm doing something wrong from my instructions?

lewisclark commented 1 year ago

Inject at the main menu when you first launch the game. By default, Garry's Mod is installed as a 32-bit program. You can change it to 64-bit in Steam by going to the 'Betas' section under Garry's Mod. You 100% must use an absolute path when using that script, so hopefully that is your issue.

maplepy commented 1 year ago

Thank you very much! I will try when I come home from work then and let you know :)

For some reason my Gmod was in the "normal" mode but a server asked for the Chromium x64 binaries version so I switched to it but now whenever I try to join a server on any version but Chromium my game crash so I must be in Chromium x64 binaries

maplepy commented 1 year ago
~/Github/gmod ❯ ./gdb_inject.sh 25429 /home/maplepy/Github/gmod/binaries/libgluasteal-32.so
No symbol table is loaded.  Use the "file" command.
Invalid data type for function to be called.

I get this output when I try, also no folder is being created in my home when i start it

maplepy commented 1 year ago

So you know, I used your script with the full path, tried with both 32bits and 64bits version and none of those worked

maplepy commented 1 year ago

Just tried with linux-inject and got this ./inject -p $(pgrep hl2) /home/maplepy/Github/gmod/gluasteal.so

targeting process with pid 58251
ptrace(PTRACE_POKETEXT) failed
maplepy commented 1 year ago

image this is the version i'm running

please answers those so I know what's wrong:

  1. are you using proton or the native version?
  2. what version of gmod are you running?
  3. did you compile in 64 or 32?

or maybe try to send me your .so file so I can check if my build is wrong? thank you very much

lewisclark commented 1 year ago

Strange. I've just tested both 32-bit and 64-bit with no issues. Native only - I wouldn't recommend using Proton.

did you compile in 64 or 32?

You must compile to match the architecture of Garry's Mod. 64-bit -> 64-bit and 32-bit -> 32-bit.

You can download precompiled from the bottom of this page.

maplepy commented 1 year ago

Well I might be missing something because even with those it seems like it does not work

~/Github/gmod ❯ ./gdb_inject.sh 56047 /home/maplepy/Github/gmod/binaries/gluasteal-ubuntu-20.04-gcc9-gcc-32bit-Release.so

warning: Could not load shared library symbols for bin/launcher.so.
Do you need "set solib-search-path" or "set sysroot"?
Successfully injected!

~/Github/gmod ❯ ./gdb_inject.sh 56047 /home/maplepy/Github/gmod/binaries/gluasteal-ubuntu-22.04-gcc11-gcc-32bit-Release.so

warning: Could not load shared library symbols for bin/launcher.so.
Do you need "set solib-search-path" or "set sysroot"?
Successfully injected!

Note: I tried with the 32 bit version but when i pgrep hl2 i have 3 pids, tried with the 3 but none of those work

maplepy commented 1 year ago

I just managed to fix it !! Thank you so much for the help and for trying for so long to help me bro!

The fix: basically I tried with both the gcc9 and gcc11 and tried every 3 of those pid, eventually one worked and it seems like it created the gluasteal folder and every file associated with it

maplepy commented 1 year ago

I'm just note sure how to run my .lua files now? Should they be in the config.toml or in the gluasteal.lua or somewhere else?

lewisclark commented 1 year ago

Great! The default file is gluasteal.lua but can be changed in the config file.

maplepy commented 1 year ago

What would be the best way to run a menu when i spawned in the server? because as of now it doesnt seem to load when im connected

lewisclark commented 1 year ago

Something like this should execute your file once the base Lua files have loaded:

gluasteal.lua

if gluasteal.SCRIPT == "includes/extensions/client/render.lua" then
    gluasteal.include("loaded.lua")
end

loaded.lua

-- your code here
maplepy commented 1 year ago

would that load it when it connects to the server or once i joined ? because i had issues with it maybe it initialized too early

i guess it would since if I understand correctly, it will load right after the render.lua loads right?

lewisclark commented 1 year ago

Yes, it would load loaded.lua once, just before render.lua is loaded.

To delay it further you could do something like this inside the if statement:

timer.Simple(0, function() gluasteal.include("loaded.lua") end)