Skip to content

Instantly share code, notes, and snippets.

@rebeccajae
Last active January 16, 2020 21:43
Show Gist options
  • Save rebeccajae/517683af46da34ce36a0bc3ecd9a824e to your computer and use it in GitHub Desktop.
Save rebeccajae/517683af46da34ce36a0bc3ecd9a824e to your computer and use it in GitHub Desktop.
IDA64 on MacOS uses symlinks to keep it small, and that doesn't play well with new OS behavior. This will copy those files into the .app so it runs directly.
# SPDX-License-Identifier: Apache-2.0
import subprocess
from pathlib import Path
import shutil
import os
linksInIDA64 = subprocess.run(['find', 'ida64.app', '-type', 'l'], stdout=subprocess.PIPE)
for path in linksInIDA64.stdout.splitlines():
thisPath = Path(path.decode("utf-8"))
symlinkAt = str(thisPath.absolute())
symlinkTarget = str(thisPath.resolve())
os.unlink(symlinkAt)
if os.path.isdir(symlinkTarget):
shutil.copytree(symlinkTarget, symlinkAt)
elif os.path.isfile(symlinkTarget):
shutil.copyfile(symlinkTarget, symlinkAt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment