LIEF
LIEF copied to clipboard
malformed mach-o image: dyld lazy bind info overlaps weak bind info
MachO: Google Chrome 97.0.4692.71
Lief version: v0.11.5
MacOS M1
Code:
void inject() {
std::unique_ptr<LIEF::MachO::FatBinary> binaries{LIEF::MachO::Parser::parse("/Users/jasonlee/Desktop/Google Chrome 2")};
const std::string new_lib ("/usr/local/lib/libHook.dylib");
for (LIEF::MachO::Binary& binary : *binaries) {
binary.remove_signature();
binary.add_library(new_lib);
}
binaries->write("/Users/jasonlee/Desktop/Google Chrome.patched");
}
then google chrome crashed
crash report
Process: Google Chrome [52390]
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Identifier: com.google.Chrome
Version: ???
Code Type: X86-64 (Translated)
Parent Process: ??? [1]
Responsible: Google Chrome [52390]
User ID: 501
Date/Time: 2022-01-11 17:32:23.528 +0800
OS Version: macOS 11.6 (20G165)
Report Version: 12
Anonymous UUID: 755CA2F0-0E30-F1B0-96D6-FFCD267193FA
Time Awake Since Boot: 110000 seconds
System Integrity Protection: disabled
Crashed Thread: Unknown
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: DYLD, [0x9] <unknown>
Dyld Error Message:
malformed mach-o image: dyld lazy bind info overlaps weak bind info
Binary images description not available
Model: Macmini9,1, BootROM 6723.140.2, proc 8:4:4 processors, 8 GB, SMC
Graphics: kHW_AppleM1Item, Apple M1, spdisplays_builtin
Memory Module: LPDDR4
AirPort: spairport_wireless_card_type_airport_extreme, wl0: Aug 18 2021 22:48:53 version 18.50.40.11.7.8.123 FWID 01-3ed0e3a2
Bluetooth: Version 8.0.5d7, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
USB Device: USB 3.1 Bus
USB Device: USB 3.1 Bus
USB Device: USB 3.0 Bus
USB Device: Corsair Gaming K70 LUX Keyboard
Thunderbolt Bus: Mac mini, Apple Inc.
Thunderbolt Bus: Mac mini, Apple Inc.