Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.

Commit 78b56ea

Browse files
committed
Added check for the dyld magic.
1 parent 579aade commit 78b56ea

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

bin/dyldex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ def main():
224224
with open(args.dyld_path, "rb") as f:
225225
dyldCtx = DyldContext(f)
226226

227+
# Check magic
228+
if dyldCtx.header.magic[0:4] != b"dyld":
229+
print("Cache's magic does not start with 'dyld', most likely given a file that's not a cache or the file is broken.") # noqa
230+
return
231+
227232
# enumerate images, create a map of paths and images
228233
imageMap = {}
229234
for imageData in dyldCtx.images:

bin/dyldex_all

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ def _main() -> None:
254254
with open(args.dyld_path, "rb") as f:
255255
dyldCtx = DyldContext(f)
256256

257+
# Check magic
258+
if dyldCtx.header.magic[0:4] != b"dyld":
259+
print("Cache's magic does not start with 'dyld', most likely given a file that's not a cache or the file is broken.") # noqa
260+
return
261+
257262
for image in dyldCtx.images:
258263
imagePath = dyldCtx.readString(
259264
image.pathFileOffset

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='dyldextractor',
5-
version='2.0.3',
5+
version='2.0.4',
66
description='Extract Binaries from Apple\'s Dyld Shared Cache',
77
long_description='file: README.md',
88
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)