From 13fbf8fc33e856e5fec4a65494e7b96383fd1ce2 Mon Sep 17 00:00:00 2001 From: flw Date: Mon, 24 Aug 2020 20:22:06 +0800 Subject: [PATCH] feat: add `restore-all` command --- README.md | 5 ++++- cmd/irestore/irestore.go | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 46d2ec4..a4023ad 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Selected MyPad 43686f636f6c61746552616d656b696e73546f6f Usage: ls [domain] restore domain dest + restore-all dest dumpkeys [outputfile] apps ``` @@ -28,6 +29,8 @@ The `ls` command will list domains or files in a domain. The `restore` command will restore the files in a domain into a directory tree. +The `restore-all` command will restore the all files into a directory tree. + The `dumpkeys` command will dump the readable portions of the keychain to json. The `apps` command will list the installed apps. @@ -63,4 +66,4 @@ There are a few changes in iOS 10.2. The Manifest database itself is encrypted, Further, the keybag has a second round of PBKDF2 with different parameters and a sha256 hash function. This one takes about 10 seconds in Go, so the code now prints the decrypted key in hex. If you provide this hex key instead of your password, you can skip the long key derivation step. -(iOS 10.2 details came from a github thread.) \ No newline at end of file +(iOS 10.2 details came from a github thread.) diff --git a/cmd/irestore/irestore.go b/cmd/irestore/irestore.go index cbcbcfa..eab54cd 100644 --- a/cmd/irestore/irestore.go +++ b/cmd/irestore/irestore.go @@ -289,6 +289,7 @@ func main() { fmt.Println(`Usage: ls [domain] restore domain dest + restore-all dest dumpkeys [outputfile] apps `) @@ -311,6 +312,15 @@ func main() { } else { help() } + case "restore-all": + if len(os.Args) > 3 { + for _, domain := range db.Domains() { + outPath := path.Join(os.Args[3] + domain) + restore(db, domain, outPath) + } + } else { + help() + } case "apps": apps(db) case "dumpkeys":