Skip to content

Commit

Permalink
Check codeInfoFlags != nil
Browse files Browse the repository at this point in the history
  • Loading branch information
zorgiepoo committed Jun 30, 2024
1 parent 23e323b commit cede7f8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Bit Slicer/ZGDocumentWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1743,13 +1743,16 @@ - (BOOL)isCurrentProcessProtectedByEntitlement
if (copySigningInfoCode == noErr)
{
NSNumber *codeInfoFlags = signingInformation[(NSString *)kSecCodeInfoFlags];
SecCodeSignatureFlags codeSignatureFlags = codeInfoFlags.unsignedIntValue;

// I don't think kSecCodeSignatureRuntime is really correct (apps can opt into hardened runtime
// and still be debugged), but it's probably a good enough heuristic
if ((codeSignatureFlags & kSecCodeSignatureRestrict) != 0 || (codeSignatureFlags & kSecCodeSignatureRuntime) != 0)
if (codeInfoFlags != nil)
{
return YES;
SecCodeSignatureFlags codeSignatureFlags = codeInfoFlags.unsignedIntValue;

// I don't think kSecCodeSignatureRuntime is really correct (apps can opt into hardened runtime
// and still be debugged), but it's probably a good enough heuristic
if ((codeSignatureFlags & kSecCodeSignatureRestrict) != 0 || (codeSignatureFlags & kSecCodeSignatureRuntime) != 0)
{
return YES;
}
}
}
}
Expand Down

0 comments on commit cede7f8

Please sign in to comment.