2

I want to write a blogpost / record a screencast about macOS opensource components. I was going to decompile those opensource components and I am not sure if it would be legal. MacOS software license explicitly forbids any OS decompilation, but also mentions that Open Source Component licenses override that limitation. MacOS components like xnu or dyld are licensed under Apple Public Software License, which is open-source license without any restriction for decompilation. Is it legal to decompile macOS executables, whose source code is already available at opensource.apple.com?

Software License Agreement For macOS Big Sur states that:

N. No Reverse Engineering. You may not (…) decompile, reverse engineer, disassemble (…) the Apple Software (…) (except as and only to the extent any foregoing restriction is prohibited by applicable law or by licensing terms governing use of Open-Sourced Components that may be included with the Apple Software).

Apple Public Software License in turn states that:

1.7 "Original Code" means (…) (b) the object code compiled from such Source Code and originally made available by Apple under this License.

and then:

2.1 (…) You may use, reproduce, display, perform, internally distribute within Your organization, and Externally Deploy verbatim, unmodified copies of the Original Code, for commercial or non-commercial purposes

2
  • 4
    When it's open source, why do you want to decompile it? It is already available as source.
    – PMF
    Aug 7, 2021 at 20:21
  • 2
    Very good question. I want to show how the library works live. Reading a source code is an alternative for me. Showing how the things interact live in debugger will have the biggest educational impact in my opinion. Debugger shows assembly code - so using debugger seems to be an act of decompilation.
    – kam800
    Aug 8, 2021 at 7:06

1 Answer 1

2

A license tells you what you are allowed to do, under what conditions. You are allowed to disassemble the code if copyright law allows it (only in rare situations) or the license allows it.

You need to check the exact text of the license. Most likely you don't have the right to disassemble code that has been compiled by Apple, but there would likely be some way for you to get the source code, and with the source code the right to compile your own application, and because it is your own application, the right to disassemble the code as part of your own application.

Now if there is a legal way for you to disassemble the code by compiling it yourself, and there is no practical difference except wasting some of your time between this and disassembling the code as part of Apple's application, Apple might not care.

1
  • 1
    I am not familiar with Apple's compilation process, but it's just barely possible that they have a more advanced version of Clang which they use for compiling their own binaries, but which has not been publicly distributed. If this is the case (which, frankly, I think is unlikely but not impossible), then the version you compile yourself will disassemble differently, because it might be less aggressively optimized in certain particulars. I doubt Apple would care unless you're trying to reverse-engineer their compiler, but it might be safer to start with the source code, just in case.
    – Kevin
    Aug 9, 2021 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.