1

Due to incompatibility of root account and sandbox, I need to manually disable sandboxing of MS Office applications (so that it can be activated) by changing the value of com.apple.security.app-sandbox within the application binary (/Applications/Microsoft Word.app/Contents/MacOS/Microsoft Word) from <true/> to <false/>.

However, this change would lead the addition of a byte, and I can't find any documentation on how to insert a byte. I'm using hexedit, installed with brew (brew install hexedit).

Also, if someone can provide a script to automatically detect and edit that flag, that will be great. Here is an excerpt:

enter image description here

  • @nohillside I've done it before, it doesn't. I use hexed.it to insert byte before, but due to whatever reason it doesn't work anymore. I need to use the root account because there are many limitations to an admin account and I have to use sudo all the time. – Joy Jin May 30 at 6:57
  • You can use sudo -s once to start a root shell. Will post an answer regarding byte level editing later (not at home right now) – nohillside May 30 at 7:04
  • What is the sandbox limitation that you are trying to work around? I activated Office and use it extensively without having to bypass sandbox or run into security obstacles. – benwiggy May 31 at 8:48
  • @benwiggy I've undeleted some comments as this has come up before :-) The OP didn't go into details though. – nohillside May 31 at 8:49
1

You don't need additional software for this, the standard vi installed by macOS can edit binary files.

cd /Applications/Microsoft\ Word.app/Contents/MacOS/
cp Microsoft\ Word Microsoft\ Word.orig
vi -b Microsoft\ Word

Now, assuming you are not used to vi:

  • Type /app-sandbox followed by Return to jump to the definition you want to change

enter image description here

  • Press Return again to move the cursor to the next line
  • Type ct/<false followed by ESC

enter image description here

  • Type ZZ to save and quit

PS: If you get stuck within vi, press ESC twice and then type :q! to quit without saving.


If you want to script this, use (at our own risk)

vi -b Microsoft\ Word '+/app-sandbox/+1s/true/false/' '+wq'

which basically does the same thing as the interactive sequence above in one go.

  • /app-sandbox/+1 makes the following command (the substitution) only apply on the line after the one containing the app-sandbox string
  • s/true/false/ is the substitution and replaces true by false
  • wq writes the modified file back to disk and quits
  • @joyjin Added a way for scripting this, have fun :-) – nohillside May 31 at 8:43
  • A new problem comes out when I modify Microsoft Outlook. Upon launching, it gives me "terminated by signal SIGILL (Illegal instruction)". – Joy Jin Jun 14 at 10:20
  • @joyjin Please ask a new question for new problems – nohillside Jun 14 at 11:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .