Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

What does this patch do? #5

Open
tillt opened this issue Apr 20, 2023 · 6 comments
Open

What does this patch do? #5

tillt opened this issue Apr 20, 2023 · 6 comments

Comments

@tillt
Copy link

tillt commented Apr 20, 2023

It appears rather dangerous for anyone to download this patched binary and run it locally. What is extra worrying is that you are not describing what you did to get rid of that popup.

The executable shared here is the original one minus signature and one byte patched;

< 00039350: 0055 4889 e541 5741 5653 5048 8d5d e048  .UH..AWAVSPH.].H
---
> 00039350: 00c3 4889 e541 5741 5653 5048 8d5d e048  ..H..AWAVSPH.].H

... patching in a RETN and by that shortcutting the function that would check for expiration and nag us.

So from my assessment, the results are not dangerous. However, why should anyone trust or believe me? :D

I would suggest instead of distributing a patched binary, go for a live patch of the original on the users' machine. Much cleaner and more transparent - and legally most definitely a better choice.

This should do the same;

#!/usr/bin/env bash
cp /Applications/HyperSwitch.app/Contents/MacOS/HyperSwitch HyperSwitch.original
cp HyperSwitch.original HyperSwitch.unsigned
codesign --remove-signature HyperSwitch.unsigned
cp HyperSwitch.unsigned HyperSwitch.patched
printf "039351: C3" | xxd -r - HyperSwitch.patched
sudo cp HyperSwitch.patched /Applications/HyperSwitch.app/Contents/MacOS/HyperSwitch
@tillt
Copy link
Author

tillt commented Apr 20, 2023

....and this is how HyperDock would equally benefit;

cp /Library/PreferencePanes/HyperDock.prefpane/Contents/MacOS/HyperDock HyperDock.original
cp HyperDock.original HyperDock.unsigned
codesign --remove-signature HyperDock.unsigned
cp HyperDock.unsigned HyperDock.patched
printf "0047E9: C3" | xxd -r - HyperDock.patched
sudo cp HyperDock.patched /Library/PreferencePanes/HyperDock.prefpane/Contents/MacOS/HyperDock

@qzz0518
Copy link
Owner

qzz0518 commented Apr 21, 2023

You are right, and your approach is faster and safer. You can initiate a pull request, and I will merge it.

@brynnb
Copy link

brynnb commented Jun 1, 2023

I tried to do this instead of using the .dmg in this repo, and after following tillt's first comment, when closing and re-opening the HyperSwitch application, it prompts me to enable it in accessibility settings despite already being enabled, and then doesn't actually open the application. Turning it off and on in accessibility settings also didn't work.

Trying to do @tillt 's instructions in their second comment, I get a "no directory found" for the first line. There's no entry in /Library/PreferencePanes/ for HyperSwitch.

For context, app worked fine before trying first comment instructions.

@brynnb
Copy link

brynnb commented Jun 1, 2023

Deleting the app and reinstalling with the original unpatched seems to have resolved the issue? Time will tell.

@tillt
Copy link
Author

tillt commented Jun 1, 2023

There's no entry in /Library/PreferencePanes/ for HyperSwitch.

You did not read carefully :)

/Library/PreferencePanes/.. was for HyperDock.

For HyperSwitch, use /Applications/HyperSwitch.app/Contents/MacOS/HyperSwitch

@brynnb
Copy link

brynnb commented Jun 1, 2023

Silly me. Thanks :)

Repository owner deleted a comment from AybenGulnar Feb 23, 2024
Repository owner deleted a comment from ARRNAV26 Feb 23, 2024
Repository owner deleted a comment from RFH1999 Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@tillt @brynnb @qzz0518 and others