conchyliculture / Yand

Yet Another Nand Dumper
MIT License
21 stars 4 forks source link

Extract images from RAW NAND #11

Closed iDoka closed 3 years ago

iDoka commented 3 years ago

I dumped NAND image with command:

yand_cli.py --page_size 2048,128 --pages_per_block 64 --number_of_blocks 2048 --read --file TC58NVG1S3HTA00.bin

Now I would to use binwalk to extract filesystems and others deliverables. How I can extract straight image from RAW NAND image? (I mean cut ECC part).

conchyliculture commented 3 years ago

This is for you to figure out =) since a NAND just stores blocks, any structure on top of that is up to whatever chip it's connected to to decide. It might be that the last 128 bytes (OOB) of each page is used for ECC, and you just have to trim these for every page. Maybe not

You can try to use the visialisation tool at https://github.com/conchyliculture/Yand/blob/master/TOOLS.md to figure out the structure.

Can you confirm #10 ca be closed?

iDoka commented 3 years ago

It is indeed hard to guess NAND inner structure. What I know at this point:

1) from RK3308 TRM:

2) from binwalk I see that header is not aligned on page size:

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
126096        0x1EC90         CRC32 polynomial table, little endian
404624        0x62C90         CRC32 polynomial table, little endian
683152        0xA6C90         CRC32 polynomial table, little endian
961680        0xEAC90         CRC32 polynomial table, little endian
1240208       0x12EC90        CRC32 polynomial table, little endian
1518736       0x172C90        CRC32 polynomial table, little endian
2400016       0x249F10        CRC32 polynomial table, little endian
2434832       0x252710        CRC32 polynomial table, little endian
2469648       0x25AF10        CRC32 polynomial table, little endian
2504464       0x263710        CRC32 polynomial table, little endian
2785312       0x2A8020        Linux EXT filesystem, blocks count: 83228, image size: 85225472, rev 0.0, ext2 filesystem data (mounted or unclean), UUID=f1cab0c0-5b73-44c0-851d-08fda1c3a1c3, volume name "userdata"
88016546      0x53F06A2       Linux EXT filesystem, blocks count: 83228, image size: 85225472, rev 0.0, ext2 filesystem data (mounted or unclean), UUID=f1cab0c0-5b73-44c0-851d-08fda1c3a1c3, volume name "userdata"
186046478     0xB16D80E       Zlib compressed data, best compression
193122647     0xB82D157       Zlib compressed data, best compression
195010338     0xB9F9F22       Linux EXT filesystem, blocks count: 83228, image size: 85225472, rev 0.0, ext2 filesystem data (mounted or unclean), UUID=f1cab0c0-5b73-44c0-851d-08fda1c3a1c3, volume name "userdata"
iDoka commented 3 years ago

I think this issue not directly related to Yand and might be closed.

conchyliculture commented 3 years ago

Good luck with your research =)