Commit Graph
827 Commits
Author SHA1 Message Date
blacktop 3c6c1a54f5 Update sandbox.go 2026-06-04 15:23:21 -06:00
blacktop 4a126e7d99 chore(fmt): go fix 2026-06-04 12:06:59 -06:00
blacktop e209828c31 feat(diff): add cacheable task-based reports
Refactor diff jobs into task-owned renderers with persistent cache support, root-confined walkers, and quieter Mach-O/Firmware output.
2026-06-04 12:02:46 -06:00
blacktop 8a4ee31ea6 fix(macho): size renamed dylib load commands via LoadSize
Renaming a dylib load command recomputed cmdsize from the classic
24-byte dylib_command header, which under-sizes commands using the
dylib_use_command encoding (iOS 18+/macOS 15+, name offset 28 plus
DYLIB_USE_* flags). Use the encoding-aware LoadSize() instead and
deduplicate the per-type switch arms.
2026-06-04 12:00:00 -06:00
blacktop 5235c10533 chore(deps): bump deps 2026-06-02 15:46:59 -06:00
blacktopandGitHub b6980ffa53 feat(symbols): add ipsw symbols --json JSONL emitter (#1239) 2026-06-01 21:03:07 -06:00
blacktop f82fd2a3c3 feat(crashlog): support loose-dylib symbolication for modern Xcode DeviceSupport dumps (#1236) 2026-06-01 18:18:01 -06:00
blacktop ac147706e5 feat(symbolicate): fall back to Xcode DeviceSupport DSC when no IPSW is supplied (#1236) 2026-05-31 21:51:58 -06:00
blacktop d0935380cf chore(diff): add --loc to the ipsw diff cmd 2026-05-26 21:51:49 -06:00
blacktop 1d59db2a51 chore(dl): tune remote zip reads 2026-05-24 16:27:52 -06:00
vnescapeandGitHub a3dc3ecf26 perf: increase remote ZIP block size from 128KiB to 8MiB for firmware extraction (#1230) 2026-05-24 11:28:19 -06:00
blacktop 8b1ad04559 feat(ent): add --fs mode to search IPSW Mach-Os directly
Adds `--fs` flag to bypass the database and scan entitlements
directly from IPSW filesystem DMGs or input folders. Introduces
`--has`/`--without` for required/excluded entitlement key filtering,
`--pem-db` for AEA-encrypted IPSWs, and `--format` (text, tsv, jsonl)
for structured output.
2026-05-22 12:15:02 -06:00
blacktop 90c61bee28 feat(download/pcc): add --os-build filter and beta channel detection 2026-05-20 11:09:19 -06:00
blacktop 1bc3c53e17 fix: formatting 2026-05-15 19:46:56 -06:00
blacktop b7c2d3a370 feat(pcc): update ipsw dl pcc and add vphone600 detection to --info 2026-05-15 19:45:12 -06:00
blacktop 9360b3b7a4 fix: refactor ent file walking to use mounted filesystem root 2026-05-07 11:10:59 -06:00
blacktop 5ce9eb1525 fix: add MountedFilesystemRoot helper and apply it consistently 2026-05-07 10:12:55 -06:00
blacktop c456a6a079 fix: ACP model selection diagnostics 2026-05-05 11:54:39 -06:00
blacktop 01f9d9ff53 fix: ACP decompiler client file reads 2026-05-05 11:07:32 -06:00
blacktop fc41188d93 feat(diff): add sandbox profile diffing behind sandbox build tag 2026-05-03 12:44:18 -06:00
blacktop 4f23763438 feat(extract): auto-decrypt remote kernelcaches via wiki keys
`ipsw download ipsw --kernel` now fetches firmware keys from
theapplewiki and decrypts encrypted kernelcaches inline. Unencrypted
members in the same IPSW pass through unchanged.

- pkg/img4: DecryptPayload reuses Payload.GetData for decompression,
  removing the duplicate LZSS/LZFSE branches.
- pkg/kernelcache: ParseImg4Data switches to img4.ParsePayload and
  exports ErrEncryptedKernelCache so callers can detect the missing-key
  case via errors.Is.
- internal/commands/extract: new keyed remote path with all-or-nothing
  preflight; the encryption-status peek lets unencrypted variants
  succeed even when the wiki has no entry for them.

  closes #1193
2026-04-27 15:57:23 -06:00
blacktop 265c50743e refactor(mount): remove encrypted AEA DMG eagerly after decrypt 2026-04-27 15:54:28 -06:00
Mischan Toosarani-HausbergerandGitHub 8e5434783d fix(mount): cleanup the correct DMG when decrypting AEAs (#1194) 2026-04-27 22:25:36 +02:00
blacktop 314ec71ea4 chore(deps): bump deps 2026-04-20 09:11:56 -06:00
blacktop c03b181ebc fix(dl-db): add hideFromLatestVersions support to AppleDB queries
Skip entries marked `hideFromLatestVersions` in `Latest` and `Query`
when the `Latest` flag is set on the query. Adds tests covering the
skip behavior and fallback to the newest visible release.
2026-04-14 20:44:55 -06:00
blacktop 652abdd7af feat: add OTA input mode support to ipsw diff
Introduces direct OTA file diffing without requiring pre-extraction.
Users can now pass `.ota`/`.aea` files directly to `ipsw diff` alongside
existing IPSW and directory input modes.

Key additions:
- `internal/diff/ota_inputs.go`: OTA-specific input handling including
  cryptex mounting, kernelcache extraction, firmware parsing, iBoot
  parsing, and feature flag collection from mounted volumes
- `inputModeOTA` enum variant in `directory_inputs.go`
- `--key-db`, `--key-val`, and `--insecure` flags on `diff` command for
  AEA-encrypted OTA decryption
- AEA key database lookup mirroring the `ota` command's key resolution
- Magic-byte-aware error handling: AEA/AA files propagate decryption
  errors while ambiguous ZIPs fail silently (not-an-OTA)
- Validation rejects partial/delta and RSR OTAs with actionable messages
- Comprehensive unit tests covering all new helpers
2026-04-13 20:32:10 -06:00
blacktop 2999a9240a fix(dl-ota): --build filter to match prerequisite build in delta mode
In delta OTA mode, `--build` specifies the currently-installed
(prerequisite) build, not the target build. Previously, the build
filter always compared against the target `Build` field, causing
delta queries with `--build` to return no results.

Changes:
- Filter against `PrerequisiteBuild` when `--delta` is set
- Send `BuildVersion: "0"` to Pallas for non-delta/non-RSR requests
  so the server returns all available targets instead of only updates
  newer than the specified build
2026-04-13 20:32:02 -06:00
blacktop c20f9af712 fix: multiple security vulnerabilities (SSRF, path traversal)
- Remove POST /diff/files endpoint that allowed arbitrary host file reads
  (CWE-22); clients must now read files locally and POST content to
  /diff/blobs instead
- Add validatePublicURL() to /info remote endpoints, rejecting URLs that
  resolve to loopback, private, link-local, or multicast addresses to
  prevent SSRF; also remove attacker-controlled proxy/insecure params
- Add SanitizeArchivePath() helper that verifies extracted archive entry
  paths stay within the destination directory (zip-slip / tar-slip,
  CWE-22); replace bare filepath.Join(dest, filepath.Clean(name)) calls
  in SearchZip, OTA parser, AA payload extractor, and ota_extract
- Fix server listen address to use net.JoinHostPort to respect Host config
2026-04-11 14:37:41 -06:00
blacktop eb3093c826 feat(pcc): Add filtering, progress, and version resolution to download pcc
- Add `--build`, `--train`, `--app`, `--version` flags to filter
  releases before interactive selection
- Show a TTY progress bar while fetching the PCC transparency log
- Resolve OS IPSW versions via partial-zip of BuildManifest.plist,
  caching results in `pcc_versions.json` to avoid redundant fetches
- Display build/train/app metadata in release list and info output
- Preflight HEAD-check all assets before downloading to catch CDN
  propagation delays early
- Sort releases by timestamp (newest first) instead of log index
- Auto-generate output directory name from release index and build
- Promote `go-isatty` from indirect to direct dependency
2026-04-09 22:47:53 -06:00
blacktop e18f1031f8 fix(magic): don't error on non-IMG4/IM4P files
IsImg4 and IsIm4p returned errors when ASN.1 parsing failed,
but parse failure just means the file isn't that format. This
broke callers like `kernel kmutil inspect -x` on x86_64 Macs
where the kernel collection is a Mach-O .kc file, not IMG4.

Return (false, nil) for parse failures; only error on I/O failure.

Closes #1081
2026-04-05 22:43:55 -06:00
blacktop 98a84e781c feat(macho): update go-macho to v1.1.268 and improve filename sanitization fixes #1004 2026-04-05 21:44:12 -06:00
blacktop 0104ea6a82 fix(swift-dump): prevent "file name too long" crash on C++ template type names
Sanitize Swift type/protocol names before using them as filenames,
  replacing characters illegal or problematic on APFS/HFS+ (.<> ,()/\:)
  with underscores and clamping to the 255-byte filesystem limit.

  When truncation is required, embed an 8-char FNV-1a hash of the original
  name in the filename so that two long names sharing the same sanitised
  prefix remain distinct and do not silently overwrite each other.

  Closes #1132
2026-04-05 20:45:05 -06:00
blacktop e3dee5a361 chore(info): remove unused embedded firmware key databases 2026-04-05 17:25:47 -06:00
blacktop e4a55a9e55 chore: replace inline regex with precompiled variables for improved performance and readability 2026-04-04 17:42:26 -06:00
blacktop f6ed288aec fix: enhance a2s memory mapping and string handling across platforms 2026-04-04 17:21:01 -06:00
codecoloristandGitHub fa2b1bf73b feat: optimize ipsw dyld a2s command speed (#1127) 2026-04-04 17:04:39 -06:00
blacktop edd24ded16 fix: sanitize diff Title->filename and update tests 2026-03-26 16:30:14 -06:00
blacktop 96a9edc310 Create format_test.go 2026-03-25 20:26:06 -06:00
blacktop 5e1c0ee6af feat: refactor diff formatting and remove unimplemented HTML method
- Move templates to package-level variables
- Clean up imports (add html, maps, slices, strings)
- Simplify String() method using shared template
- Remove unused HTML() panic stub
2026-03-25 20:24:39 -06:00
blacktop 6d317eca7b feat: support using ipsw class-dump --re flag and --headers flag 🇬🇧 2026-03-24 10:34:49 -06:00
blacktop d09ca85093 feat(diff): support diffing patched OTA DMG directories and update documentation 2026-03-17 19:13:23 -06:00
blacktop 1808adc7c8 fix(deps): skip missing DSC images instead of crashing (#1132) 2026-03-13 20:21:24 -06:00
blacktop ba2aa433ae chore: 2026 copyright 2026-03-10 17:08:45 -06:00
blacktop 1d405f061b fix: ipsw dl pcc command 2026-03-10 14:45:17 -06:00
blacktop 196d77de6f feat: add kernel C++ parsing to symbolicate cmds and APIs
Add API endpoints and CLI support for discovering C++ classes and symbolication of kernelcaches, refactor Mach-O handling, and improve symbol collection.

- API: add /kernel/cpp and /kernel/symbolicate routes, request param structs, response types, and openKernel helper. Use cpp scanner and signature parsing to return classes and symbol maps.
- CLI: wire scanner LogStats flag, refactor kernel symbolicate command (schema writer helper, improved signature parsing, and symbol matching logic). Add tests for symbolicator schema and kernel symbol matching.
- Signature pkg: add kernel C++ symbol extraction (pkg/signature/kernel_cpp.go) and SymbolicateMachO to symbolicate already-open Mach-Os; integrate C++ symbols into symbol map and update signature matching/logging behavior.
- Internal: refactor in-memory DB lookups (findMachOByUUID, findSymbolByAddr) to reduce duplication. Improve symbols collection for kernel Mach-Os (collectKernelMachoSymbols, extra kernel symbols from signature/C++), add helpers to append symbols.
- Kernelcache CPP: add LogStats option and conditional logging of scan stats.
- Crashlog/ips: update wording to reflect kernel symbols are from kernel analysis and store KernelSymbols earlier in processing; parse signatures only when configured.

Also add unit tests for new symbolication helpers and kernel C++ signature handling. Overall this consolidates kernel symbol discovery, improves reuse, and surfaces C++-derived symbols in symbol maps.
2026-03-10 12:20:12 -06:00
blacktop 23eb047fee chore: replace buffer with decoder in HasMTEInstructions function 2026-03-09 21:14:19 -06:00
PollyandGitHub 700a0a2244 fix(swift): check HasSwift instead of HasObjC in NewSwift (#1119) 2026-03-09 20:18:24 -06:00
blacktop 63445b0a2d chore: go fix 2026-03-06 23:24:25 -07:00
blacktop 866c2d38bf fix(search): preserve sentinel errors in DMG Mach-O scan path 2026-03-02 11:40:41 -07:00
blacktop f79da37c8a chore: go fix 2026-02-24 13:09:31 -07:00