{"id":51595168,"url":"https://github.com/securityronin/apm-partition-forensic","last_synced_at":"2026-07-11T18:01:39.390Z","repository":{"id":362792336,"uuid":"1259222403","full_name":"SecurityRonin/apm-partition-forensic","owner":"SecurityRonin","description":"Read-only Apple Partition Map (APM) reader + forensic anomaly auditor — overlaps, out-of-bounds, residual entries, hidden gaps as graded findings. Pure Rust, no unsafe.","archived":false,"fork":false,"pushed_at":"2026-06-21T08:54:48.000Z","size":162,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-21T09:21:15.024Z","etag":null,"topics":["apm","apple-partition-map","dfir","digital-forensics","disk-image","forensics","macintosh","partition","partition-table","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SecurityRonin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-04T09:52:34.000Z","updated_at":"2026-06-21T08:54:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/SecurityRonin/apm-partition-forensic","commit_stats":null,"previous_names":["securityronin/apm-forensic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SecurityRonin/apm-partition-forensic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SecurityRonin%2Fapm-partition-forensic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SecurityRonin%2Fapm-partition-forensic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SecurityRonin%2Fapm-partition-forensic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SecurityRonin%2Fapm-partition-forensic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SecurityRonin","download_url":"https://codeload.github.com/SecurityRonin/apm-partition-forensic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SecurityRonin%2Fapm-partition-forensic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35370428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apm","apple-partition-map","dfir","digital-forensics","disk-image","forensics","macintosh","partition","partition-table","rust"],"created_at":"2026-07-11T18:01:36.072Z","updated_at":"2026-07-11T18:01:39.359Z","avatar_url":"https://github.com/SecurityRonin.png","language":"Rust","funding_links":["https://github.com/sponsors/h4x0r"],"categories":[],"sub_categories":[],"readme":"# apm-partition-forensic\n\n[![Crates.io: core](https://img.shields.io/crates/v/apm-partition-core.svg?label=apm-partition-core)](https://crates.io/crates/apm-partition-core)\n[![Crates.io: forensic](https://img.shields.io/crates/v/apm-partition-forensic.svg?label=apm-partition-forensic)](https://crates.io/crates/apm-partition-forensic)\n[![docs.rs](https://img.shields.io/docsrs/apm-partition-forensic)](https://docs.rs/apm-partition-forensic)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![CI](https://github.com/SecurityRonin/apm-partition-forensic/actions/workflows/ci.yml/badge.svg)](https://github.com/SecurityRonin/apm-partition-forensic/actions)\n[![Sponsor](https://img.shields.io/badge/sponsor-h4x0r-ea4aaa?logo=github-sponsors)](https://github.com/sponsors/h4x0r)\n\n**Read an Apple Partition Map — then grade its structural anomalies into severity-ranked forensic findings.**\n\nA read-only APM reader (Driver Descriptor Map + partition entries: name, type, bounds) paired with an anomaly auditor that flags exactly what a forensic examiner looks for: map-count disagreement, overlapping or out-of-bounds partitions, residual (hidden) entries, and unmapped interior regions that could conceal data. Pure Rust, no `unsafe`.\n\n```rust\nuse apm_forensic::analyse;\n\nlet report = analyse(\u0026std::fs::read(\"disk.img\")?)?;\nfor a in \u0026report.anomalies {\n    println!(\"[{}] {}: {}\", a.severity, a.code, a.note);\n}\n# Ok::\u003c(), apm_forensic::Error\u003e(())\n```\n\n```text\nAPM Forensic Analysis\n  block size     : 512 bytes\n  device blocks  : 6144\n\nPartition map (2 entries):\n  [0] Apple                Apple_partition_map      blocks          1..=63\n  [1] disk image           Apple_HFS                blocks         64..=6143\n\nAnomalies: none\n\nHighest severity: none (clean)\n```\n\n`apm-partition-forensic` is a **library**. For a ready-made command line that\nauto-detects the scheme and prints this for *any* disk, install the unified\n[`disk4n6`](https://github.com/SecurityRonin/disk-forensic) tool\n(`cargo install disk-forensic`).\n\n## Two crates\n\n| Crate | Import as | Role |\n|---|---|---|\n| [`apm-partition-core`](https://crates.io/crates/apm-partition-core) | `apm` | Read-only reader: Driver Descriptor Map + partition entries (`parse`, `ApplePartitionMap`, `ApmPartition`) |\n| [`apm-partition-forensic`](https://crates.io/crates/apm-partition-forensic) | `apm_forensic` | Anomaly auditor: `analyse` / `analyse_reader` → graded `Anomaly` findings, built on the reader |\n\nThe forensic crate re-exports the reader's `parse`, `ApplePartitionMap`, `ApmPartition`, and `Error`, so depending on it alone gives you both layers.\n\n## Install\n\n```toml\n[dependencies]\napm-partition-forensic = \"0.4\"   # analyzer + re-exported reader\n# or, reader only:\napm-partition-core = \"0.4\"\n```\n\n## Quick start\n\n```rust\n// `data` begins at the device's first byte (block 0 = Driver Descriptor Map).\nlet data: Vec\u003cu8\u003e = std::fs::read(\"disk.img\")?;\n\nif let Some(map) = apm_forensic::parse(\u0026data) {\n    println!(\"{}-byte blocks, {} partitions\", map.block_size, map.partitions.len());\n    for p in \u0026map.partitions {\n        println!(\"  {:\u003c24} {}  start {} ({} blocks)\", p.type_name, p.name, p.start_block, p.block_count);\n    }\n    if let Some(hfs) = map.hfs_partition() {\n        println!(\"Apple_HFS at block {}\", hfs.start_block);\n    }\n}\n```\n\n## What it parses\n\n| Capability | Notes |\n|---|---|\n| Driver Descriptor Map | `ER` signature, device block size |\n| Partition entries | `PM` entries: name, type, start block, block count |\n| HFS lookup | `hfs_partition()` finds the first `Apple_HFS` slice |\n\n## Forensic anomaly detection\n\n`parse()` gives you the layout; `analyse()` (byte slice) and `analyse_reader()`\n(any `Read + Seek`, for composing with container crates) add a severity-ranked\nanomaly pass:\n\n```rust\nlet report = apm_forensic::analyse(\u0026std::fs::read(\"disk.img\")?)?;\nfor a in \u0026report.anomalies {\n    println!(\"[{}] {}: {}\", a.severity, a.code, a.note);\n}\n# Ok::\u003c(), apm_forensic::Error\u003e(())\n```\n\n| Anomaly | Code | Severity |\n|---|---|---|\n| Overlapping partitions | `APM-PART-OVERLAP` | Critical |\n| Partition out of bounds | `APM-PART-OOB` | High |\n| Residual (deleted) entry | `APM-PART-RESIDUAL` | High |\n| Missing `Apple_partition_map` self-entry | `APM-NO-MAP-ENTRY` | High |\n| `pmMapBlkCnt` disagreement | `APM-MAP-COUNT` | Medium |\n| Unmapped region (possible hidden data) | `APM-UNMAPPED` | Medium |\n| Zero-length partition | `APM-PART-ZEROLEN` | Low |\n| Unknown partition type | `APM-PART-UNKNOWN` | Info |\n\nPartition-type strings are graded against the\n[`forensicnomicon`](https://github.com/SecurityRonin/forensicnomicon) knowledge\nbase. Each anomaly is an *observation* (\"consistent with …\"), never a verdict —\nthe examiner draws the conclusion.\n\n## Trust, but verify\n\nThese crates parse untrusted, attacker-controllable disk images, so the bar is\n*never panic, never read out of bounds, never trust a length field*:\n\n- **Panic-free** — production code carries no `unwrap`/`expect`/`panic!`, enforced as a hard `deny` by the workspace lints; integers are read through bounds-checked helpers that return `0` rather than panicking on a short slice, and the entry count is capped (`MAX_PARTITIONS`) against a corrupt map.\n- **Fuzzed** — `cargo fuzz` targets drive the `parse` reader and the full `analyse` audit pipeline; the invariant is \"must not panic\" on any input.\n- **Independent-oracle tested (Tier 1)** — the reader is cross-checked against a real `hdiutil`-created APM by **two independent decoders**, The Sleuth Kit's `mmls -t mac` and Apple's `pdisk -dump`, which re-decode the same committed bytes; the test reconciles the crate's parse against their actual reported entry count, type, start block, and block count (and asserts the two oracles agree with each other). The anomaly *auditor* detectors are still exercised only by hand-built fixtures (Tier 3). The honest, per-capability validation state is documented at [`docs/validation.md`](https://securityronin.github.io/apm-partition-forensic/validation/).\n- **No `unsafe`** — `unsafe_code = \"forbid\"` across the workspace.\n\n## Related\n\nPart of the [Security Ronin](https://github.com/SecurityRonin) forensic toolkit. Sibling partition readers: [`gpt-forensic`](https://github.com/SecurityRonin/gpt-forensic), [`mbr-forensic`](https://github.com/SecurityRonin/mbr-forensic). The [`disk-forensic`](https://github.com/SecurityRonin/disk-forensic) orchestrator auto-detects the scheme and dispatches to whichever of the three fits. Filesystems: [`hfsplus-forensic`](https://github.com/SecurityRonin/hfsplus-forensic), [`udf-forensic`](https://github.com/SecurityRonin/udf-forensic). Consumed by [`iso9660-forensic`](https://github.com/SecurityRonin/iso9660-forensic) for Apple hybrid discs.\n\n---\n\n[Privacy Policy](https://securityronin.github.io/apm-partition-forensic/privacy/) · [Terms of Service](https://securityronin.github.io/apm-partition-forensic/terms/) · © 2026 Security Ronin Ltd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecurityronin%2Fapm-partition-forensic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecurityronin%2Fapm-partition-forensic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecurityronin%2Fapm-partition-forensic/lists"}