Skip to main content

ipsw-py

ipsw SDK for Python 🚧

PyPI - Downloads


NOTE: This is a work in progress ⚠️

Getting Started

Start the ipsw daemon:

macOS

brew install blacktop/tap/ipswd
brew services start blacktop/tap/ipswd

Linux

⚠️ UNTESTED ⚠️

sudo snap install ipswd

Docker

docker run -d -p 3993:3993 -v `pwd`:/data blacktop/ipswd start

Installing

The latest stable version is available on PyPI. Either add ipsw to your requirements.txt file or install with pip:

pip install ipsw

Geting Started

Get IPSW info

import ipsw

client = ipsw.IpswClient(base_url='tcp://127.0.0.1:3993')

info = client.info.get("iPhone15,2_16.5_20F5028e_Restore.ipsw")
print(f'{info.version} ({info.build})')
for device in info.devices:
    print(f'- {device}')
16.5 (20F5028e)
- iPhone 14 Pro

Get DSC info

import ipsw

client = ipsw.IpswClient(base_url='tcp://127.0.0.1:3993')

dsc = client.dsc.open("20F5028e__iPhone15,2/dyld_shared_cache_arm64e")
print(dsc)
print(dsc.dylibs[0])
<DSC: '(dyld_v1  arm64e) - iOS - FAEC7714-4CCD-3B99-B18F-F5EAB60DE31E'>
{'index': 1, 'name': '/usr/lib/libobjc.A.dylib', 'version': '876.0.0.0.0', 'uuid': '085A190C-6214-38EA-ACCB-428C3E8AFA65', 'load_address': 6443204608}

<Dylib: '64-bit MachO AARCH64 (ARM64e)'>

Get dylib inside DSC info

libswiftCore = dsc.dylib("libswiftCore.dylib")
print(libswiftCore)

Get DSC symbol addresses

syms = dsc.sym_addrs([{'pattern': '.*zero.*', 'image': 'libsystem_c.dylib'}])
print(syms)

Convert between DSC offsets and addresses

off = dsc.a2o(7624591060)
adr = dsc.o2a(61146836)

Lookup DSC symbol by address

print(next(dsc.a2s([7624591060])))
{"address":7624591060,"symbol":"__exit","demanged":"__exit","mapping":"__TEXT","uuid":"3AB55994-1201-3908-BE27-52BB7EFA7573","ext":".21","image":"/usr/lib/system/libsystem_kernel.dylib","section":"__text","segment":"__TEXT"}

Get MachO info

import ipsw

client = ipsw.IpswClient(base_url='tcp://127.0.0.1:3993')

macho = client.macho.open("/bin/ls", arch="arm64e")
print(macho)
<Macho: '64-bit MachO AARCH64 (ARM64e)'>

Community

You have questions, need support and or just want to talk about ipsw-py?

Here are ways to get in touch with the ipsw-py community:

Join Discord Follow Twitter Follow Mastodon GitHub Discussions

License

MIT Copyright (c) 2023 blacktop

Metadata

Release files for ipsw 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipsw 0.1.4
File Size Uploaded Provenance
ipsw-0.1.4.tar.gz 36.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ipsw 0.1.4
File Interpreter ABI Platform
ipsw-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 72.1 kB

Release files / ipsw-0.1.4.tar.gz

Download URL ipsw-0.1.4.tar.gz
Size 36.7 kB
Tags Source
SHA-256 checksum
How to use checksums
afe9b5ed097d4a004e1981997d40cb92a4c878a25a5d6025299c20883f16fbe3
BLAKE2b-256 checksum
How to use checksums
3c8a01c44b1fe56972ab48f22adfb316d3db4fb2f54b4b137a52488def04ac55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / ipsw-0.1.4-py3-none-any.whl

Download URL ipsw-0.1.4-py3-none-any.whl
Size 35.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7364d919f47818b8d8a6996230162b581825bf0c65e1b82d98dbf1cf5710de36
BLAKE2b-256 checksum
How to use checksums
d0f57491988a64571c840ca214bca41f429c8a38c8effa9756a5fbb0c55d4532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Security for ipsw 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page