commit 917a5db0610354fed12544b4ff1279aadb63e5e2 Author: MiTHRAL Date: Mon Jun 15 15:16:56 2026 -0400 Initial commit: Forked crossover patcher with absolute path fix diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..0df8f35 Binary files /dev/null and b/.DS_Store differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..68a70d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 everythinginitsrightplace + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b4b4d72 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# Fork / Rehost of totallynotinteresting/crossover (deleted) +## The README.md is mostly identical, same as the script, only changes being that it uses this repository. +## Have fun! + +how to run: + +umm grant Terminal Full Disk Access. System Settings > Privacy & Security > Full Disk Access(or search "Full Disk Access") and toggle on Terminal + +uh open the terminal (cmd + space, type in terminal, and press the one that literally says "Terminal") + +then just run: +`curl -fsSL https://raw.githubusercontent.com/everythinginitsrightplace/crossover/main/patch.sh | bash` + +then open /Applications/CrossOver.app, should all be good, i hope :p + +check if all good - in menu bar while in crossover, click "CrossOver" > "Unlock Crossover". It should say - "It will stop working in 9999 days" or smth + +if u hav question open an issue, if u have improvements, do not suggest some because i am a cocky nerd (you can still open a pr if u want) + +uhh i'll make an uninstaller sometime when i can remember to + +to codeweavers: dont charge so much for reskinned wine and this wouldnt happen + +[license: MIT](https://github.com/everythinginitsrightplace/crossover/blob/main/LICENSE) diff --git a/hook.m b/hook.m new file mode 100644 index 0000000..050de33 --- /dev/null +++ b/hook.m @@ -0,0 +1,50 @@ +#import +#import + +// the swizzling function :p +void swizzie(Class targetClass, char* selectorName, id block, char* types) +{ + if (!targetClass) + return; + SEL selector = sel_registerName(selectorName); + class_replaceMethod(targetClass, selector, imp_implementationWithBlock(block), types); +} + +__attribute__((constructor)) static void setup() +{ + // try to force the license status + swizzie(objc_getClass("CXApplication"), "isLicensed", ^BOOL(id self) { return YES; }, "B@:"); + swizzie(objc_getClass("CXApplication"), "isTrial", ^BOOL(id self) { return NO; }, "B@:"); + swizzie(objc_getClass("CXApplication"), "daysLeft", ^NSInteger(id self) { return 9999; }, "q@:"); + + // hook into the pyobjc methods + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ + Class demoUtils = nil; + for (int i = 0; i < 100; i++) { + demoUtils = objc_lookUpClass("DemoUtils"); + if (demoUtils) { + swizzie(demoUtils, "demoStatusForLicenseFile:andSig:", ^id(id self, id lic, id sig) { return @[ @NO, @"crazy", @"2099-01-01", @"i was crazy once", @NO ]; }, "@@:@@"); + break; + } + usleep(100000); + } + }); + + // hook into the nag controller + Class nagClass = objc_getClass("DemoNagController"); + if (nagClass) { + swizzie( + nagClass, "showWindow:", + ^void(id self, id sender) { + if ([self respondsToSelector:@selector(runapp:)]) { + // calling the runapp method on the class essentially bypasses the nag without showing the window + [self performSelector:@selector(runapp:) withObject:nil]; + } else { + NSLog(@"ok well if ur getting this either u actaully registered/paid for the app or somehow ur crossover is screwed up and doesnt have the runapp method"); + } + }, + "v@:@"); + } + // suppress the expired strings because :3 + swizzie(objc_getClass("DemoBaseController"), "setExpirationText:", ^void(id self, id text) {}, "v@:@"); +} \ No newline at end of file diff --git a/patch.sh b/patch.sh new file mode 100644 index 0000000..70d038b --- /dev/null +++ b/patch.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# forked from totallynotinteresting/crossover + +CROSSOVER_MACOS_PATH="/Applications/CrossOver.app/Contents/MacOS" +REPO_URL="https://github.com/everythinginitsrightplace/crossover.git" +RAW_URL="https://raw.githubusercontent.com/everythinginitsrightplace/crossover/main" +RELEASE_URL="https://github.com/everythinginitsrightplace/crossover/releases/latest/download/hook.dylib" + +if [ ! -d "$CROSSOVER_MACOS_PATH" ]; then + echo "CrossOver.app was not found at $CROSSOVER_MACOS_PATH" + echo "please make sure that CrossOver.app is in /Applications/" + exit 1 +fi + +cd "$CROSSOVER_MACOS_PATH" || exit 1 + +if git clone "$REPO_URL" crossover_patch; then + cd crossover_patch || exit 1 + # try to build (because who doesnt trust open source right?) + echo "building hook.dylib because this contains the logic" + if clang -dynamiclib -framework Foundation -framework AppKit -o hook.dylib hook.m; then + echo "Build successful." + else + echo "either somethings gone wrong or you dont have clang installed, so so we're gonna download it from the gh directly" + curl -L -o hook.dylib "$RELEASE_URL" + fi +else + echo "bruh u dont have git installed, so we gon do some manual downlaoding instead" + mkdir -p crossover_patch + cd crossover_patch || exit 1 + + echo "this is the thing that kinda makes it work" + curl -L -o pco.sh "$RAW_URL/pco.sh" + + echo "this is the thing that actually does the hooking" + curl -L -o hook.dylib "$RELEASE_URL" +fi + +# ok well if it doesnt exist, you've clearly done something wrong +if [ ! -f hook.dylib ]; then + echo "how the hell is hook.dylib not there?" + cd .. + rm -rf crossover_patch + exit 1 +fi + +echo "signing it because macos is specal like that" +codesign -f -s - hook.dylib + +echo "blah blah moving it to where it belongs" +mv hook.dylib .. +mv ../CrossOver ../CrossOver.o +echo "gotta resign crossover as well because something about macos doing hardened runtime" +codesign -f -s - ../CrossOver.o +sed -i '' 's/hook.dylib/\/Applications\/CrossOver.app\/Contents\/MacOS\/hook.dylib/g' pco.sh +mv pco.sh ../CrossOver +chmod +x ../CrossOver + +cd .. +rm -rf crossover_patch + +echo "uh sure try it out" diff --git a/pco.sh b/pco.sh new file mode 100644 index 0000000..6a1df96 --- /dev/null +++ b/pco.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cd "$(dirname "$0")" +DYLD_INSERT_LIBRARIES=hook.dylib ./CrossOver.o \ No newline at end of file diff --git a/uninstall.sh b/uninstall.sh new file mode 100644 index 0000000..602803d --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,28 @@ +#!/bin/bash +CROSSOVER_MACOS_PATH="/Applications/CrossOver.app/Contents/MacOS" +if [ ! -d "$CROSSOVER_MACOS_PATH" ]; then + echo "CrossOver.app wasnt found in /Applications. nthing to uninstall (or you moved it)." + exit 1 +fi + +cd "$CROSSOVER_MACOS_PATH" || exit 1 + +if [ ! -f "CrossOver.o" ]; then + echo "Backup 'CrossOver.o' wasnt found. Is the patch installed?" + exit 1 +fi + +echo "Removing hook.dylib..." +rm -f hook.dylib + +echo "Removing pco.sh..." +rm -f pco.sh + +echo "Restoring original CrossOver executable..." +rm -f CrossOver # verification +mv CrossOver.o CrossOver + +# just to be safe +chmod +x CrossOver + +echo "Uninstall complete. CrossOver is back to normal. (boooooooo)"