Created
April 23, 2026 01:49
-
-
Save dosdude1/e0981af2d1bd3fe1da7051dd3c0f49c5 to your computer and use it in GitHub Desktop.
Geekbench 6 macOS engineering sample detection patch
This file contains hidden or 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
| #!/bin/sh | |
| if [ $# -eq 0 ]; then | |
| echo "Usage: patchgb.sh <path to Geekbench 6.app>" | |
| exit 1 | |
| fi | |
| gbPath="$1" | |
| if [ ! -d "$gbPath" ]; then | |
| echo "${gbPath} does not exist" | |
| exit 2 | |
| fi | |
| gbRsrcPath="${gbPath}/Contents/Resources" | |
| arm64bins=("geekbench_aarch64" "geekbench6") | |
| x86bins=("geekbench_x86_64" "geekbench_avx2" "geekbench6") | |
| err=0 | |
| echo "\nPatching arm64 bins..." | |
| for item in "${arm64bins[@]}"; do | |
| echo "Patching ${item}" | |
| perl -pi -e 'BEGIN { $found=0 } $found++ if s|\xA1\x01\x00\x54\xE0\x03\x13\xAA\xFF\xC3\x08\x91|\xA1\x01\x00\x54\x00\x00\x80\xD2\xFF\xC3\x08\x91|g; END { exit 1 unless $found }' "${gbRsrcPath}/${item}" | |
| if [ $? -gt 0 ]; then | |
| echo "Failed to find pattern in ${item}" | |
| err=1 | |
| fi | |
| done | |
| echo "Codesigning arm64 bins..." | |
| for item in "${arm64bins[@]}"; do | |
| codesign -f -s - "${gbRsrcPath}/${item}" | |
| done | |
| echo "\nPatching x86 bins..." | |
| for item in "${x86bins[@]}"; do | |
| echo "Patching ${item}" | |
| perl -pi -e 'BEGIN { $found=0 } $found++ if s|\x75\x15\x44\x89\xF0\x48\x81\xC4\x28\x02\x00\x00|\x75\x15\x90\x31\xC0\x48\x81\xC4\x28\x02\x00\x00|g; END { exit 1 unless $found }' "${gbRsrcPath}/${item}" | |
| if [ $? -gt 0 ]; then | |
| echo "Failed to find pattern in ${item}" | |
| err=1 | |
| fi | |
| done | |
| echo "Codesigning x86 bins..." | |
| for item in "${x86bins[@]}"; do | |
| codesign -f -s - "${gbRsrcPath}/${item}" | |
| done | |
| if [ $err -gt 0 ]; then | |
| echo "\nPatching completed with errors.\n" | |
| exit 3 | |
| fi | |
| echo "\nPatching completed successfully.\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment