I have a signed mac app executable. I initialised NSMutableData with the content of code signed executable. Then I modified some part of the executable and I saved the modified executable. When I tried the run the original app with this modified executable, the app crashed.
Crash log is,
System Integrity Protection: disabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace CODESIGNING, Code 0x2
From the crash log it is clear that it crashed because of invalid code signature. I don't have source code for the app and I'm simply trying to fix some bugs in someone's old app.
So my question is how to remove code signature of a binary in objective c ?