Skip to content

Instantly share code, notes, and snippets.

@naveenkrdy
Last active March 21, 2024 15:30
Show Gist options
  • Save naveenkrdy/26760ac5135deed6d0bb8902f6ceb6bd to your computer and use it in GitHub Desktop.
Save naveenkrdy/26760ac5135deed6d0bb8902f6ceb6bd to your computer and use it in GitHub Desktop.
To fix adobe products crashes on AMD hackintosh

Adobe Crash Fix XLNC

Instructions

  1. Install needed adobe apps from adobe creative cloud.

  2. Open Terminal.

  3. Copy-paste the below command to your terminal and run it (enter password when asked).

files_list=(MMXCore FastCore TextModel libiomp5.dylib)
lib_dir="${HOME}/Documents/AdobeLibs"
lib1_file="${lib_dir}/libiomp5.dylib"
lib1_link="https://raw.githubusercontent.com/naveenkrdy/Misc/master/Libs/libiomp5.dylib"

for file in $files_list; do
    find /Applications/Adobe* -type f -name $file | while read -r curr_file; do
        name=$(basename $curr_file)
        sw_vers -productVersion | grep "11" >/dev/null 2>&1
        [[ $? == 0 ]] && [[ $name =~ ^(MMXCore|FastCore)$ ]] && continue
        echo "found $curr_file"
        sudo -v
        [[ ! -f ${curr_file}.back ]] && sudo cp -f $curr_file ${curr_file}.back || sudo cp -f ${curr_file}.back $curr_file
        if [[ $name == "libiomp5.dylib" ]]; then
            [[ ! -d $lib_dir ]] && mkdir $lib_dir
            [[ ! -f $lib1_file ]] && cd $lib_dir && curl -sO $lib1_link
            adobelib_dir=$(dirname "$curr_file")
            echo -n "replacing " && sudo cp -vf $lib1_file $adobelib_dir
        elif [[ $name == "TextModel" ]]; then
            echo "emptying $curr_file"
            sudo echo -n >$curr_file
        else
            echo "patching $curr_file"
            sudo perl -i -pe 's|\x90\x90\x90\x90\x56\xE8\x6A\x00|\x90\x90\x90\x90\x56\xE8\x3A\x00|sg' $curr_file
            sudo perl -i -pe 's|\x90\x90\x90\x90\x56\xE8\x4A\x00|\x90\x90\x90\x90\x56\xE8\x1A\x00|sg' $curr_file
        fi
    done
done
  1. Now copy-paste the below command to terminal and run it (enter password if asked).
agent_dir="${HOME}/Library/LaunchAgents"
env_file="${agent_dir}/environment.plist"
lib_dir="${HOME}/Documents/AdobeLibs"
lib2_file="${lib_dir}/libfakeintel.dylib"
lib2_link="https://raw.githubusercontent.com/naveenkrdy/Misc/master/Libs/libfakeintel.dylib"

sw_vers -productVersion | grep "11" >/dev/null 2>&1
if [[ $? == 0 ]]; then
    [[ ! -d $lib_dir ]] && mkdir $lib_dir
    [[ ! -f $lib2_file ]] && cd $lib_dir && curl -sO $lib2_link
    env="launchctl setenv DYLD_INSERT_LIBRARIES $lib2_file"
else
    mkl_value=$(
        sysctl -n machdep.cpu.brand_string | grep FX >/dev/null 2>&1
        echo $(($? != 0 ? 5 : 4))
    )
    env="launchctl setenv MKL_DEBUG_CPU_TYPE $mkl_value"
fi

[[ ! -d $agent_dir ]] && mkdir $agent_dir
cat >$env_file <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>Label</key>
 <string>mkl-debug</string>
 <key>ProgramArguments</key>
 <array>
 <string>sh</string>
 <string>-c</string>
    <string>$env;</string>
 </array>
 <key>RunAtLoad</key>
 <true/>
</dict>
</plist>
EOF

launchctl load ${AGENT} >/dev/null 2>&1
launchctl start ${AGENT} >/dev/null 2>&1
  1. Reboot macOS.

Revert Instructions

  • To revert run the following command as required.
    • To revert step-3
files_list=(MMXCore FastCore TextModel libiomp5.dylib)
for file in $files_list; do
    find /Applications/Adobe* -type f -name $file | while read -r curr_file; do
        sudo -v
        [[ -f ${curr_file}.back ]] && echo "Restoring backup $curr_file"&& sudo mv -f ${curr_file}.back $curr_file
    done
done
  • To revert step-4
agent_dir="${HOME}/Library/LaunchAgents"
env_file="${agent_dir}/environment.plist"
if [[ -f $env_file ]]; then
    echo "Deleting $env_file"
    launchctl unload ${env_file} >/dev/null 2>&1
    launchctl stop ${env_file} >/dev/null 2>&1
    rm -rf $env_file
fi
  1. Reboot macOS
@svan71
Copy link

svan71 commented Apr 15, 2022

app opens fine and crashes once a pic is loaded

@cayquecastellucci
Copy link

@naveenkrdy Works great on latest Photoshop version, but still crashes while selecting font, due to Deep_Font issue. Crash log: https://pastebin.com/FBbgTd23 It can be fixed by remove this plugin: sudo find /Applications/Adobe* -name "Deep_Font" -exec rm -r {} +

hello, I used your code, photoshop stopped closing when clicking on the font, but it still shows an error when clicking on the font: `` It was not possible to complete your request because LoadDeepFontCache in GetDeepFontCache failed´´

@fabiosun
Copy link

search for AmdFriend script and you will find a great solution for adobe Suite and many others patch which use MKL Intel libraries
(Adobe suite, Autodesk Maya, and Mathematica, matLabs, Waves plugin and so on)

@IM-SPYBOY
Copy link

replacing cp: /Users/spyboy/Documents/AdobeLibs/libiomp5.dylib: No such file or directory

@IM-SPYBOY
Copy link

found /Applications/Adobe Premiere Pro 2024/Adobe Premiere Pro 2024.app/Contents/PlugIns/(AfterEffectsLib)/(AdobePSL)/extensions/MMXCore.plugin/Contents/MacOS/MMXCore
Password:
patching /Applications/Adobe Premiere Pro 2024/Adobe Premiere Pro 2024.app/Contents/PlugIns/(AfterEffectsLib)/(AdobePSL)/extensions/MMXCore.plugin/Contents/MacOS/MMXCore
found /Applications/Adobe Audition 2024/Adobe Audition 2024.app/Contents/Frameworks/libiomp5.dylib
replacing cp: /Users/spyboy/Documents/AdobeLibs/libiomp5.dylib: No such file or directory
found /Applications/Adobe Premiere Pro 2024/Adobe Premiere Pro 2024.app/Contents/Frameworks/libiomp5.dylib
replacing cp: /Users/spyboy/Documents/AdobeLibs/libiomp5.dylib: No such file or directory

@micticsorox
Copy link

https://pastebin.com/5S4aYY3T

I get the following error, could someone help me please?

What happens to me is that if Photoshop opens, but when I load some PSDs or make some modifications, it closes and gives me this error.

Thanks in advance.

@velfern
Copy link

velfern commented Jan 23, 2024

https://pastebin.com/5S4aYY3T

I get the following error, could someone help me please?

What happens to me is that if Photoshop opens, but when I load some PSDs or make some modifications, it closes and gives me this error.

Thanks in advance.

Disable SIP (System Integrity Protection)

@walasmiranda
Copy link

https://pastebin.com/TUasYaf5

ja desatvei o SIP E ESSE ERRO CONTINUA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment