Last active
January 16, 2020 21:43
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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