Skip to content

Comment on Fixing QuickLook (2023)

Comments

Cool investigation into the guts of macOS. I had no idea symbols were still present for production builds in macOS and that they are so easily 'hackable'.

I hadn't noticed before, but it is very strange to round corners of images in QuickLook. Apple should revert this change.

Apple provides basic symbols for some of their binaries–particularly older ones. I assume the default setting used to be to not strip those, or some kind soul picked that option and nobody revisited it. Unfortunately a lot of new code is shipped stripped by default :(

You can’t really strip objective-c symbols, can you? I think that would break method dispatch

You might be thinking of Objective-C metadata, which contains information about classes, protocols and categories. Unlike symbols, metadata can’t be stripped.

I’m specifically talking about selectors and things like class names, etc. I can see that you can strip the parts of objective-c that are just C.

You can definitely strip the symbols; the runtime metadata is stored separately.

Yes but what Objective-C people consider “no symbols” looks like symbols to C programmers.

Tell that to ___lldb_unnamed_symbol74$$TextEdit

Yes, but you can often still figure out what the name is if you pause in that method and print _cmd ($arg2), or look at the calling stack entry and see what selector string was used.

Personally I just use a disassembler that parses this metadata for me

The selector system is enough even without debug symbols, since all object method calls are identified at runtime by a human readable string.

Fun fact selectors do not have to be human-readable

Symbols don't have to be human readable either. You can easily write completely inscrutible function names in source code.

I don't see how this point really matters. Sure you can name your functions and selectors stupidly all the same. There are also probably obfuscators for it (Proguard-like?). But that's not really relevant to my point.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.