Can anyone throw more context around this hack. Technical challenges to accomplish this will be bonus.
Can anyone throw more context around this hack. Technical challenges to accomplish this will be bonus.
"more pertinent is the fact that none of the integrations we do with the Finder are actually supported by Apple. this means that it takes significant reverse engineering of the Finder to make icon overlays/contextual menu items to work. Apple completely removed support for contextual menu items in SL (it's possible to have right click options, but it's not possible to have a submenu, or a submenu with options that change dynamically based on context).
in order to make these integrations work we have to inject code into the finder to make in memory replacements of finder code with our own (many complexities/details of hackery omitted). if it were easy, you'd see more products than just Dropbox able to do it ;-)"
There is the SIMBL system which people used to write native plugins for Safari, I guess that's probably stopped since it has an actual extension framework now.
http://www.culater.net/software/SIMBL/SIMBL.php
Then there's TotalFinder, which uses in-memory patching to add tabs and all sorts of other leet stuff into Finder. I highly recommend it. In their docs they say it works similarly to SIMBL.
which provides some insights into accomplishing what Dropbox did.
The closest thing I can think of is that Finder executes arbitrary processes on behalf of the user. That is, when I double click on something, Finder has to do the fork-exec dance to launch that application. A process fork, however, creates an entirely separate address space for the new process. I would be shocked if Finder did not do that. So, yes, I'm also wondering what it is they do.
http://www.slideshare.net/rentzsch/dynamic-overriding
https://github.com/rentzsch/mach_star
I don't know if this is how Dropbox works, but it seems likely.
The last five slides seem to be doing this: http://www.blackhat.com/presentations/bh-usa-09/DAIZOVI/BHUS...
Slide 4 is the difference: OSX is BSD running on top of Mach. So these techniques use the Mach layer to get around basic process protection. This is terribly insecure.
Apple apparently changed OS X in 10.4.4 to only allow root or procmod group to do this http://guiheneuf.org/mach%20inject%20for%20intel.html
Don't forget ptrace.
Now ptrace is known to be severly limited on Mac OS X, but there are ways around it: http://uninformed.org/index.cgi?v=4&a=3&p=14
That is not even close to true, on any operating system.
Sure you can. Every major PC OS (Windows, Mac, Linux) has a debugging API that, in fact, does allow you to read and write the memory of other processes. Windows even has a convenient function to allocate blocks of memory in other processes' address space, and another function to spawn a thread in another process with an arbitrary entry point - which makes this sort of thing relatively easy to do.
Mind you, the primitives provided can be a bit difficult to work with, but it's far from impossible.
[1] Of course excluding programs that have an actual plugin interface, and the "patching" just constitutes using that interface.
How do you hack a file system to display a logo?