NdmsTool is an offline utility for extracting and rebuilding Nand Data
Management System (NDMS) backup for ST-Ericsson EMP Platform FTL . It supports
raw NAND data with a separate OOB dump, SD card NANDxx.DAT sets,
concatenated S-AND.bin DAT streams, and S-AND backups in NOR-OOB mode.
- Extract committed logical objects from raw NAND data and OOB files.
- Extract SD card
NANDxx.DATdirectories and concatenated DAT streams. - Extract S-AND backups in NOR-OOB mode using a separate object map.
- Select which version to keep when a DAT logical object occurs more than once.
- Recover uncommitted raw-NAND objects for inspection.
- Write logical object ranges, unparsed data, and detected MBR partition images.
- Pack a partition image into a new SD DAT set.
- Patch an existing SD DAT set or concatenated DAT stream while preserving its original layout.
- Patch existing S-AND objects in NOR-OOB mode using the original mapping.
- Python 3.10 or newer
Display the available commands:
python3 NdmsTool.py --help
python3 NdmsTool.py unpack --help
python3 NdmsTool.py pack --helpExtract a raw NAND data file and its matching OOB file:
python3 NdmsTool.py unpack raw NAND.bin NAND.oob extractedWrite every logical object to a separate file:
python3 NdmsTool.py unpack raw NAND.bin NAND.oob extracted --splitInclude uncommitted objects for recovery analysis:
python3 NdmsTool.py unpack raw NAND.bin NAND.oob recovered --undeleteUse --ignore to continue when a committed logical object ID occurs more than
once.
Extract a directory containing contiguous NAND00.DAT, nand01.dat, and later
files:
python3 NdmsTool.py unpack sdstream NAND_DAT extractedExtract a concatenated S-AND.bin DAT stream:
python3 NdmsTool.py unpack udbstream S-AND.bin extractedThe default --dat-version prefer-ffff selects the version whose first page
has the committed 0000FFFF state. Other policies are first, last, and
prefer-zero:
python3 NdmsTool.py unpack udbstream S-AND.bin extracted \
--dat-version lastUse --ignore to retain complete objects while ignoring truncated object
versions. Use --split to write every logical object separately.
NOR-OOB mode reads object metadata from a separate NOR-OOB file (NOR.bin)
instead of DAT metadata appended to each S-AND page. Supply both files:
python3 NdmsTool.py unpack udbstream S-AND.bin extracted --noroob NOR.binThe extraction directory can contain:
NNNN_NNNN.bin: one object or a contiguous logical-object range.leftover.bin: data that was not assigned to a valid logical object.leftover_map.json: source offsets and reasons for leftover data in raw NAND and NOR-OOB modes.noroob_object_map.json: object IDs and source offsets in NOR-OOB mode.partition_NNNNN_type_XX.img: an MBR-declared partition reconstructed from logical objects.
Sparse gaps inside a reconstructed range or partition image are filled with zero bytes.
The input image size must be a multiple of the logical object size. The default
object size is 0x1000 bytes. --first-id specifies the logical object ID that
corresponds to offset zero of the image and accepts decimal or 0x-prefixed
values.
Create a new NANDxx.DAT directory from a partition image:
python3 NdmsTool.py pack sdstream partition.img rebuilt_dat \
--first-id 0x1200Specify a different logical object size when required:
python3 NdmsTool.py pack sdstream partition.img rebuilt_dat \
--first-id 0x1200 --object-size 0x2000Use an original DAT directory as the layout template and write the result to a different directory:
python3 NdmsTool.py pack sdstream partition.img patched_dat \
--first-id 0x1200 --template original_datExisting matching objects are replaced. Missing nonzero objects are inserted only when the template has enough contiguous erased DAT records. Missing all-zero objects are left sparse.
Packing udbstream always requires an original concatenated stream as a
template:
python3 NdmsTool.py pack udbstream partition.img patched-S-AND.bin \
--first-id 0x1200 --template original-S-AND.binThe output path must differ from the template path. NdmsTool verifies the patched or synthesized output after writing it.
Use the original S-AND and matching NOR-OOB file as the template pair:
python3 NdmsTool.py pack udbstream partition.img patched-S-AND.bin \
--first-id 0x1200 --template original-S-AND.bin --noroob original-NOR.binThe output is a full S-AND copy with changed objects replaced at their existing
physical offsets. Reuse the original NOR-OOB file with the output: its records
and object locations remain unchanged. This does not create a new NOR-OOB file.
The image must contain whole logical objects, normally 0x1000 bytes each.
Missing all-zero objects remain sparse. A missing nonzero object or a change in object size is rejected before the output is written. Adding files or growing existing files can require new objects and is therefore not always supported. Allocating objects, relocating data, and updating NOR-OOB table generation or garbage-collection fields are not implemented.
Verification checks every replacement and every unchanged byte against the template. Offline packing and round-trip checks do not establish device restore compatibility or validate application-level checksums.