mirror of
https://github.com/NohamR/pyzule-rw.git
synced 2026-10-11 02:49:40 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ae265b413 | ||
|
|
740d3716dc | ||
|
|
5ce7a0cb43 | ||
|
|
04a40f2aa6 | ||
|
|
6845281446 | ||
|
|
54da4485a5 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -6,3 +6,6 @@ build/
|
|||||||
*.cyan
|
*.cyan
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
*.ipa
|
||||||
|
*.app/
|
||||||
|
|
||||||
|
|||||||
@@ -102,9 +102,13 @@ def main() -> None:
|
|||||||
"--overwrite", action="store_true",
|
"--overwrite", action="store_true",
|
||||||
help="overwrite existing files without confirming"
|
help="overwrite existing files without confirming"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--tv", action="store_true",
|
||||||
|
help="inject tvOS-compatible CydiaSubstrate instead of iOS"
|
||||||
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--version", action="version", version="cyan v1.4.3"
|
"--version", action="version", version="cyan v1.4.5"
|
||||||
)
|
)
|
||||||
|
|
||||||
from cyan import logic
|
from cyan import logic
|
||||||
|
|||||||
BIN
cyan/extras/CydiaSubstrate_tvos.framework/CydiaSubstrate
Normal file
BIN
cyan/extras/CydiaSubstrate_tvos.framework/CydiaSubstrate
Normal file
Binary file not shown.
25
cyan/extras/CydiaSubstrate_tvos.framework/Info.plist
Normal file
25
cyan/extras/CydiaSubstrate_tvos.framework/Info.plist
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>CydiaSubstrate</string>
|
||||||
|
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>ellekit</string>
|
||||||
|
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>ElleKit</string>
|
||||||
|
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.1.3</string>
|
||||||
|
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1.1.3</string>
|
||||||
|
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
27
cyan/extras/CydiaSubstrate_tvos.framework/LICENSE
Normal file
27
cyan/extras/CydiaSubstrate_tvos.framework/LICENSE
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
Copyright (c) 2022 Évelyne Bélanger All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following disclaimer
|
||||||
|
in the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
* Neither ElleKit nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
BIN
cyan/extras/zero.requirements
Normal file
BIN
cyan/extras/zero.requirements
Normal file
Binary file not shown.
@@ -55,7 +55,7 @@ def main(parser: ArgumentParser) -> None:
|
|||||||
app.remove_encrypted_extensions()
|
app.remove_encrypted_extensions()
|
||||||
|
|
||||||
if args.f is not None:
|
if args.f is not None:
|
||||||
app.executable.inject(args.f, tmpdir)
|
app.executable.inject(args.f, tmpdir, tvos=args.tv)
|
||||||
if args.n is not None:
|
if args.n is not None:
|
||||||
app.plist.change_name(args.n)
|
app.plist.change_name(args.n)
|
||||||
if args.v is not None:
|
if args.v is not None:
|
||||||
|
|||||||
@@ -13,7 +13,10 @@ class Executable:
|
|||||||
otool = f"{specific}/otool"
|
otool = f"{specific}/otool"
|
||||||
idylib = f"{specific}/insert_dylib"
|
idylib = f"{specific}/insert_dylib"
|
||||||
|
|
||||||
starters = ("\t/Library/", "\t@rpath", "\t@executable_path")
|
# adding /usr/lib/ now, idk why i didnt before. lets hope nothing breaks
|
||||||
|
## LITERALLY 2 DAYS LATER. WHAT THE FUCK IS @LOADER_PATH HELP
|
||||||
|
## i will cry if only checking for '@' will break this.
|
||||||
|
starters = ("\t/Library/", "\t/usr/lib/", "\t@")
|
||||||
|
|
||||||
# substrate could show up as
|
# substrate could show up as
|
||||||
# CydiaSubstrate.framework, libsubstrate.dylib, EVEN CydiaSubstrate.dylib
|
# CydiaSubstrate.framework, libsubstrate.dylib, EVEN CydiaSubstrate.dylib
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class MainExecutable(Executable):
|
|||||||
else:
|
else:
|
||||||
self.inj_func = self.lief_inject
|
self.inj_func = self.lief_inject
|
||||||
|
|
||||||
def inject(self, tweaks: dict[str, str], tmpdir: str) -> None:
|
def inject(self, tweaks: dict[str, str], tmpdir: str, tvos: bool = False) -> None:
|
||||||
ENT_PATH = f"{self.bundle_path}/cyan.entitlements"
|
ENT_PATH = f"{self.bundle_path}/cyan.entitlements"
|
||||||
PLUGINS_DIR = f"{self.bundle_path}/PlugIns"
|
PLUGINS_DIR = f"{self.bundle_path}/PlugIns"
|
||||||
FRAMEWORKS_DIR = f"{self.bundle_path}/Frameworks"
|
FRAMEWORKS_DIR = f"{self.bundle_path}/Frameworks"
|
||||||
@@ -106,10 +106,19 @@ class MainExecutable(Executable):
|
|||||||
real = self.common[missing]["name"] # e.g. "Orion.framework"
|
real = self.common[missing]["name"] # e.g. "Orion.framework"
|
||||||
ip = f"{FRAMEWORKS_DIR}/{real}"
|
ip = f"{FRAMEWORKS_DIR}/{real}"
|
||||||
existed = tbhutils.delete_if_exists(ip, real)
|
existed = tbhutils.delete_if_exists(ip, real)
|
||||||
shutil.copytree(f"{self.install_dir}/extras/{real}", ip)
|
|
||||||
|
if tvos and missing == "substrate.":
|
||||||
|
src = f"{self.install_dir}/extras/CydiaSubstrate_tvos.framework"
|
||||||
|
else:
|
||||||
|
src = f"{self.install_dir}/extras/{real}"
|
||||||
|
|
||||||
|
shutil.copytree(src, ip)
|
||||||
|
|
||||||
if not existed:
|
if not existed:
|
||||||
|
if not tvos:
|
||||||
print(f"[*] auto-injected {real}")
|
print(f"[*] auto-injected {real}")
|
||||||
|
else:
|
||||||
|
print(f"[*] auto-injected {real} (tvos)")
|
||||||
|
|
||||||
# FINALLY !!
|
# FINALLY !!
|
||||||
if self.inj is not None: # type: ignore
|
if self.inj is not None: # type: ignore
|
||||||
@@ -137,9 +146,12 @@ class MainExecutable(Executable):
|
|||||||
print("[!] failed to merge new entitlements, are they valid?")
|
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", "-Cadhoc", self.path]
|
self.ldid,
|
||||||
).returncode == 0
|
f"-S{entitlements}", "-M", "-Cadhoc",
|
||||||
|
f"-Q{self.install_dir}/extras/zero.requirements",
|
||||||
|
self.path
|
||||||
|
]).returncode == 0
|
||||||
|
|
||||||
def lief_inject(self, cmd: str) -> None:
|
def lief_inject(self, cmd: str) -> None:
|
||||||
if self.inj is None: # type: ignore
|
if self.inj is None: # type: ignore
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -4,10 +4,10 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="cyan",
|
name="cyan",
|
||||||
version="1.4.3",
|
version="1.4.5",
|
||||||
description="finally, pyzule doesn't suck",
|
description="finally, pyzule doesn't suck",
|
||||||
author="zx",
|
author="zx",
|
||||||
author_email="zx@hrzn.email",
|
author_email="z@zxcvbn.fyi",
|
||||||
packages=["cyan", "cyan.tbhtypes", "cgen"],
|
packages=["cyan", "cyan.tbhtypes", "cgen"],
|
||||||
python_requires=">=3.9",
|
python_requires=">=3.9",
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user