From 917a5db0610354fed12544b4ff1279aadb63e5e2 Mon Sep 17 00:00:00 2001 From: MiTHRAL Date: Mon, 15 Jun 2026 15:16:56 -0400 Subject: [PATCH] Initial commit: Forked crossover patcher with absolute path fix --- .DS_Store | Bin 0 -> 6148 bytes LICENSE | 21 +++++++++++++++++ README.md | 24 ++++++++++++++++++++ hook.m | 50 +++++++++++++++++++++++++++++++++++++++++ patch.sh | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ pco.sh | 3 +++ uninstall.sh | 28 +++++++++++++++++++++++ 7 files changed, 188 insertions(+) create mode 100644 .DS_Store create mode 100644 LICENSE create mode 100644 README.md create mode 100644 hook.m create mode 100644 patch.sh create mode 100644 pco.sh create mode 100644 uninstall.sh diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..0df8f3551e1ef326740e73aeab4e3ea4851b5e31 GIT binary patch literal 6148 zcmeHLOHRWu5Pc3+NCk^7Sy~(*5;q7XSyTcR^a8Z$qKH6{O7}Sf2jCD~5Z>5Ul^h-`|4gZk= znY$QU)V!Y2oj-XgzNqQ96PNxeZn3}(3fyCfqBYy}HkUo`1aDa39VJIdvBS3K|Izc0 z>0dIF5#LDOwss~{JTQxEaRKYA@)_#Jt+mugs)+bC9uFa`xTToBvJ_uXozQNjLd*g- S9%-TIM!?aag);D`4EzB2ms 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)"