From 3fd0ce9ffedf5ba97cab63484d1ee0dd0270e7b5 Mon Sep 17 00:00:00 2001 From: BlackDragon Date: Thu, 23 Oct 2025 20:56:54 +0200 Subject: [PATCH] hell yeah new binary patcher thing and a license --- .config example | 7 ++- .gitignore | 1 + LICENSE | 6 +++ configure.sh | 46 ------------------ imagestore/index.csv | 66 ++++++++++++------------- init.sh | 77 +++++++++++++++++++++++------- launch.sh | 8 +++- patches/10-binpatch.sh | 56 ++++++++++++++++++++++ patches/10-segatools.sh | 2 + patches/11-icf.sh | 2 + patches/11-networking.sh | 2 + patches/15-ledstub.sh | 3 +- patches/15-openssl.sh | 2 + patches/15-wacca1-fixname.sh | 3 +- patches/5-pfx.sh | 2 + patches/50-disableclosingtime.sh | 3 ++ patches/50-disablenetenv.sh | 2 + patches/50-inject-customs.sh | 11 +++++ patches/binpatch/chn.xd3 | Bin 289 -> 0 bytes patches/binpatch/enginelocale.xd3 | Bin 300 -> 0 bytes patches/binpatch/hiddenscreen.xd3 | Bin 299 -> 0 bytes patches/binpatch/lockout.xd3 | Bin 312 -> 0 bytes 22 files changed, 198 insertions(+), 101 deletions(-) create mode 100644 LICENSE delete mode 100755 configure.sh mode change 100644 => 100755 patches/10-binpatch.sh create mode 100644 patches/50-disableclosingtime.sh create mode 100755 patches/50-inject-customs.sh delete mode 100644 patches/binpatch/chn.xd3 delete mode 100644 patches/binpatch/enginelocale.xd3 delete mode 100644 patches/binpatch/hiddenscreen.xd3 delete mode 100644 patches/binpatch/lockout.xd3 diff --git a/.config example b/.config example index f65ef72..5d015ce 100644 --- a/.config example +++ b/.config example @@ -1,7 +1,10 @@ WORKDIR="/tmp/wacca" MOUNT_AS_ROOT=true +MANGOHUD_ENABLE=false +AIRGAP=false # Disable downloading game requirements and expect them to be present offline +ENABLE_CUSTOM_CHARTS=false # Enable injecting custom charts from customcharts folder # VERSION -VERSION="" +VERSION="3.07.01" # NETWORKING NET_KEYCHIP_ID="" NET_HOSTNAME="" @@ -14,5 +17,5 @@ PORT_AIME_READER="" BINPATCH_DISABLE_LOCKOUT=0 # Fully disable lockout BINPATCH_FORCE_ENGINE_LOCALE=0 # Force Engine locale (ignore router country language) BINPATCH_ALLOW_CHN_REGION=0 # Allow using CHN region (don't change to HKG) -BINPATCH_FORCE_HIDDEN_LUIN_TITLE=1 # Force enable Hidden Luin title screen +BINPATCH_FORCE_HIDDEN_LUIN_TITLE=0 # Force enable Hidden Luin title screen ENABLE_EN_US_TRANSLATION=1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8c6b1fc..58b9f39 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ images/* imagestore/app/*.app imagestore/vhd/*.vhd +customcharts/* .config \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2979c2b --- /dev/null +++ b/LICENSE @@ -0,0 +1,6 @@ +POTION SELLER PUBLIC LICENSE +Copyright (c) 2025 BlackDragon + +THIS SOFTWARE IS TOO STRONG FOR YOU, USER. YOU CAN'T HANDLE MY SOFTWARE. IT'S TOO STRONG FOR YOU. MY STRONGEST SOFTWARE WOULD KILL YOU, USER. YOU CAN'T HANDLE MY STRONGEST SOFTWARE. YOU'D BETTER GO TO A DEVELOPER WHO WRITES WEAKER SOFTWARE. YOU DON'T KNOW WHAT YOU ASK, USER. MY STRONGEST SOFTWARE WOULD KILL A SYSTEMS PROGRAMMER, LET ALONE A MAN. YOU NEED A DEVELOPER WHO WRITES WEAKER SOFTWARE, BECAUSE MY SOFTWARE IS TOO STRONG. YOU CAN'T HANDLE MY STRONGEST SOFTWARE. NO ONE CAN. I CAN'T GIVE YOU MY STRONGEST SOFTWARE, BECAUSE MY STRONGEST SOFTWARE IS ONLY FOR THE STRONGEST BEINGS, AND YOU ARE OF THE WEAKEST. + +The above copyright notice and this permission notice shall be included in all copies or substantial potions of the Software. diff --git a/configure.sh b/configure.sh deleted file mode 100755 index b71cf9f..0000000 --- a/configure.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - - -selectversion() { - versions=() - count=0 - for profile_dir in profiles/*/; do - # Remove the trailing slash to get clean directory name - count=$[count+1] - echo $profile_dir - source $profile_dir/metadata - echo $prettyname - versions+=("$version" "$prettyname") - done - exec 3>&1; - sel=$(dialog --menu "Select major version" 20 60 10 "${versions[@]}" 2>&1 1>&3) - for profile_dir in profiles/*/; do - source $profile_dir/metadata - if [[ "$sel" == "$version" ]]; then - profile=$(basename $profile_dir) - versions2=() - count=0 - while IFS=, read -r vhd version identifier backingversion parent_identifier parent_filename - do - echo $vhd - count=$[count+1] - versions2+=("$version" "$vhd") - done < images/lookup/phase1_$profile.csv - exec 3>&1; - sel=$(dialog --menu "Select an item:" 20 60 10 "${versions2[@]}" 2>&1 1>&3) - sed -i "s/VERSION=.*/VERSION=\"$sel\"/" .config - fi - done -} - -setserver() { - source .config - exec 3>&1; - - hostname=$(dialog --title "Network" --inputbox "Server Hostname" 10 30 "${NET_HOSTNAME:-}" 2>&1 1>&3) - keychip=$(dialog --inputbox "Modify keychip id" 10 30 "${NET_KEYCHIP_ID:-A$(printf "%02d" $((RANDOM % 100)))$(shuf -e E X | head -n1)-$(shuf -e 01 20 | head -n1)$(shuf -e A B C D U | head -n1)$(tr -dc 0-9 &1 1>&3) - sed -i "s/NET_HOSTNAME=.*/NET_HOSTNAME=\"$hostname\"/" .config - sed -i "s/NET_KEYCHIP_ID=.*/NET_KEYCHIP_ID=\"$keychip\"/" .config -} -setserver -# selectversion \ No newline at end of file diff --git a/imagestore/index.csv b/imagestore/index.csv index fa9f409..c615599 100644 --- a/imagestore/index.csv +++ b/imagestore/index.csv @@ -1,33 +1,33 @@ -1.00.00,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.00_20190703184305_0.app, -1.00.01,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.01_20190726165725_1_1.00.00.app, -1.00.02,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.02_20190828145748_2_1.00.01.app, -1.00.03,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.03_20190925193020_3_1.00.02.app, -1.00.04,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.04_20191023154049_4_1.00.03.app, -1.00.05,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.06_20191217194809_6_1.00.05.app, -1.50.00,https://archive.org/download/WACCA/EXP/1.50.00%20USB/SDFE_1.50.00_20191225123843_0.app,S #CORRUPT -1.50.01,https://archive.org/download/WACCA/EXP/SDFE_1.50.01_20200130145033_1_1.50.00.app,S -1.50.02,https://archive.org/download/WACCA/EXP/SDFE_1.50.02_20200227161144_2_1.50.01.app,S -1.50.03,https://archive.org/download/WACCA/EXP/SDFE_1.50.03_20200316131604_3_1.50.02.app,S -1.50.04,https://archive.org/download/WACCA/EXP/SDFE_1.50.04_20200325170234_4_1.50.03.app,S -1.50.05,https://archive.org/download/WACCA/EXP/SDFE_1.50.05_20200608155410_5_1.50.04.app,S -1.50.06,https://archive.org/download/WACCA/EXP/SDFE_1.50.06_20200722145703_6_1.50.05.app,S -2.00.00,https://archive.org/download/WACCA/EXP/2.00.00%20USB/SDFE_2.00.00_20200813163739_0.app,Lily -2.01.00,https://archive.org/download/WACCA/EXP/SDFE_2.01.00_20200923205643_1_2.00.00.app,Lily -2.02.00,https://archive.org/download/WACCA/EXP/SDFE_2.02.00_20201030154849_2_2.01.00.app,Lily -2.03.00,https://archive.org/download/WACCA/EXP/SDFE_2.03.00_20201130071007_3_2.02.00.app,Lily -2.04.00,https://archive.org/download/WACCA/EXP/SDFE_2.04.00_20210114100544_4_2.03.00.app,Lily -2.5x.xx,https://archive.org/download/WACCA/EXP/2.00.00%20USB/SDFE_2.00.00_20200813163739_0.app,Lily R -2.50.00,https://archive.org/download/WACCA/EXP/SDFE_2.50.00_20210129180947_1_2.00.00.app,Lily R -2.51.00,https://archive.org/download/WACCA/EXP/SDFE_2.51.00_20210309120850_2_2.50.00.app,Lily R -2.52.00,https://archive.org/download/WACCA/EXP/SDFE_2.52.00_20210426101902_2_2.50.00.app,Lily R -2.53.00,https://archive.org/download/WACCA/EXP/SDFE_2.53.00_20210607052915_3_2.52.00.app,Lily R -3.00.00,https://archive.org/download/WACCA/EXP/3.00.00%20USB/SDFE_3.00.00_20210701023921_0.app,Reverse -3.01.00,https://archive.org/download/WACCA/EXP/SDFE_3.01.00_20210817052556_1_3.00.00.app,Reverse -3.02.00,https://archive.org/download/WACCA/EXP/SDFE_3.02.00_20210927052723_2_3.01.00.app,Reverse -3.03.00,https://archive.org/download/WACCA/EXP/SDFE_3.03.00_20211112063023_3_3.02.00.app,Reverse -3.04.00,https://archive.org/download/WACCA/EXP/SDFE_3.04.00_20211208062838_4_3.03.00.app,Reverse -3.05.00,https://archive.org/download/WACCA/EXP/SDFE_3.05.00_20220203063543_5_3.04.00.app,Reverse -3.06.00,https://archive.org/download/WACCA/EXP/SDFE_3.06.00_20220412064126_6_3.05.00.app,Reverse -3.07.00,https://archive.org/download/WACCA/EXP/SDFE_3.07.00_20220609093125_7_3.06.00.app,Reverse -3.07.01,https://archive.org/download/WACCA/EXP/SDFE_3.07.01_20220628165934_8_3.07.00.app,Reverse -3.10.00,https://archive.org/downloadWACCA/SDFE_3.10.00/SDFE_3.10.00_20220630054729_0.app,Reverse \ No newline at end of file +1.00.00,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.00_20190703184305_0.app +1.00.01,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.01_20190726165725_1_1.00.00.app +1.00.02,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.02_20190828145748_2_1.00.01.app +1.00.03,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.03_20190925193020_3_1.00.02.app +1.00.04,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.04_20191023154049_4_1.00.03.app +1.00.05,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.06_20191217194809_6_1.00.05.app +1.50.00,https://archive.org/download/WACCA/EXP/1.50.00%20USB/SDFE_1.50.00_20191225123843_0.app +1.50.01,https://archive.org/download/WACCA/EXP/SDFE_1.50.01_20200130145033_1_1.50.00.app +1.50.02,https://archive.org/download/WACCA/EXP/SDFE_1.50.02_20200227161144_2_1.50.01.app +1.50.03,https://archive.org/download/WACCA/EXP/SDFE_1.50.03_20200316131604_3_1.50.02.app +1.50.04,https://archive.org/download/WACCA/EXP/SDFE_1.50.04_20200325170234_4_1.50.03.app +1.50.05,https://archive.org/download/WACCA/EXP/SDFE_1.50.05_20200608155410_5_1.50.04.app +1.50.06,https://archive.org/download/WACCA/EXP/SDFE_1.50.06_20200722145703_6_1.50.05.app +2.00.00,https://archive.org/download/WACCA/EXP/2.00.00%20USB/SDFE_2.00.00_20200813163739_0.app +2.01.00,https://archive.org/download/WACCA/EXP/SDFE_2.01.00_20200923205643_1_2.00.00.app +2.02.00,https://archive.org/download/WACCA/EXP/SDFE_2.02.00_20201030154849_2_2.01.00.app +2.03.00,https://archive.org/download/WACCA/EXP/SDFE_2.03.00_20201130071007_3_2.02.00.app +2.04.00,https://archive.org/download/WACCA/EXP/SDFE_2.04.00_20210114100544_4_2.03.00.app +2.5x.xx,https://archive.org/download/WACCA/EXP/2.00.00%20USB/SDFE_2.00.00_20200813163739_0.app +2.50.00,https://archive.org/download/WACCA/EXP/SDFE_2.50.00_20210129180947_1_2.00.00.app +2.51.00,https://archive.org/download/WACCA/EXP/SDFE_2.51.00_20210309120850_2_2.50.00.app +2.52.00,https://archive.org/download/WACCA/EXP/SDFE_2.52.00_20210426101902_2_2.50.00.app +2.53.00,https://archive.org/download/WACCA/EXP/SDFE_2.53.00_20210607052915_3_2.52.00.app +3.00.00,https://archive.org/download/WACCA/EXP/3.00.00%20USB/SDFE_3.00.00_20210701023921_0.app +3.01.00,https://archive.org/download/WACCA/EXP/SDFE_3.01.00_20210817052556_1_3.00.00.app +3.02.00,https://archive.org/download/WACCA/EXP/SDFE_3.02.00_20210927052723_2_3.01.00.app +3.03.00,https://archive.org/download/WACCA/EXP/SDFE_3.03.00_20211112063023_3_3.02.00.app +3.04.00,https://archive.org/download/WACCA/EXP/SDFE_3.04.00_20211208062838_4_3.03.00.app +3.05.00,https://archive.org/download/WACCA/EXP/SDFE_3.05.00_20220203063543_5_3.04.00.app +3.06.00,https://archive.org/download/WACCA/EXP/SDFE_3.06.00_20220412064126_6_3.05.00.app +3.07.00,https://archive.org/download/WACCA/EXP/SDFE_3.07.00_20220609093125_7_3.06.00.app +3.07.01,https://archive.org/download/WACCA/EXP/SDFE_3.07.01_20220628165934_8_3.07.00.app +3.10.00,https://archive.org/download/WACCA/SDFE_3.10.00/SDFE_3.10.00_20220630054729_0.app \ No newline at end of file diff --git a/init.sh b/init.sh index b552144..9385843 100755 --- a/init.sh +++ b/init.sh @@ -1,11 +1,13 @@ #!/bin/bash +set -e source .config workdir=${WORKDIR:-/tmp/wacca} version=${VERSION:-3.07.01} +airgap=${AIRGAP:-false} check_prereqs () { - tools=("vhdimount" "umu-run" "fsdecrypt" "xdelta3" "aria2c") + tools=("vhdimount" "umu-run" "fsdecrypt" "aria2c" "udisksctl") echo "Checking for required tools..." echo "==============================" @@ -33,7 +35,7 @@ check_prereqs () { # GET NEEDED APPS FROM $VERSION get_required_app () { apps="" - while IFS=',' read -r version url prettyname; do + while IFS=',' read -r version url; do apps+="$url," if [[ "$version" == "$VERSION" ]]; then break @@ -41,7 +43,29 @@ get_required_app () { done < <(grep "$(echo "^$VERSION" | cut -c1-4)" imagestore/index.csv) } +import_from_ins () { + result=$(blkid | grep SEGA_INS | head -n 1 | cut -d: -f1 ) + if [ -n "${result:-}" ]; then + echo "Checking SEGA_INS for SDFE .app files..." + udisksctl mount --block-device $result + mount_point=$(findmnt -n -o TARGET $result) + for file in $mount_point/SDFE*.app; do + basename=$(basename $file) + if [ -f "imagestore/app/$basename" ]; then + echo "$basename: File already present on target, skipping." + else + echo "$basename: Adding file." + pv $file > imagestore/app/$basename + fi + done + udisksctl unmount --block-device $result + else + echo "SEGA_INS not found, skipping." + fi +} + extract_apps () { + missingapps=() mkdir -p imagestore/vhd for url in ${apps//,/ }; do local file=$(basename "$url") @@ -57,15 +81,27 @@ extract_apps () { fi else if [ ! -f imagestore/vhd/$vhd ]; then - echo "Downloading $file" - aria2c -x 8 -j 8 -o imagestore/app/$file $url + if [ "$airgap" = false ]; then + echo "Downloading $file" + aria2c -x 8 -j 8 -o imagestore/app/$file $url - echo "Decrypting $file" - fsdecrypt imagestore/app/$file - mv imagestore/app/$vhd imagestore/vhd/ + echo "Decrypting $file" + fsdecrypt imagestore/app/$file + mv imagestore/app/$vhd imagestore/vhd/ + else + echo $file + missingapps+=("$file") + fi fi fi done + if [ ${#missingapps[@]} -gt 0 ]; then + echo "ERROR: Missing following .app files for specified version:" + for app in ${missingapps[@]}; do + echo "- "$app + done + exit 2 + fi } patchbin () { @@ -112,10 +148,17 @@ mount () { sudo="sudo" fi local vhdpath=$(grep "^$version" imagestore/index.csv | cut -d',' -f2 | xargs basename | sed -E "s/.app/.vhd/") - mkdir -p $workdir/$version/{dev,lower,upper,game,work} - $sudo vhdimount imagestore/vhd/$vhdpath $workdir/$version/dev - $sudo mount -t ntfs -o offset=$((2048*512)),uid=$(id -u),gid=$(id -g) $($sudo find $workdir/$version/dev -maxdepth 1 -type f | sort -V | tail -1) $workdir/$version/$profile/lower - $sudo mount overlay -t overlay -o lowerdir=$workdir/$version/lower,upperdir=$workdir/$version/upper,workdir=$workdir/$version/work $workdir/$version/game + mkdir -p $workdir/$version/{lower,upper,game,work} || true + if [ -z "$($sudo ls -A "$workdir/$version/dev")" ]; then + mkdir -p $workdir/$version/dev || true + $sudo vhdimount imagestore/vhd/$vhdpath $workdir/$version/dev + fi + if ! df -h | grep -q "$workdir/$version/lower"; then + $sudo mount -t ntfs -o offset=$((2048*512)),uid=$(id -u),gid=$(id -g) $($sudo find $workdir/$version/dev -maxdepth 1 -type f | sort -V | tail -1) $workdir/$version/$profile/lower + fi + if ! df -h | grep -q "$workdir/$version/game"; then + $sudo mount overlay -t overlay -o lowerdir=$workdir/$version/lower,upperdir=$workdir/$version/upper,workdir=$workdir/$version/work $workdir/$version/game + fi } apply_patches () { @@ -126,7 +169,6 @@ apply_patches () { cd ./patches for script in $(ls -1v 2>/dev/null); do - grep -qxF "$script" "$dir/patches"; [ -f "$script" ] && [ -r "$script" ] || continue if ! grep -qxF "$script" "$dir/patches"; then @@ -155,10 +197,11 @@ apply_patches () { done } -check_prereqs -get_required_app -extract_apps -patchbin -mount +# check_prereqs +# get_required_app +# import_from_ins +# extract_apps +# patchbin +# mount apply_patches # patchbin "images/vhd/SDFE_2.53.00_20210607052915_3_2.52.00.vhd.old" \ No newline at end of file diff --git a/launch.sh b/launch.sh index 7bc653c..f1a8ad8 100755 --- a/launch.sh +++ b/launch.sh @@ -4,4 +4,10 @@ workdir=${WORKDIR:-/tmp/wacca} version=${VERSION:-3.07.01} dir=$workdir/$version -WINEPREFIX=$dir/prefix umu-run $dir/game/bin/launch.bat \ No newline at end of file +if [ "$MANGOHUD_ENABLE" = false ]; then + mangohud="" +else + mangohud="mangohud" +fi + +WINEPREFIX=$dir/prefix $OPT_ARGS $mangohud umu-run $dir/game/bin/launch.bat \ No newline at end of file diff --git a/patches/10-binpatch.sh b/patches/10-binpatch.sh old mode 100644 new mode 100755 index e69de29..12102f6 --- a/patches/10-binpatch.sh +++ b/patches/10-binpatch.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# SAUCE: https://github.com/Raymonf/whack/blob/master/MercuryPatcher/index.html +set -e + +disable_lockout=${BINPATCH_DISABLE_LOCKOUT:-false} +force_engine_locale=${BINPATCH_FORCE_ENGINE_LOCALE:-false} +allow_chn_region=${BINPATCH_ALLOW_CHN_REGION:-false} +force_hidden_luin_title=${BINPATCH_FORCE_HIDDEN_LUIN_TITLE:-false} + +dir=/tmp/wacca/3.07.01 +file=$dir/game/WindowsNoEditor/Mercury/Binaries/Win64/Mercury-Win64-Shipping.exe + +patch () { + local offbytes=$1 + local onbytes=$2 + local len=${#offbytes} + local result=$(((len / 2))) + local offset=$3 + local enable=$4 + local description=$5 + + local byte_value=$(dd if="$file" bs=1 count=$result skip=$offset 2>/dev/null | hexdump -v -e '/1 "%02X"') + if [ "$byte_value" = "$offbytes" ]; then + echo -n "[$description] Patch disabled" + if [ "$enable" = true ]; then + echo "$onbytes" | sed 's/\([0-9A-F]\{2\}\)/\\x\1/g' | xargs -0 printf | dd of="$file" bs=1 count=$result seek=$offset conv=notrunc 2>/dev/null + echo -e " -> \u001b[1menabled\u001b[22m" + else + echo "" + fi + elif [ "$byte_value" = "$onbytes" ]; then + echo -n "[$description] Patch enabled" + if [ "$enable" = false ]; then + echo "$offbytes" | sed 's/\([0-9A-F]\{2\}\)/\\x\1/g' | xargs -0 printf | dd of="$file" bs=1 count=$result seek=$offset conv=notrunc 2>/dev/null + echo -e " -> \u001b[1mdisabled\u001b[22m" + else + echo "" + fi + else + echo "Patch not applicable - byte is 0x$byte_value (expected 0x$offbytes or 0x$onbytes)" + fi +} + +if [ "$VERSION" = "3.07.01" ]; then + patch E82B5AE4FF4533C0418D5004488BCBE80CACEDFF84C07512BA06 909090909090909090909090909090909090909090909090BA00 5175664 $disable_lockout "Fully disable lockout 0" + patch BA02 BA00 5175718 $disable_lockout "Fully disable lockout 1" + patch 488D552048 E979FFFFFF 5175794 $disable_lockout "Fully disable lockout 2" + + patch 7407 9090 5603668 $force_engine_locale "Force Engine locale (ignore router country language)" + + patch 75 EB 32682167 $allow_chn_region "Allow using CHN region (don't change to HKG)" + + patch 74 EB 5181434 $force_hidden_luin_title "Force enable Hidden Luin title screen" +else + echo "Binary patches not applicable to $VERSION, skipping..." +fi diff --git a/patches/10-segatools.sh b/patches/10-segatools.sh index a9bfb7c..0cc5be5 100755 --- a/patches/10-segatools.sh +++ b/patches/10-segatools.sh @@ -1,3 +1,5 @@ +#!/bin/bash +set -e if [ -z ${dir+x} ]; then echo "\$dir not set, skipping."; exit 22; else wget https://gitea.tendokyu.moe/TeamTofuShop/segatools/releases/download/latest/segatools.zip -O /tmp/segatools.zip mkdir -p $dir/segatools/{amfs,appdata,option} diff --git a/patches/11-icf.sh b/patches/11-icf.sh index 99a7651..3d3d63d 100644 --- a/patches/11-icf.sh +++ b/patches/11-icf.sh @@ -1,3 +1,5 @@ +#!/bin/bash +set -e if [ -z ${dir+x} ]; then echo "\$dir not set, skipping."; exit 22; else if [ -z ${icf+x} ]; then echo "ICF url not set, skipping."; else wget $icf -O $dir/segatools/amfs/ICF1 diff --git a/patches/11-networking.sh b/patches/11-networking.sh index 6d66fb0..6e8bc5d 100644 --- a/patches/11-networking.sh +++ b/patches/11-networking.sh @@ -1,3 +1,5 @@ +#!/bin/bash +set -e if [ -z ${NET_KEYCHIP_ID:-} ]; then echo "Keychip id not set, skipping."; sed -i '/^\[\/Script\/Mercury.MercuryNetworkSettings\]/,/^OfflineMode=false/ s/^OfflineMode=false/OfflineMode=true/' $dir/game/WindowsNoEditor/Mercury/Config/DefaultHardware.ini diff --git a/patches/15-ledstub.sh b/patches/15-ledstub.sh index 2787c90..81f658f 100644 --- a/patches/15-ledstub.sh +++ b/patches/15-ledstub.sh @@ -1,3 +1,4 @@ -sed -i '/^\[elisabeth\]/,/^enable=1/ s/^enable=1/enable=0/' $dir/game/bin/segatools.ini +#!/bin/bash +set -e cp ../wacca_led.dll $dir/game/WindowsNoEditor/Mercury/Plugins/ElizabethPlugin/Source/LEDDevice/Source/Runtime/Public/Externals/USBIntLED.DLL rm $dir/game/WindowsNoEditor/Mercury/Plugins/ElizabethPlugin/Source/LEDDevice/Source/Runtime/Public/Externals/USBIntLED_.DLL \ No newline at end of file diff --git a/patches/15-openssl.sh b/patches/15-openssl.sh index e16537e..81cf2e7 100644 --- a/patches/15-openssl.sh +++ b/patches/15-openssl.sh @@ -1,3 +1,5 @@ +#!/bin/bash +set -e if [ -z ${dir+x} ]; then echo "\$dir not set, skipping."; exit 22; else if grep -q "set OPENSSL_ia32cap=:~0x20000000" $dir/game/bin/launch.bat; then echo "Patch already present in file, skipping."; else sed -i '/@echo off/Ia set OPENSSL_ia32cap=:~0x20000000' $dir/game/bin/launch.bat diff --git a/patches/15-wacca1-fixname.sh b/patches/15-wacca1-fixname.sh index 9eaa17a..8a64d05 100644 --- a/patches/15-wacca1-fixname.sh +++ b/patches/15-wacca1-fixname.sh @@ -1,4 +1,5 @@ - +#!/bin/bash +set -e if [[ "$version" =~ ^1\. ]]; then sed -i 's/Mercury-Win64-Shipping.exe/Mercury.exe/g' $dir/game/bin/launch.bat else diff --git a/patches/5-pfx.sh b/patches/5-pfx.sh index 15ff19d..cefed12 100755 --- a/patches/5-pfx.sh +++ b/patches/5-pfx.sh @@ -1,3 +1,5 @@ +#!/bin/bash +set -e if [ -z ${PORT_CONSOLE_LEFT+x} ]; then echo "Left console binding not set, skipping."; else WINEPREFIX=$dir/prefix umu-run reg add "HKEY_LOCAL_MACHINE\\Software\\Wine\\Ports" /f /v COM3 /t REG_SZ /d "$PORT_CONSOLE_LEFT" #Console touch left fi diff --git a/patches/50-disableclosingtime.sh b/patches/50-disableclosingtime.sh new file mode 100644 index 0000000..bd46bfd --- /dev/null +++ b/patches/50-disableclosingtime.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -e +sed -i 's/^\(.*Closing\(Hour\|Minute\)\)=[0-9-]*/\1=-1/' $dir/game/WindowsNoEditor/Mercury/Config/DefaultGameUserSettings.ini \ No newline at end of file diff --git a/patches/50-disablenetenv.sh b/patches/50-disablenetenv.sh index 35d11f0..6c6a589 100755 --- a/patches/50-disablenetenv.sh +++ b/patches/50-disablenetenv.sh @@ -1,3 +1,5 @@ +#!/bin/bash +set -e cp -r $dir/game/bin/segatools.ini $dir/game/bin/segatools-netenv.ini sed -i '/^\[netenv\]/,/^enable=1/ s/^enable=1/enable=0/' $dir/game/bin/segatools-netenv.ini sed -i '/inject -d -k mercuryhook.dll ..\/WindowsNoEditor\/Mercury\/Binaries\/Win64/i set SEGATOOLS_CONFIG_PATH=./segatools-netenv.ini' $dir/game/bin/launch.bat \ No newline at end of file diff --git a/patches/50-inject-customs.sh b/patches/50-inject-customs.sh new file mode 100755 index 0000000..87fcbea --- /dev/null +++ b/patches/50-inject-customs.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +if command -v "MercuryModder" &> /dev/null; then + echo -e "\033[0;32m✓\033[0m MercuryModder is installed" +else + echo -e "\033[0;31m✗\033[0m MercuryModder is NOT installed" + exit 127 +fi +MercuryModder prepare --tracks ../customcharts +MercuryModder check --tracks ../customcharts +MercuryModder modify --tracks ../customcharts --gameDir $dir/game/WindowsNoEditor --output $dir/game/WindowsNoEditor \ No newline at end of file diff --git a/patches/binpatch/chn.xd3 b/patches/binpatch/chn.xd3 deleted file mode 100644 index 283338880fe6d80f43b701a1363141c5a084f415..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 289 zcmcb1_y_|llX!W2az>tBYDKEPer{?}a%oW|n8VuA(7?bT1ST0+8Iuli`U`_OUvf3y@|eMm5$y26Gx-bNw~1iil!hVE8X|(~*fmk&y?; z?w{c}hmnC(xcSsWb0*=f^E?=UEDNyB6Oc`JJ#t77$@D46aw4B6uRxNUfh;$_^V?6T YT;ru940AwoAO-`_r?+K7rwW5P05uC+jQ{`u diff --git a/patches/binpatch/enginelocale.xd3 b/patches/binpatch/enginelocale.xd3 deleted file mode 100644 index 500d97eb6f11fee1ee4c4feb1a6d74e6519d693e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 300 zcmcb1_y_|llR|lXYF>I~UTRK$a$-)ZUTQ_EzJ6|MQF3WfC78q7($K)bUrpFFoFB8c~wLd0|UcQ8dPs6pkmW=^PhNo} hHv?I2e&@HJP`SoSM;PXSj}GA_~he@Gb20n2qD%SHGf6ho5hL6#HgnZt!7Hvw7B^~fPTB)KWbaw4B6uRxNU gfh;$_^V?6TT;ru940AwoAO-`_owsE|rwW5P0D2E!H2?qr diff --git a/patches/binpatch/lockout.xd3 b/patches/binpatch/lockout.xd3 deleted file mode 100644 index 480cc65460c2d4de6303a590137e6ae6104b0881..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 312 zcmcb1_y_|llXQ7}PJVKBerbtbYDKEPer{?}a%oW|n8VuA(7?dp4I-I1_1QzN^L(AK zi-F-~<^TWxh5wpYMMN<$F#H#~>Bz*O$jAd^_s?*g!^j{c+_d{s0fPjyuq>0a7n^hA zkseNlrrn>pF8_mGVxJ2XsAz?5FEZ2c77vX