Closed PhoenixShay closed 1 year ago
I'd love to get glua-steal working on OSX - I never had the chance previously due to not having a device to test on. I've started a new branch for OSX so hopefully we can make some progress towards this. Thanks for the issue; it gives a good starting point.
It's building in CI now - so feel free to test it by building the osx
branch. I have no idea if it will inject nicely, so enabling debug logging using the config would give some really helpful info.
I appreciate you jumping right into this!
Definitely some issues injecting; not sure if it's the lib or user error though. Tried LD_PRELOAD by modifying hl2_osx; game immediately crashes upon launch. Tried LLDB injecting directly - can't even attach to the process (error 1 from LLDB). Tried jerryrigging the hl2_osx to launch it with GAMEDEBUGGER set to lldb; immediate crash. I saw the game tries to load some .dylibs that don't actually exist in a few different places (i.e html_awesomium.dylib, client.dylib, engine.dylib, etc). Tried putting gluasteal dylib in one of those spots but it looks like it's expecting x86_64 instead of arm64 (understandably).
My Discord is Shayne#2226, might be less cluttered and easier to go back and forth there. Happy to be a guinea pig!
Awesome - thanks!
Injecting with a debugger is definitely the way to go in terms of reliability. I've adapted a GDB injection script for LLDB below - just the pid and full path to libgluasteal.dylib need to be filled in.
sudo lldb --attach-pid 0 --batch -o "p (void*)dlopen(\"/full/path/to/libgluasteal.dylib\", 1)" -o detach -o quit
Some googling tells me that error 1 from LLDB is caused by insufficient permissions to attach? Perhaps Garry's Mod enables the hardened runtime?
sudo lldb --attach-pid 0 --batch -o "p (void*)dlopen(\"/full/path/to/libgluasteal.dylib\", 1)" -o detach -o quit
If anyone is still getting Error 1, reboot to RecoveryOS. Then put in csrutil disable
into the Terminal and restart your machine.
Describe the bug Building the repo on OSX 12.6 fails - unable to find link.h.
Expected behavior Building the repo succeeds and the 0.001% of people probably using GLua-Steal on OSX can live a happy life.
Screenshots
Additional details (please complete the following information):
Additional context I don't really care that much, so I'm not offended if this doesn't get fixed. I know Mac isn't officially supported.