mirror of
https://github.com/NohamR/pyzule-rw.git
synced 2026-10-10 18:39:41 +00:00
fix: can't extract entitlements with codesign (ProcursusTeam/ldid#45)
this issue was originally reported in #8
This commit is contained in:
@@ -36,7 +36,6 @@ class Executable:
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.path = path
|
self.path = path
|
||||||
|
|
||||||
self.bn = os.path.basename(path)
|
self.bn = os.path.basename(path)
|
||||||
|
|
||||||
def is_encrypted(self) -> bool:
|
def is_encrypted(self) -> bool:
|
||||||
|
|||||||
@@ -121,12 +121,14 @@ class MainExecutable(Executable):
|
|||||||
return os.path.getsize(output) > 0
|
return os.path.getsize(output) > 0
|
||||||
|
|
||||||
def merge_entitlements(self, entitlements: str) -> None:
|
def merge_entitlements(self, entitlements: str) -> None:
|
||||||
self.sign_with_entitlements(entitlements)
|
if self.sign_with_entitlements(entitlements):
|
||||||
print("[*] merged new entitlements")
|
print("[*] merged new entitlements")
|
||||||
|
else:
|
||||||
|
print("[!] failed to merge new entitlements, are they valid?")
|
||||||
|
|
||||||
def sign_with_entitlements(self, entitlements: str) -> bool:
|
def sign_with_entitlements(self, entitlements: str) -> bool:
|
||||||
return subprocess.run(
|
return subprocess.run(
|
||||||
[self.ldid, f"-S{entitlements}", "-M", self.path]
|
[self.ldid, f"-S{entitlements}", "-M", "-Cadhoc", self.path]
|
||||||
).returncode == 0
|
).returncode == 0
|
||||||
|
|
||||||
def lief_inject(self, cmd: str) -> None:
|
def lief_inject(self, cmd: str) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user