破解《Interface Inspector》

Interface Inspector簡介

Interface Inspector是用于查看mac os app界面布局的利器,類似于iOS的Reveal。

破解過程

下載下來打開后,出現(xiàn)一個License窗口:


License

hopperStrings表里面搜索 License ,發(fā)現(xiàn)有這么一個方法:

-[SMLicenseManager isLicensed]

Modify -> Assemble Instruction...(option+a),修改返回值為YES:

                     -[SMLicenseManager isLicensed]:
000000010010fe70         mov        rax, 0x1
000000010010fe77         ret

File -> Produce New Executable...command+shift+e,選擇Remove Signature,替換原可執(zhí)行文件。
然后打開,彈出了:

Signature

它驗證簽名了,我們Strings表里面搜索 Sign ,發(fā)現(xiàn) codeSignState字符串
x查看引用,在applicationWillFinishLaunching中調(diào)用了這個方法:

void -[SMAppDelegate applicationWillFinishLaunching:](void * self, void * _cmd, void * arg2) {
    rdx = arg2;
    rbx = self;
    var_30 = *___stack_chk_guard;
    rax = [NSBundle mainBundle];
    rax = [rax retain];
    var_128 = rax;
    if ([rax codeSignState] != 0x2) goto loc_100024851;
......
loc_100024851:
    r14 = [[NSAlert alloc] init];
    var_F8 = r14;
    r13 = [[NSBundle mainBundle] retain];
    rbx = [[r13 localizedStringForKey:@"Signature of the Interface Inspector is broken" value:@"" table:0x0] retain];

需要把codeSignState的值修改為0x2。
SMFoundation.framework找到這個方法,直接修改:

                     -[NSBundle codeSignState]:
000000000003b298         mov        rax, 0x2
000000000003b29f         ret

替換SMFoundation后再次運行,成功了!

解決Could not attach to application

控制臺查看日志

Error loading /Library/Frameworks/mach_inject_bundle.framework/Resources/mach_inject_bundle_stub.bundle/Contents/MacOS/mach_inject_bundle_stub:  dlopen(/Library/Frameworks/mach_inject_bundle.framework/Resources/mach_inject_bundle_stub.bundle/Contents/MacOS/mach_inject_bundle_stub, 262): Symbol not found: ___pthread_set_self
  Referenced from: /Library/Frameworks/mach_inject_bundle.framework/Resources/mach_inject_bundle_stub.bundle/Contents/MacOS/mach_inject_bundle_stub
  Expected in: /usr/lib/libSystem.B.dylib
 in /Library/Frameworks/mach_inject_bundle.framework/Resources/mach_inject_bundle_stub.bundle/Contents/MacOS/mach_inject_bundle_stub

查閱資料,mach_inject_bundle.framework過期導(dǎo)致:
Fix Bug for Interface Inspector on macOS Serria
去github下載最新源碼:
https://github.com/rentzsch/mach_inject
編譯出mach_inject_bundle.framework文件,放在:

/Library/Frameworks/mach_inject_bundle.framework
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容