From e78e494832cc55c9348ec272a38e614d5c5fe032 Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Sun, 24 Dec 2017 21:59:29 +0200 Subject: [PATCH] Add wrapper script to list all files specific to a firmware ID --- README.md | 6 +++++ list_files | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100755 list_files diff --git a/README.md b/README.md index fc20c98..c8a6b45 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,12 @@ cd scripts/ Or you can create your own custom script based on `run_all` or `run_no_pack_no_fs_no_dyld`. Read more below. +If you want to check all files and folders corresponding to a given firmware ID, use the `list_files` wrapper script. It gives you information about the existence and basic properties of those files (IPSW input file, kernelcache, reversed sandbox profiles etc.): + +``` +./list_files iPhone5,1_9.3_13E237 +``` + ## Internals External tools are located in the `tools/` subfolder. They are to be run through two layers of scripts: a lower-layer set of scripts located in the `bin/` subfolder and a higher-layer set of scripts in the `scripts/` subfolder. The scripts in the `scripts/` subfolder are the ones you will work with. diff --git a/list_files b/list_files new file mode 100755 index 0000000..2fbd1fc --- /dev/null +++ b/list_files @@ -0,0 +1,68 @@ +#!/bin/bash + +source config + +if test $# -ne 1; then + echo "Usage: $0 " 1>&2 + echo "" 1>&2 + echo "Argument is firmware identifier (e.g iPhone5,1_9.3_13E237)" 1>&2 + exit 1 +fi + +firmware_id="$1" + +ipsw="$IPSW_STORE"/"$firmware_id"_Restore.ipsw + +out_dir="$OUT_STORE"/"$firmware_id" +decrypted="$out_dir"/decrypted.dmg +rootfs_img="$out_dir"/rootfs.img +fs_archive="$out_dir"/fs.tar.gz +sandboxd="$out_dir"/sandboxd +dyld_shared_cache="$out_dir"/dyld_shared_cache +kernelcache_decrypted="$out_dir"/kernelcache.decrypted +kernelcache="$out_dir"/kernelcache.mach.arm +sandbox_kext="$out_dir"/com.apple.security.sandbox.kext +sb_ops="$out_dir"/sb_ops +sandbox_profiles="$out_dir"/sandbox_profiles +sandbox_bundle="$out_dir"/sandbox_bundle +reversed_profiles="$out_dir"/reversed_profiles + +echo "* ipsw file $ipsw" +ls -l "$ipsw" +file "$ipsw" +echo "* decrypted disk image file $decrypted" +ls -l "$decrypted" +file "$decrypted" +echo "* root filesystem image file $rootfs_img" +ls -l "$rootfs_img" +file "$rootfs_img" +echo "* filesystem archive file $fs_archive" +ls -l "$fs_archive" +file "$fs_archive" +echo "* sandboxd file $sandboxd" +ls -l "$sandboxd" +file "$sandboxd" +echo "* dyld_shared_cache folder $dyld_shared_cache" +ls -ld "$dyld_shared_cache" +ls "$dyld_shared_cache" +echo "* decrypted kernelcache file $kernelcache_decrypted" +ls -l "$kernelcache_decrypted" +file "$kernelcache_decrypted" +echo "* kernelcache file $kernelcache" +ls -l "$kernelcache" +file "$kernelcache" +echo "* sandbox extension file $sandbox_kext" +ls -l "$sandbox_kext" +file "$sandbox_kext" +echo "* sandbox operations file $sb_ops" +ls -l "$sb_ops" +file "$sb_ops" +echo "* sandbox profiles folder $sandbox_profiles" +ls -ld "$sandbox_profiles" +ls "$sandbox_profiles" +echo "* sandbox bundle file $sandbox_bundle" +ls -ld "$sandbox_bundle" +file "$sandbox_bundle" +echo "* reversed profiles folder $reversed_profiles" +ls -ld "$reversed_profiles" +ls "$reversed_profiles"