Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS via Love running, but not functioning #97

Closed
divuyes opened this issue Jul 29, 2021 · 12 comments
Closed

MacOS via Love running, but not functioning #97

divuyes opened this issue Jul 29, 2021 · 12 comments
Assignees
Labels
Bug Something isn't working

Comments

@divuyes
Copy link

divuyes commented Jul 29, 2021

Describe the bug
Unlike the only other bug report about running on Mac, my M'Overlay actually runs. It shows the "Waiting for dolphin..." animation and dialogue, as well as the "Waiting for melee..." animation and dialogue when Dolphin is run. However, when Melee is opened, it still says "Waiting for melee..." and it doesn't detect it no matter what I do. I have a hunch that this might be a permissions issue within Big Sur, however I am not entirely sure that is the case, and I do not know how to solve this.

Desktop (please complete the following information):

  • OS: MacOS Big Sur 11.4
  • Dolphin Version: Slippi 2.3.1

To Reproduce
Steps to reproduce the behavior:

  1. Open the m-overlay.love file
  2. Open Dolphin
  3. Load Melee
  4. See error

Expected behavior
I expected it to detect Melee since it detected Dolphin, however it didn't do anything and kept waiting for Melee.

Screenshots
Initial run:
Screen Shot 2021-07-28 at 7 05 50 PM
Opening Slippi through Slippi Launcher:
Screen Shot 2021-07-28 at 7 06 50 PM
As shown, Melee is running however not being detected, despite Dolphin being hooked.

Settings (in case it's useful):
Screen Shot 2021-07-28 at 7 09 24 PM

Debug console output

[INFO  - 19:05:43] [DOLPHIN] Unhooked
[DEBUG - 19:06:02] Found dolphin-emu process: /proc/32757
[INFO  - 19:06:02] [DOLPHIN] Hooked
[INFO  - 19:06:04] [DOLPHIN] Unhooked
[DEBUG - 19:06:07] Found dolphin-emu process: /proc/32764
[INFO  - 19:06:07] [DOLPHIN] Hooked
@divuyes divuyes added the Bug Something isn't working label Jul 29, 2021
@bkacjios
Copy link
Owner

bkacjios commented Jul 29, 2021

Yeah, MacOS functionality is currently incomplete, it's why I don't have an official dmg release of it yet. I actually built a hackintosh using my old PC parts to try and work on development for it. The most I managed to do was find the dolphin process, which is the behavior you are currently seeing.

https://github.com/bkacjios/m-overlay/blob/master/source/modules/memory/osx.lua

I hit a roadblock when I found that applications on mac need a special permission called Debugging Tool Entitlement in order to attach to it and read from the processes memory.

If you or anyone else knows more about macs and could help with this, I'd really appreciate it.

@divuyes
Copy link
Author

divuyes commented Jul 29, 2021

Hmm. I don't know a whole lot about developing for Lua/MacOS directly, however it seems like this is a part of Hardened Runtime. Is it possible to go in Xcode and grant this entitlement?

@bkacjios
Copy link
Owner

bkacjios commented Jul 29, 2021

I have no idea. I basically know nothing about mac. Even if you did grant the permissions somehow, the osx bit of code is incomplete. It would allow me to work on it again though.

@divuyes
Copy link
Author

divuyes commented Jul 29, 2021

When I can, I'll see if I can use Xcode to modify the entitlement permissions of it. I'm not quite sure if I can because I don't know if Xcode works with programs other than .apps, but we will see. If not, then the .love file may be able to work if converted into a .app. We shall see.

bkacjios added a commit that referenced this issue Jul 29, 2021
Added debug info for OSX application hooking (#97)
@bkacjios
Copy link
Owner

m-overlay-x64 (master-305).zip

I made a build with extra prints to output in the terminal if it managed to get the correct permissions or not. Rename it from .zip to .love

But just so you know, M'Overlay still won't work no matter what you do, but this information would help knowing I can actually properly hook and read from memory.

@divuyes
Copy link
Author

divuyes commented Jul 29, 2021

As expected, the new patch printed failed permissions. However, I may have found what you need to do. First, it needs to be a .app file, so I cannot do anything with the current .love file. However, once you get that, you can follow this article to enable the Hardened Runtime and grant Debugging Tool Entitlement. Obviously, any time it says in the article the camera permission, substitute it with com.apple.security.cs.debugger.

@bkacjios
Copy link
Owner

I wonder if this would work on the love.app, since basically, it's the engine in which m-overlay runs? I'll have to get my hackintosh working again to try and start work on this again.

@bkacjios
Copy link
Owner

Okay so after some more research, I found that the application you want to read memory from ALSO needs a seperate permissions set.

com.apple.security.get-task-allow

So this would also have to be set on dolphin as well..

@bkacjios
Copy link
Owner

bkacjios commented Jul 29, 2021

Well, from what I'm reading, this would require me to have a development ID, which I don't have, in order to sign my own application. This would be a huge roadblock, since I don't think they accept apps with these debug permissions set.

As much as I would love to have support for mac, it just seems like it's impossible to do so.

It also doesn't help that dolphin would have to ship with the proper permissions as well.

@divuyes
Copy link
Author

divuyes commented Jul 29, 2021

Oh alright. If anything changes, I'll make a new thread. However, since the future is grim, I'm gonna close this thread. Thanks for trying, at least.

@isaac-ssbm
Copy link

isaac-ssbm commented Feb 26, 2022

Would it help to set up a donation goal? I think developer IDs cost like $99/year. There are a lot of macOS users and im sure we’d hit that goal in a few days if not even in a few hours.

@bkacjios
Copy link
Owner

It's a lot more complicated than just getting an developer ID.

https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_debugger

Could maybe have it use Dolphins MemoryWatcher instead, but I don't know if the builds of slippi dolphin have it enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants