diff --git a/cyan/tbhtypes/executable.py b/cyan/tbhtypes/executable.py index b83c026..2e535d6 100644 --- a/cyan/tbhtypes/executable.py +++ b/cyan/tbhtypes/executable.py @@ -36,7 +36,6 @@ class Executable: ) self.path = path - self.bn = os.path.basename(path) def is_encrypted(self) -> bool: diff --git a/cyan/tbhtypes/main_executable.py b/cyan/tbhtypes/main_executable.py index 24d4d8a..09d7384 100644 --- a/cyan/tbhtypes/main_executable.py +++ b/cyan/tbhtypes/main_executable.py @@ -121,12 +121,14 @@ class MainExecutable(Executable): return os.path.getsize(output) > 0 def merge_entitlements(self, entitlements: str) -> None: - self.sign_with_entitlements(entitlements) - print("[*] merged new entitlements") + if self.sign_with_entitlements(entitlements): + print("[*] merged new entitlements") + else: + print("[!] failed to merge new entitlements, are they valid?") def sign_with_entitlements(self, entitlements: str) -> bool: return subprocess.run( - [self.ldid, f"-S{entitlements}", "-M", self.path] + [self.ldid, f"-S{entitlements}", "-M", "-Cadhoc", self.path] ).returncode == 0 def lief_inject(self, cmd: str) -> None: