Skip to content

Instantly share code, notes, and snippets.

@xqin
Created August 1, 2022 05:21
Show Gist options
  • Save xqin/20a51ea523a738acfe6773616a26b2c9 to your computer and use it in GitHub Desktop.
Save xqin/20a51ea523a738acfe6773616a26b2c9 to your computer and use it in GitHub Desktop.
HyperSwitch expired patch

HyperSwitch expired!

This beta version has expired.

https://bahoom.com/hyperswitch/appcast-test.xml

  1. 根据关键字 HyperSwitch expired! 定位至使用的函数内.

0.2.593-dev 如下:

void sub_100039a57(void * _block) {
    rax = time(&var_20);
    var_20 = rax;
    if (rax >= 0x62b955d3) {
            rax = [NSAlert alloc];
            rax = [rax init];
            rax = [rax autorelease];
            [rax setAlertStyle:0x0];
            [rax setMessageText:@"HyperSwitch expired!"];
            [rax setInformativeText:@"This beta version has expired."];
            [rax setIcon:[NSImage imageNamed:@"hyperswitch"]];
            [rax addButtonWithTitle:@"Check for Updates ..."];
            [rax addButtonWithTitle:@"Quit"];
            rax = [rax runModal];
            rax = rax << 0x20;
            if (rax != 0x3e900000000) {
                    if (rax == 0x3e800000000) {
                            [[SUUpdater sharedUpdater] resetUpdateCycle];
                            [[SUUpdater sharedUpdater] checkForUpdates:0x0];
                    }
            }
            else {
                    [**_NSApp terminate:0x0];
            }
    }
    return;
}

光标定位在 0x62b955d3 上, 切换到 汇编 模式下:

jl xxx
 48 3D D3 55 B9 62 0F 8C 38 01 00 00

jl 指令 修改为 jg, 调整为相反的判断条件, 以达到 屏蔽过期 弹窗的目的.

jg xxx
 48 3D D3 55 B9 62 0F 8F 38 01 00 00

最后合成 sed 命令.

sed -i 's/\x48\x3D\xD3\x55\xB9\x62\x0F\x8C\x38\x01\x00\x00/\x48\x3D\xD3\x55\xB9\x62\x0F\x8F\x38\x01\x00\x00/' HyperSwitch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment