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

Commit 3eb1f5f

Browse files
authored
Merge pull request #56 from RobLinux/dyldex_all-filter
Added filtering option for dyldex_all
2 parents 34f95db + 998a433 commit 3eb1f5f

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ __pycache__
22
.vscode/
33
dist
44
src/*.egg-info
5+
venv
56

67
# Big files like the shared cache should be excluded from the repo
78
binaries/

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ dyldex -e SpringBoard.framework/SpringBoard [dyld_shared_cache_path]
2121
# Extracting all frameworks/libraries from a shared cache
2222
dyldex_all [dyld_shared_cache_path]
2323
24+
# Extracting all frameworks/libraries from a shared cache containing name
25+
dyldex_all -f <Filter Text> [dyld_shared_cache_path]
26+
2427
# In any of the above examples, replace "dyldex" and "dyldex_all" with "kextex" and "kextex_all" respectively to extract images from a MH_FILESET kernelcache instead of a DSC
2528
2629
```

bin/dyldex_all

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class _DyldExtractorArgs(argparse.Namespace):
4848
output: pathlib.Path
4949
jobs: int
5050
verbosity: int
51+
filter: str
5152
pass
5253

5354

@@ -74,6 +75,11 @@ def _createArgParser() -> argparse.ArgumentParser:
7475
type=int,
7576
help="Increase verbosity, Option 1 is the default. | 0 = None | 1 = Critical Error and Warnings | 2 = 1 + Info | 3 = 2 + debug |" # noqa
7677
)
78+
parser.add_argument(
79+
"-f", "--filter",
80+
type=str,
81+
help="Extract libraries containing the filter in their name."
82+
)
7783

7884
return parser
7985

@@ -244,7 +250,11 @@ def _main() -> None:
244250
# Create a job for each image
245251
jobs: List[Tuple[str, multiprocessing.pool.AsyncResult]] = []
246252
jobsComplete = 0
253+
filterEnabled = args.filter is not None
247254
for i, imagePath in enumerate(imagePaths):
255+
if filterEnabled and args.filter not in imagePath:
256+
continue
257+
248258
# The index should correspond with its index in the DSC
249259
extractionArgs = (args.dyld_path, outputDir, i, imagePath, loggingLevel)
250260
jobs.append((imagePath, pool.apply_async(_extractImage, extractionArgs)))

bin/kextex_all

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class _DyldExtractorArgs(argparse.Namespace):
4949
output: pathlib.Path
5050
jobs: int
5151
verbosity: int
52+
filter: str
5253
pass
5354

5455

@@ -75,6 +76,11 @@ def _createArgParser() -> argparse.ArgumentParser:
7576
type=int,
7677
help="Increase verbosity, Option 1 is the default. | 0 = None | 1 = Critical Error and Warnings | 2 = 1 + Info | 3 = 2 + debug |" # noqa
7778
)
79+
parser.add_argument(
80+
"-f", "--filter",
81+
type=str,
82+
help="Extract libraries containing the filter in their name."
83+
)
7884

7985
return parser
8086

@@ -218,7 +224,11 @@ def _main() -> None:
218224
# Create a job for each image
219225
jobs: List[Tuple[str, multiprocessing.pool.AsyncResult]] = []
220226
jobsComplete = 0
227+
filterEnabled = args.filter is not None
221228
for i, imagePath in enumerate(imagePaths):
229+
if filterEnabled and args.filter not in imagePath:
230+
continue
231+
222232
# The index should correspond with its index in the DSC
223233
extractionArgs = (args.kc_path, outputDir, i, imagePath, loggingLevel)
224234
jobs.append((imagePath, pool.apply_async(_extractImage, extractionArgs)))

0 commit comments

Comments
 (0)