{"action":"created","issue":{"url":"https://api.github.com/repos/rentzsch/mach_inject/issues/2","labels_url":"https://api.github.com/repos/rentzsch/mach_inject/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/rentzsch/mach_inject/issues/2/comments","events_url":"https://api.github.com/repos/rentzsch/mach_inject/issues/2/events","html_url":"https://github.com/rentzsch/mach_inject/issues/2","id":7576244,"number":2,"title":"[QUESTION] mach_inject without root permissions like Dropbox","user":{"login":"JoseExposito","id":1335948,"avatar_url":"https://avatars.githubusercontent.com/u/1335948?v=3","gravatar_id":"","url":"https://api.github.com/users/JoseExposito","html_url":"https://github.com/JoseExposito","followers_url":"https://api.github.com/users/JoseExposito/followers","following_url":"https://api.github.com/users/JoseExposito/following{/other_user}","gists_url":"https://api.github.com/users/JoseExposito/gists{/gist_id}","starred_url":"https://api.github.com/users/JoseExposito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoseExposito/subscriptions","organizations_url":"https://api.github.com/users/JoseExposito/orgs","repos_url":"https://api.github.com/users/JoseExposito/repos","events_url":"https://api.github.com/users/JoseExposito/events{/privacy}","received_events_url":"https://api.github.com/users/JoseExposito/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2012-10-14T17:57:57Z","updated_at":"2015-03-22T17:46:33Z","closed_at":"2012-10-15T17:43:31Z","body":"Hi!\r\n\r\nI'm making a Finder \"plugin\" for Ubuntu One:\r\nhttps://github.com/JoseExposito/U1-Finder-Plugin\r\n\r\nCurrently I'm using a SIMBL like loader making my plugin as a scripting addition:\r\nhttps://github.com/JoseExposito/U1-Finder-Plugin/blob/master/U1%20Finder%20Injector/U1FinderInjector.m\r\n\r\nBut I don't like this method because I need to restart the Finder to allow to inject the plugin.\r\n\r\nI see like some applications (like Dropbox) are able to use mach_inject without as for the admin password and my question is... How to do that??\r\n\r\nThan you very much for the support in avance!"},"comment":{"url":"https://api.github.com/repos/rentzsch/mach_inject/issues/comments/84665415","html_url":"https://github.com/rentzsch/mach_inject/issues/2#issuecomment-84665415","issue_url":"https://api.github.com/repos/rentzsch/mach_inject/issues/2","id":84665415,"user":{"login":"rodionovd","id":5719520,"avatar_url":"https://avatars.githubusercontent.com/u/5719520?v=3","gravatar_id":"","url":"https://api.github.com/users/rodionovd","html_url":"https://github.com/rodionovd","followers_url":"https://api.github.com/users/rodionovd/followers","following_url":"https://api.github.com/users/rodionovd/following{/other_user}","gists_url":"https://api.github.com/users/rodionovd/gists{/gist_id}","starred_url":"https://api.github.com/users/rodionovd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodionovd/subscriptions","organizations_url":"https://api.github.com/users/rodionovd/orgs","repos_url":"https://api.github.com/users/rodionovd/repos","events_url":"https://api.github.com/users/rodionovd/events{/privacy}","received_events_url":"https://api.github.com/users/rodionovd/received_events","type":"User","site_admin":false},"created_at":"2015-03-22T17:46:33Z","updated_at":"2015-03-22T17:46:33Z","body":"@jamiefoster Well, it depends on whether you (1) want to be notified when a *GUI application* launches or (2) it's about ANY process.  \r\n\r\nIn the former case you should just register to notifications like `NSWorkspaceWillLaunchApplicationNotification ` via Cocoa APIs.  \r\n\r\n> I've done something similar for one of my apps: https://github.com/rodionovd/Locatr/blob/master/Locatr/LRInjector.m#L44  \r\n\r\nIf it's the latter — I have some bad news for you: there isn't any API which enables you to be notified about an arbitrary process startup. Even «System Monitor» app uses a timer to update it's process list.  \r\n\r\n> End even fetching the list of processes is tricky. Take a look at `GetNextProcess()` or `LSCopyRunningApplicationsArray()` — https://github.com/rodionovd/RDProcess/blob/master/RDProcess.m#L174\r\n\r\nI'm also not really sure about your idea of injecting code *before* the process actually starts (i.e. before it's `main()`). I might be wrong, but I don't think it's possible to do, so just inject your code like if your target have been running for a while.\r\n"}}