Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added: yakuza: like a dragon patches for both gog and steam #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Ultimately, the hope is for this repository to be completely empty, but here we
| [Jusant] | Incompatible DX12 feature detection |
| ~~[Sea of Thieves]~~ | Xbox Live + game authentication issues | [Easy Anti-Cheat] prevents game from running
| ~~[Tomb Raider I-III Remastered]~~ | macOS OpenGL incompatibility | Fixed in CrossOver 24.0.1
| [Yakuza: Like a Dragon] | Missing Rosetta 2 feature bits |

## Tools & Techniques

Expand All @@ -49,3 +50,4 @@ Ultimately, the hope is for this repository to be completely empty, but here we
[Jusant]: jusant
[Sea of Thieves]: sea-of-thieves
[Tomb Raider I-III Remastered]: tomb-raider-I-III-remastered
[Yakuza: Like a Dragon]: https://www.gog.com/en/game/yakuza_like_a_dragon
8 changes: 8 additions & 0 deletions yakuza-like-a-dragon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Yakuza: Like A Dragon AVX feature bit patch

## **Only for GPTk2 under macOS 15**

## Instructions

1. Download the `patch-yakuza.sh` file
2. Run it: `sh patch-yakuza.sh <path/to/tomb123.exe>`, or `sh patch-yakuza.sh` and drag the executable into the Terminal window.
53 changes: 53 additions & 0 deletions yakuza-like-a-dragon/patch-yakuza.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh

HASH_DB=("4c2534598b5c85ee571a21a63ab76c9e2d0d2462909033225eb4a542f079022359f014302061c27f01299f0852253cc196f7b9cfe3f908d1660a1a83cc8531e9:startup.exe"
"f4f0086ca41f7854cd1eb21c38ddf261103cf2dede3cffc2324c199f0bd9786e8d5c94994da7986cf2c4eb92e4e36fdc5532cc87a113e0c13777aa53240ff9be:YakuzaGOG.exe"
"4b150e33788ce15e6f510e16b82ea9939475ef04a321817750dffc2f08fbdb2f20850be5c249b4c9b1a7def8950d004d92326003d9ba74f3b4bd8129384f22f7:YakuzaSteam.exe")

PATCH_DB=(
"startup.exe:0x42c:\xe1\x1c\x73\x31"
"YakuzaGOG.exe:0xf4375c:\x1c\x73\x2d\xff"
"YakuzaSteam.exe:0xf4374c:\x1c\x73\x2d\xff"
)

# First we check $1 for any file path. If not we show a drop area prompt
if [ -z "$1" ]; then
echo "Please drag and drop an executable file here..."
read -r file
if [ -z "$file" ]; then
exit
fi
else
file="$1"
fi

file_hash=$(shasum -a 512 "$file" | cut -d " " -f 1)

for hash in "${HASH_DB[@]}"; do
if [ "$file_hash" = "${hash%%:*}" ]; then
patcher="${hash##*:}"
fi
done

if [ -z "$patcher" ]; then
echo "File not found in database"
exit
fi

# Patch string is in format file:offset:patch
for patch in "${PATCH_DB[@]}"; do
patchstr="${patch%%:*}"
if [ "$patchstr" = "$patcher" ]; then
offset="${patch#*:}"
offset="${offset%%:*}"
hexpatch="${patch#*:}"
hexpatch="${hexpatch#*:}"
break
fi
done

echo "Patching $file"

cp "$file" "$file.bak"
#overwrite the bytes at the specified offset with the patch
printf "$hexpatch" | dd of="$file" bs=1 seek="$offset" conv=notrunc status=none