icpz / WeChat-AntiDuck

Invalid/Disable AudioDeviceDuck()
55 stars 2 forks source link

m1芯片的macOS上失效 #1

Closed KomiMoe closed 2 years ago

KomiMoe commented 3 years ago

m1芯片的macOS上失效 无任何报错单纯失效

icpz commented 3 years ago

请尝试使用转译模式编译和安装:

arch -arch x86_64 $SHELL

cd /path/to/the/repo

mkdir build && cd build

cmake .. && make

make inject
wyq977 commented 3 years ago

我试了下可以 可以编译但是wechat会闪退

macos 11.2.3 make version 3.81 wechat version 3.0.0 cmake version 3.20.0

log:

Process:               WeChat [86610]
Path:                  /Applications/WeChat.app/Contents/MacOS/WeChat
Identifier:            com.tencent.xinWeChat
Version:               3.0.0 (17842)
Code Type:             X86-64 (Translated)
Parent Process:        ??? [1]
Responsible:           WeChat [86610]
User ID:               501

Date/Time:             2021-04-07 15:31:04.021 +0200
OS Version:            macOS 11.2.3 (20D91)
Report Version:        12
Anonymous UUID:        82EE0F64-3F14-4D9E-A6B0-63023C7D0493

Sleep/Wake UUID:       328E1F6E-AF04-4637-AA30-B1085E26BABF

Time Awake Since Boot: 690000 seconds
Time Since Wake:       21000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x2] Wrong architecture

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: @executable_path/libantiduck.dylib
  Referenced from: /Applications/WeChat.app/Contents/MacOS/WeChat
  Reason: no suitable image found.  Did find:
    /Applications/WeChat.app/Contents/MacOS/libantiduck.dylib: mach-o, but wrong architecture
    /Applications/WeChat.app/Contents/MacOS/libantiduck.dylib: mach-o, but wrong architecture

