(编辑:jimmy 日期: 2024/12/24 浏览:2)
首先我是良民,国内代·里·商别在这理发店。
文章来自国外大佬QiuChenly的分享,我反正不认识这个人。
文章仅供技术研究交流,不得用于非法牟利并谢绝任何形式的传播。可能造成的一切法律责任由使用者、传播者承担,文章仅用于技术研究交流,其他一切责任作者概不负责。
973E6C508E6C7B6C69F5ADC9ADD551FD.jpg
找到.app/MacOS中CleanMyMac-X二进制文件载入IDA,搜索isAppActivated,找到此函数。
__text:0000000100033339 __CMMacPawAccountActivationManager_isAppActivated_ proc near__text:0000000100033339 ; DATA XREF: __objc_const:0000000100627320↓o__text:0000000100033339__text:0000000100033339 var_8 = byte ptr -8__text:0000000100033339__text:0000000100033339 push rbp__text:000000010003333A mov rbp, rsp__text:000000010003333D sub rsp, 10h__text:0000000100033341 lea rdi, [rbp+var_8]__text:0000000100033345 mov qword ptr [rdi], 0FFFFFFFFFFFFFF9Ch__text:000000010003334C call sub_100373380__text:0000000100033351 test al, al__text:0000000100033353 jnz short loc_100033368__text:0000000100033355 mov edi, 1__text:000000010003335A xor esi, esi__text:000000010003335C call sub_100013463__text:0000000100033361 cmp rax, 9__text:0000000100033365 setz al
sub_100373380函数只要返回true就会认为激活撑过,所以可以patch掉此函数
__text:0000000100373380 sub_100373380 proc near ; CODE XREF: sub_10001FDCA+28↑p__text:0000000100373380 ; +[CMLinkBuilder standardURLTrackingParametersDictionary]+21F↑p ...__text:0000000100373380 push 1__text:0000000100373382 pop rax__text:0000000100373383 retn__text:0000000100373383 sub_100373380 endp
patch后需要重新签名二进制文件
codesign -f -s - --timestamp=none /Applications/CleanMyMac\ X.app/Contents/MacOS/CleanMyMac-X
打开CleanMyMac-X Menu.app中的MacOS文件夹,IDA载入CleanMyMac-X Menu。
搜索isMainAppActivated找到函数 发现是调用了CMMFoundation.framework,遂打开。
CleanMyMac\ X.app/Contents/Library/LoginItems/CleanMyMac-X\ Menu.app/Contents/Frameworks/CMMFoundation.framework
查找isMainAppActivated,发现函数
__text:0000000000073620 ; char __cdecl +[CMSharedProtectedPreferencesBridge isMainAppActivated](CMSharedProtectedPreferencesBridge_meta *self, SEL)__text:0000000000073620 __CMSharedProtectedPreferencesBridge_isMainAppActivated_ proc near__text:0000000000073620 ; DATA XREF: __objc_data:00000000001FB790↓o__text:0000000000073620 push rbp__text:0000000000073621 mov rbp, rsp__text:0000000000073624 call sub_73940__text:0000000000073629 movzx eax, al__text:000000000007362C and eax, 1__text:000000000007362F pop rbp__text:0000000000073630 retn__text:0000000000073630 __CMSharedProtectedPreferencesBridge_isMainAppActivated_ endp
sub_73940被多处引用,返回值设置为true即可破解。
__text:0000000000073940 sub_73940 proc near ; CODE XREF: +[CMSharedProtectedPreferencesBridge isMainAppActivated]+4↑p__text:0000000000073940 ; _$s13CMMFoundation32SharedProtectedPreferencesBridgeC18isMainAppActivatedSbvgZ+5↑j__text:0000000000073940 push 1__text:0000000000073942 pop rax__text:0000000000073943 retn__text:0000000000073943 sub_73940 endp
修改.framework文件时要注意重新签名App文件
codesign -f -s - --timestamp=none --entitlements /Users/qiuchenly/Downloads/未命名文件夹/CMMFoundation.xml /Applications/CleanMyMac\ X.app/Contents/Library/LoginItems/CleanMyMac-X\ Menu.app
其中CMMFoundation.xml内容是一些策略:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"> <dict> <key>com.apple.security.cs.allow-jit</key> <true/> <key>com.apple.security.cs.allow-unsigned-executable-memory</key> <true/> <key>com.apple.security.cs.allow-dyld-environment-variables</key> <true/> <key>com.apple.security.cs.disable-library-validation</key> <true/> <key>com.apple.security.get-task-allow</key> <true/> </dict></plist>
签名后修改的App文件即可使用。
https://github.com/QiuChenly/MacsFanControlCrack/commit/fffa14ad0b3c81ef8f9513d9c2ba9588604b0190