{"id":22433638,"url":"https://github.com/nlitsme/ubidump","last_synced_at":"2025-04-04T16:11:23.311Z","repository":{"id":24353382,"uuid":"87404254","full_name":"nlitsme/ubidump","owner":"nlitsme","description":"Tool for viewing and extracting files from an UBIFS image","archived":false,"fork":false,"pushed_at":"2024-08-05T22:38:00.000Z","size":116,"stargazers_count":252,"open_issues_count":13,"forks_count":65,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-28T15:03:56.028Z","etag":null,"topics":["file-format","filesystem","firmware-tools","reverse-engineering"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nlitsme.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}},"created_at":"2017-04-06T08:17:07.000Z","updated_at":"2025-03-23T01:55:13.000Z","dependencies_parsed_at":"2024-08-06T01:17:49.380Z","dependency_job_id":null,"html_url":"https://github.com/nlitsme/ubidump","commit_stats":{"total_commits":32,"total_committers":6,"mean_commits":5.333333333333333,"dds":0.15625,"last_synced_commit":"d5c4d3f07f7765714999e25c4a45c67d1f59b1b3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlitsme%2Fubidump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlitsme%2Fubidump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlitsme%2Fubidump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlitsme%2Fubidump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nlitsme","download_url":"https://codeload.github.com/nlitsme/ubidump/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208142,"owners_count":20901570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["file-format","filesystem","firmware-tools","reverse-engineering"],"created_at":"2024-12-05T22:15:30.827Z","updated_at":"2025-04-04T16:11:23.275Z","avatar_url":"https://github.com/nlitsme.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"UBIFS Dumper\n============\n\nThis tool can be used to view or extract the contents of UBIFS images.\n\nAbout UBIFS\n===========\n\nUBIFS is a filesystem specifically designed for used on NAND flash chips.\nNAND flash is organized in _eraseblocks_. _Eraseblocks_ can be erased,\nappended to, and read. Erasing is a relatively expensive operation, and can\nbe done only a limited number of times.\n\nAn UBIFS image contains four abstraction layers:\n * eraseblocks\n * volumes\n * b-tree nodes\n * inodes\n\nEach eraseblock contains info on how often it has been erased, and which volume it belongs to.\nA volume contains a b-tree database with keys for:\n * inodes, indexed by inode number\n * direntries, indexed by inode number + name hash\n * datablocks, indexed by inode number + block number\n\nThe inodes are basically a standard unix filesystem, with direntries, regular files, symlinks, devices, etc.\n\nmounting images on linux\n------------------------\n\n    modprobe nandsim first_id_byte=0x2c second_id_byte=0xac third_id_byte=0x90 fourth_id_byte=0x26\n    nandwrite /dev/mtd0   firmware-image.ubi \n    modprobe ubi mtd=/dev/mtd0,4096\n    mount -t ubifs  -o ro /dev/ubi0_0 mnt\n\nThis will mount a ubi image for a device with eraseblock size 0x40000.\nIf your image has a blocksize of 0x20000, use `fourth_id_byte=0x15`, and specify a pagesize of `2048`\nwith the second modprobe line.\n\nUsage\n=====\n\nView the contents of the `/etc/passwd` file in the filesystem image `image.ubi`:\n\n    python ubidump.py  -c /etc/passwd  image.ubi\n\nList the files in all the volumes in `image.ubi`:\n\n    python ubidump.py  -l  image.ubi\n\nView the contents of b-tree database from the volumes in `image.ubi`:\n\n    python ubidump.py  -d  image.ubi\n\nExtract an unsupported volume type, so you can analyze it with other tools:\n\n    python ubidump.py  -v 0 --saveraw unknownvol.bin  image.ubi\n\nNote that often ubi images contain squashfs volumes, which can be extracted using tools like\n[unsquashfs](https://github.com/plougher/squashfs-tools) or [rdsquashfs](https://github.com/AgentD/squashfs-tools-ng)\n\nInstall\n=======\n\nInstall the required python modules using:\n\n    pip install -r requirements.txt\n\nor as a pip package:\n\n    pip install ubidump\n\nYou may need to manually install your operarating system libraries for lzo first:\n\non linux:\n\n    apt install liblzo2-dev\n\non MacOS:\n\n    brew install lzo\n\nmaybe you need to build the python library like this:\n\n    LDFLAGS=-L/usr/local/lib CFLAGS=-I/usr/local/include/lzo pip3 install python-lzo\n\n\nWhen you need zstd compression, you will need to install the `zstandard` module.\n\n\nDependencies\n============\n\n * python2 or python3\n * python-lzo  ( \u003e= 1.09, which introduces the 'header=False' argument )\n * crcmod\n * optional: zstandard\n\nTODO\n====\n\n * add option to select a volume\n * add option to select a older `master` node\n * parse the journal\n * analyze b-tree structure for unused nodes\n * analyze fs structure for unused inodes, dirents\n * verify that data block size equals the size mentioned in the inode.\n * add support for ubifs ( without the ubi layer )\n * add option to extract a raw volume.\n\nReferences\n==========\n\n * the ubifs/mtd tools http://linux-mtd.infradead.org/\n * git repos can be found [here](http://git.infradead.org/)\n\nSimilar tools\n=============\n\n * another python tool  [on github](https://github.com/jrspruitt/ubi_reader/)\n     * does not support listing files.\n * a closed source windows tool [here](http://ubidump.oozoon.de/)\n * ubi-utils/ubidump.c [on the mtd mailinglist](http://lists.infradead.org/pipermail/linux-mtd/2014-July/054547.html)\n\nAuthor\n======\n\nWillem Hengeveld \u003citsme@xs4all.nl\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlitsme%2Fubidump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnlitsme%2Fubidump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlitsme%2Fubidump/lists"}