Binary Images:
       0x102619000 -        0x106f3bfff +com.tencent.xinWeChat (3.0.0 - 17842) <621178D8-89DC-3719-8A06-476F7C369A43> /Applications/WeChat.app/Contents/MacOS/WeChat
       0x110a24000 -        0x110a6afff +org.sparkle-project.Sparkle (1.20.0 913-ge196a24d - 1.20.0) <50C08D08-2F05-3F4A-A50C-46CE14FD6420> /Applications/WeChat.app/Contents/Frameworks/Sparkle.framework/Versions/A/Sparkle
       0x110baa000 -        0x11109bfff +com.tencent.ilinknetwork (1.1.4 - 1.1.4) <C7A68FCC-87B7-37ED-97FC-1E0200EBFF54> /Applications/WeChat.app/Contents/Frameworks/ilink_network.framework/Versions/A/ilink_network
       0x11188c000 -        0x1119ccfff +com.tencent.WCDB (1.0.3 - 1) <C44BD6B9-8140-34B0-A043-9C384D545980> /Applications/WeChat.app/Contents/Frameworks/WCDB.framework/Versions/A/WCDB
       0x111dc5000 -        0x111dcafff +com.tencent.MMLibHooks (1.0 - 1) <92C26B22-EAB0-3D0A-AECC-FC2659FCD4C1> /Applications/WeChat.app/Contents/Frameworks/MMLibHooks.framework/Versions/A/MMLibHooks
       0x111df0000 -        0x111e12fff +com.deusty.CocoaLumberjack (2.3.0 - 1) <6BDB40E8-05DA-32DE-8C81-37632C48E80B> /Applications/WeChat.app/Contents/Frameworks/CocoaLumberjack.framework/Versions/A/CocoaLumberjack
       0x111e9e000 -        0x111ec0fff +com.alamofire.AFNetworking (3.0.0 - 3.1.0) <BDD10371-3F15-3EF9-A0A7-E80EAC53ADF6> /Applications/WeChat.app/Contents/Frameworks/AFNetworking.framework/Versions/A/AFNetworking
       0x111f63000 -        0x112003fff +tencent.matrixreport (1.0 - 1) <2586BD60-1797-3862-B461-CA38A7E71FAA> /Applications/WeChat.app/Contents/Frameworks/matrixreport.framework/Versions/A/matrixreport
       0x2089bb000 -        0x208a56fff  dyld (832.7.3) <0D4EA85F-7E30-338B-9215-314A5A5539B6> /usr/lib/dyld
    0x7ffdffe6c000 -     0x7ffdffedffff +runtime (203.30) <C98E75A6-BDC8-3D5C-B95B-6422005E96D8> /Library/Apple/*/runtime
    0x7fff2021c000 -     0x7fff20255fff  libobjc.A.dylib (818.2) <0F399805-A533-3DC9-A951-1D3DF1442BD9> /usr/lib/libobjc.A.dylib
    0x7fff202e2000 -     0x7fff20337fff  libc++.1.dylib (904.4) <B217D905-4F9C-3DE0-8844-88FAA3C2C851> /usr/lib/libc++.1.dylib
    0x7fff203fd000 -     0x7fff20898fff  com.apple.CoreFoundation (6.9 - 1774.101) <46680730-F553-3297-B602-7A4372447F83> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff20df3000 -     0x7fff20e70fff  com.apple.SystemConfiguration (1.20 - 1.20) <3518EA0E-C32D-32CC-81B9-0F3C83B6430C> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
    0x7fff210df000 -     0x7fff21442fff  com.apple.Foundation (6.9 - 1774.101) <8D9081B3-3F6A-31A0-9B20-1AE5CD8DD747> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff218de000 -     0x7fff21ac6fff  com.apple.CoreText (677.3.0.4 - 677.3.0.4) <9A8DC9A0-1A80-3A26-ACA0-A245D3FFF921> /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText
    0x7fff21ac7000 -     0x7fff2216bfff  com.apple.audio.CoreAudio (5.0 - 5.0) <801E2D1E-7EA5-37DA-8F44-B6D7DD3CE5B9> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
    0x7fff2216c000 -     0x7fff224bdfff  com.apple.security (7.0 - 59754.80.3) <B377D7C7-EDB6-3737-B492-E9872F4C6469> /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x7fff224be000 -     0x7fff2271ffff  libicucore.A.dylib (66109) <8F8D8A8B-4EE0-3C09-9F45-725A1FBDD38C> /usr/lib/libicucore.A.dylib
    0x7fff22a8c000 -     0x7fff22b3afff  com.apple.framework.IOKit (2.0.2 - 1845.81.1) <49AC0177-35A3-3C96-AD9D-3E59923C4761> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fff22b93000 -     0x7fff238f5fff  com.apple.AppKit (6.9 - 2022.30.122) <EA4B3536-A5AF-3E5D-A8E3-A3F795F34F05> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
    0x7fff245f9000 -     0x7fff24a96fff  com.apple.CFNetwork (1220.1 - 1220.1) <04A917FB-DBFB-3432-BA4C-5B860990A420> /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
    0x7fff24e99000 -     0x7fff25552fff  com.apple.CoreGraphics (2.0 - 1463.3.2) <CD74586C-EAE0-3D5A-9B83-AA05E664D1AB> /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
    0x7fff26e5e000 -     0x7fff27128fff  com.apple.QuartzCore (1.11 - 926.8) <04D8759B-1119-3E37-B922-32BDECB7C5D2> /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
    0x7fff2744f000 -     0x7fff27531fff  libxml2.2.dylib (34.9) <E0BF29C7-869B-3DD5-82AE-F36E6398091A> /usr/lib/libxml2.2.dylib
    0x7fff27532000 -     0x7fff2757efff  com.apple.CoreVideo (1.8 - 408.4) <50857F8D-C7CC-3609-B0DB-FC3C7382243B> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
    0x7fff284e5000 -     0x7fff28562fff  com.apple.corelocation (2420.12.16 - 2420.12.16) <8BD49018-78D4-3A81-88AD-47DE1A8E3BFE> /System/Library/Frameworks/CoreLocation.framework/Versions/A/CoreLocation
    0x7fff286d2000 -     0x7fff287bbfff  com.apple.CoreMedia (1.0 - 2765.6.4.2) <8E50C806-C6A2-3B96-B3D2-DA1FFC73D2A8> /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia
    0x7fff28c5b000 -     0x7fff28e99fff  com.apple.ImageIO (3.3.0 - 2130.3.5) <537A58B4-04CC-3405-9591-F09E3D9C87CE> /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
    0x7fff29ae4000 -     0x7fff29bb6fff  com.apple.framework.CoreWLAN (16.0 - 1657) <35927D28-3324-3CAB-9255-276A7022EADC> /System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN
    0x7fff29e82000 -     0x7fff29e86fff  com.apple.xpc.ServiceManagement (1.0 - 1) <FD031028-B702-3909-B2AF-3916404DD4A8> /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
    0x7fff2a3fc000 -     0x7fff2a409fff  libbz2.1.0.dylib (44) <E163D5F9-E202-3A53-817B-8BC40B9293C0> /usr/lib/libbz2.1.0.dylib
    0x7fff2a612000 -     0x7fff2a624fff  libz.1.dylib (76) <6E2BD7A3-DC55-3183-BBF7-3AC367BC1834> /usr/lib/libz.1.dylib
    0x7fff2a6de000 -     0x7fff2a6dffff  libSystem.B.dylib (1292.60.1) <83503CE0-32B1-36DB-A4F0-3CC6B7BCF50A> /usr/lib/libSystem.B.dylib
    0x7fff2a71d000 -     0x7fff2a80dfff  libiconv.2.dylib (59) <AD10ECF4-E137-3152-9612-7EC548D919E8> /usr/lib/libiconv.2.dylib
    0x7fff2bdaa000 -     0x7fff2befcfff  com.apple.VideoToolbox (1.0 - 2765.6.4.2) <425BDD2D-6C26-3D09-AD9F-942EA387B2A4> /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox
    0x7fff2ca15000 -     0x7fff2cdfbfff  libswiftCore.dylib (5.3.3 - 1200.2.41.2) <572E5A7C-6252-3B0D-8C7B-FC3BD4FD43DF> /usr/lib/swift/libswiftCore.dylib
    0x7fff2cec1000 -     0x7fff2cff1fff  com.apple.audio.toolbox.AudioToolbox (1.14 - 1.14) <8E53C25F-9FE2-372E-8374-6A598D72C4C1> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
    0x7fff2d0e9000 -     0x7fff2d101fff  libresolv.9.dylib (68) <7B043B4A-71CE-3F6E-91F0-CBBED47A9EA9> /usr/lib/libresolv.9.dylib
    0x7fff2e74a000 -     0x7fff2e7a9fff  com.apple.QuickLookFramework (5.0 - 928.2) <969AAF4A-CD64-32CB-97D7-31C8E17600FD> /System/Library/Frameworks/QuickLook.framework/Versions/A/QuickLook
    0x7fff30229000 -     0x7fff30229fff  com.apple.CoreServices (1122.11 - 1122.11) <E59859C6-7221-3324-BB58-F910B2199959> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x7fff304f7000 -     0x7fff304f7fff  com.apple.Accelerate (1.11 - Accelerate 1.11) <40317321-FF2B-38B7-B584-7CC4C5F5A889> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
    0x7fff3088d000 -     0x7fff30a01fff  libswiftFoundation.dylib (20) <CB5CE9C1-2D32-39F6-8C96-8953CBCAD36F> /usr/lib/swift/libswiftFoundation.dylib
    0x7fff3194c000 -     0x7fff31961fff  libswiftDispatch.dylib (4.40.2) <9025F60B-B3EF-35C1-B9E6-5E79F0CAB02B> /usr/lib/swift/libswiftDispatch.dylib
    0x7fff33875000 -     0x7fff33875fff  com.apple.audio.units.AudioUnit (1.14 - 1.14) <8CF768B8-836B-3DA8-9F0A-8CF840348202> /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
    0x7fff338fe000 -     0x7fff338fffff  libswiftObjectiveC.dylib (1) <F04DFC6C-AD92-3925-B649-79EC184CFBD8> /usr/lib/swift/libswiftObjectiveC.dylib
    0x7fff352c4000 -     0x7fff352c7fff  com.apple.Cocoa (6.11 - 23) <B0F6AF8E-B85C-3C5C-9812-9CD8BC07ADB2> /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
    0x7fff3673b000 -     0x7fff379e3fff  com.apple.JavaScriptCore (16610 - 16610.4.3.1.7) <0601A804-66EA-3973-B5F6-45731A666F4A> /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore
    0x7fff3c794000 -     0x7fff3c79efff  libswiftCoreGraphics.dylib (2) <1A317C83-2706-39E8-BCFC-F60BF55EF69D> /usr/lib/swift/libswiftCoreGraphics.dylib
    0x7fff3c79f000 -     0x7fff3c7a8fff  libswiftDarwin.dylib (??? - ???) <FC02BB31-9EA4-3AA1-9E93-3CDF8E37F780> /usr/lib/swift/libswiftDarwin.dylib
    0x7fff3c845000 -     0x7fff3d282fff  com.apple.WebKit (16610 - 16610.4.3.1.7) <1ACAB6CE-CDA6-36E9-96AD-3385F9D8D29B> /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit
    0x7fff3d435000 -     0x7fff3d438fff  com.apple.Carbon (160 - 164) <7395C7E9-AE3B-3547-8773-4F3A70B241AA> /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
    0x7fff3d532000 -     0x7fff3d532fff  com.apple.avfoundation (2.0 - 2005.3.4.1) <1AF4D877-CCAE-31A8-BF87-95FC261EE427> /System/Library/Frameworks/AVFoundation.framework/Versions/A/AVFoundation
    0x7fff3d533000 -     0x7fff3d652fff  com.apple.AVKit (1.1 - 730.4.2) <245B1832-BC3D-3EB9-9D34-67BA27BB69CE> /System/Library/Frameworks/AVKit.framework/Versions/A/AVKit
    0x7fff3e03e000 -     0x7fff3e046fff  libswiftCoreAudio.dylib (1.1) <D2BE306A-8F33-3709-981D-26492155D87C> /usr/lib/swift/libswiftCoreAudio.dylib
    0x7fff3e047000 -     0x7fff3e047fff  libswiftCoreFoundation.dylib (1.6) <9BB95393-E396-34B1-81A7-79299BF3C9D1> /usr/lib/swift/libswiftCoreFoundation.dylib
    0x7fff3e053000 -     0x7fff3e053fff  libswiftXPC.dylib (1.1) <1FEEB510-200C-3111-AD11-63FE95AD3823> /usr/lib/swift/libswiftXPC.dylib
    0x7fff3e054000 -     0x7fff3e054fff  libswiftCoreImage.dylib (1) <00EC91A1-D421-38DE-A7CB-99CA4D63BB77> /usr/lib/swift/libswiftCoreImage.dylib
    0x7fff3e055000 -     0x7fff3e055fff  libswiftIOKit.dylib (1) <A953C1BF-6F9F-34F9-9313-77C38CB39E98> /usr/lib/swift/libswiftIOKit.dylib
    0x7fff406b0000 -     0x7fff406cafff  libswiftsimd.dylib (1.3) <075C04ED-96D7-3ABF-BCAB-D77D82A8825B> /usr/lib/swift/libswiftsimd.dylib
    0x7fff41854000 -     0x7fff41857fff  com.apple.quartzframework (1.5 - 25) <19311613-BABD-3AF9-A347-06D13169B4EF> /System/Library/Frameworks/Quartz.framework/Versions/A/Quartz
    0x7fff41c51000 -     0x7fff41c52fff  libswiftCoreLocation.dylib (5) <097FF6CE-EA82-37FE-80D5-C338083E9870> /usr/lib/swift/libswiftCoreLocation.dylib
    0x7fff4255b000 -     0x7fff4255ffff  libswiftCoreData.dylib (3) <AEE52E64-7CE5-3733-AF5B-9B205DFFA05B> /usr/lib/swift/libswiftCoreData.dylib
    0x7fff46835000 -     0x7fff4683afff  libswiftMetal.dylib (1.3.1) <4E8FC296-EB8B-357D-AC4F-0FF40EDDFC27> /usr/lib/swift/libswiftMetal.dylib
    0x7fff48e4d000 -     0x7fff48e61fff  libswiftAppKit.dylib (103.10) <B10C9F46-38E3-31C6-906F-73BDEE71066A> /usr/lib/swift/libswiftAppKit.dylib
    0x7fff48e62000 -     0x7fff48e63fff  libswiftQuartzCore.dylib (1) <2CD19DDC-8039-3A30-9F8D-226E604719FA> /usr/lib/swift/libswiftQuartzCore.dylib
    0x7fff4edc2000 -     0x7fff4edf9fff  libswiftCoreMedia.dylib (1) <2EAF49CB-BD9E-3BFF-B08E-27C709F54A01> /usr/lib/swift/libswiftCoreMedia.dylib
    0x7fff4f974000 -     0x7fff4f97afff  libswiftAVFoundation.dylib (2005.3.4.1) <3F2C53BC-36A4-36E5-85E2-6A3669CA7BC6> /usr/lib/swift/libswiftAVFoundation.dylib
    0x7fff6cb9f000 -     0x7fff6cbaefff  com.apple.opengl (18.1.1 - 18.1.1) <F70AF1B3-D17A-3A0E-A8AC-9D45C5B52BA9> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
    0x7fff6fa61000 -     0x7fff6faa8fff  com.apple.MultipeerConnectivity (172 - 172) <1DB0B204-ED48-3138-AB2C-8B79C1EF9B36> /System/Library/Frameworks/MultipeerConnectivity.framework/Versions/A/MultipeerConnectivity
    0x7fff6faec000 -     0x7fff6fb0efff  com.apple.audio.OpenAL (1.8 - 1.8) <43D5D99A-39C3-30F3-BB9E-5B83EEA9DAFD> /System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL

Model: Macmini9,1, BootROM 6723.81.1, proc 8:4:4 processors, 16 GB, SMC 
Graphics: kHW_AppleM1Item, Apple M1, spdisplays_builtin
Memory Module: lp_ddr4
AirPort: spairport_wireless_card_type_airport_extreme, wl0: Dec 31 2020 21:39:03 version 18.20.222.20.7.8.104 FWID 01-1b2645bc
Bluetooth: Version 8.0.3d9, 3 services, 27 devices, 1 incoming serial ports
Network Service: Ethernet, Ethernet, en0
USB Device: USB 3.1 Bus
USB Device: USB 3.1 Bus
USB Device: USB 3.0 Bus
USB Device: USB Receiver
USB Device: Gaming KB
Thunderbolt Bus: Mac mini, Apple Inc.
Thunderbolt Bus: Mac mini, Apple Inc.
icpz commented 3 years ago

@wyq977 请提供详细的编译步骤,看上去是编译出来的dylib只含有一个指令集的代码。

另外还请尝试根据下述步骤重新编译一次试试:

请尝试使用转译模式编译和安装:

arch -arch x86_64 $SHELL

cd /path/to/the/repo

mkdir build && cd build

cmake .. && make

make inject
wyq977 commented 3 years ago

arch -arch x86_64 $SHELL

编译过程和readme一样

这是什么意思 用rosetta2下面的shell吗

icpz commented 3 years ago

arch -arch x86_64 $SHELL

编译过程和readme一样

这是什么意思 用rosetta2下面的shell吗

对,这是启动一个rosetta2下的shell,后续的指令在这个shell中执行

wyq977 commented 3 years ago

好像可以了 谢谢!

wechat现在还没有universal binary就离谱

On Wed, Apr 7, 2021 at 4:02 PM icpz @.***> wrote:

arch -arch x86_64 $SHELL

编译过程和readme一样

这是什么意思 用rosetta2下面的shell吗

对,这是启动一个rosetta2下的shell,后续的指令在这个shell中执行

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/icpz/WeChat-AntiDuck/issues/1#issuecomment-814940463, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGQJ5MG6Z26WHE5TB4PEQ3TTHRQXRANCNFSM4ZVLWRRQ .

lqscript commented 3 years ago

@icpz 今天微信更新了最新版之后失效了,重新编译了之后提示没有权限打开微信

icpz commented 3 years ago

@icpz 今天微信更新了最新版之后失效了,重新编译了之后提示没有权限打开微信

微信最新版似乎支持原生 m1 运行了,所以不需要在转译模式下 build

lqscript commented 3 years ago

还是不行诶

➜  build git:(master) arch
arm64
➜  build git:(master) cmake ..&& make
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/w/Downloads/WeChat-AntiDuck/build
Consolidate compiler generated dependencies of target fishhook-static
[ 50%] Built target fishhook-static
Consolidate compiler generated dependencies of target antiduck
[100%] Built target antiduck
➜  build git:(master) make inject
[ 40%] Built target fishhook-static
[ 80%] Built target antiduck
[100%] Injecting...
Password:
/Applications/WeChat.app/Contents/MacOS/WeChat already exists. Overwrite it? [y/n] y
Binary is a fat binary with 2 archs.
LC_CODE_SIGNATURE load command found. Remove it? [y/n] y
LC_CODE_SIGNATURE load command found. Remove it? [y/n] y
Added LC_LOAD_DYLIB to all archs in /Applications/WeChat.app/Contents/MacOS/WeChat
Inject successfully!
[100%] Built target inject

然后打开微信就会弹框: 您没有权限来打开应用程序"微信"

icpz commented 3 years ago

那只能等年末我买了 apple silicon mac 再调试了😂手边没有设备

lqscript commented 3 years ago

https://github.com/Sunnyyoung/WeChatTweak-macOS/issues/321#issuecomment-909991534 使用这个解决了,然后看到别的楼层说原因可能是这个 https://github.com/Sunnyyoung/WeChatTweak-macOS/issues/321#issuecomment-910142005 这个是需要上游他们修复吗

IceyBlackTea commented 3 years ago

我m1 mac mini QQ 和 微信测试了都无效,😮‍💨。 编译没有报错。

IceyBlackTea commented 3 years ago

使用lldb来尝试的话报错输出是这样的

% printf "p *(char*)(void(*)())AudioDeviceDuck=0xc3\nq" | lldb -n QQ
(lldb) process attach --name "QQ"
Process 5199 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x0000000189fccdd4 libsystem_kernel.dylib`mach_msg_trap + 8
libsystem_kernel.dylib`mach_msg_trap:
->  0x189fccdd4 <+8>: ret    

libsystem_kernel.dylib`mach_msg_overwrite_trap:
    0x189fccdd8 <+0>: mov    x16, #-0x20
    0x189fccddc <+4>: svc    #0x80
    0x189fccde0 <+8>: ret    
Target 0: (QQ) stopped.

Executable module set to "/Applications/QQ.app/Contents/MacOS/QQ".
Architecture set to: arm64e-apple-macosx-.
(lldb) p *(char*)(void(*)())AudioDeviceDuck=0xc3
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=2, address=0x18b8c3328).
The process has been returned to the state before expression evaluation.
(lldb) q
iceyblacktea@IceyBlackTeas-Mac-mini ~ % printf "p *(char*)(void(*)())AudioDeviceDuck=0xc3\nq" | lldb -n QQ
(lldb) process attach --name "QQ"
error: attach failed: could not find a process named QQ
(lldb) p *(char*)(void(*)())AudioDeviceDuck=0xc3
(lldb) q
icpz commented 3 years ago

使用lldb来尝试的话报错输出是这样的


% printf "p *(char*)(void(*)())AudioDeviceDuck=0xc3\nq" | lldb -n QQ

(lldb) process attach --name "QQ"

Process 5199 stopped

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP

    frame #0: 0x0000000189fccdd4 libsystem_kernel.dylib`mach_msg_trap + 8

libsystem_kernel.dylib`mach_msg_trap:

->  0x189fccdd4 <+8>: ret    

libsystem_kernel.dylib`mach_msg_overwrite_trap:

    0x189fccdd8 <+0>: mov    x16, #-0x20

    0x189fccddc <+4>: svc    #0x80

    0x189fccde0 <+8>: ret    

Target 0: (QQ) stopped.

Executable module set to "/Applications/QQ.app/Contents/MacOS/QQ".

Architecture set to: arm64e-apple-macosx-.

(lldb) p *(char*)(void(*)())AudioDeviceDuck=0xc3

error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=2, address=0x18b8c3328).

The process has been returned to the state before expression evaluation.

(lldb) q

iceyblacktea@IceyBlackTeas-Mac-mini ~ % printf "p *(char*)(void(*)())AudioDeviceDuck=0xc3\nq" | lldb -n QQ

(lldb) process attach --name "QQ"

error: attach failed: could not find a process named QQ

(lldb) p *(char*)(void(*)())AudioDeviceDuck=0xc3

(lldb) q

0xc3 是 x86 的 ret 指令对应的机器码。如果你使用的是 arm64 的 qq 那你要替换成 arm 的机器码。

icpz commented 2 years ago

请尝试最新代码,加入了 m1 的支持,并修复了权限问题(感谢 @lqscript )

Jackjun724 commented 2 years ago

请尝试最新代码,加入了 m1 的支持,并修复了权限问题(感谢 @lqscript )

我尝试克隆最新代码,inject后微信出现您没有权限来打开应用程序“微信”。

icpz commented 2 years ago

我尝试克隆最新代码,inject后微信出现您没有权限来打开应用程序“微信”。

可以贴一下执行下面命令的输出吗

sudo codesign --force --deep --sign - "/Applications/WeChat.app"
Jackjun724 commented 2 years ago

我尝试克隆最新代码,inject后微信出现您没有权限来打开应用程序“微信”。

可以贴一下执行下面命令的输出吗

sudo codesign --force --deep --sign - "/Applications/WeChat.app"

安装WeChatTweak-macOS会出现同样的情况,参考 repo WeChatTweak-macOS 的解决方案先卸载,再重新安装一次即可,如仍无法解决请重启电脑。,在卸载重装后装了WechatTweak,然后重启电脑后WechatTweak生效,再把release的WechatTweak进行替换后就好了

电脑版本 MacBook Pro (13-inch, M1, 2020) OS版本 Big Sur 11.6

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.