首页
社区
课程
招聘
[求助][求助]nand flash的OOB
2021-5-10 09:46 12748

[求助][求助]nand flash的OOB

2021-5-10 09:46
12748

有没有大佬研究过nand flash的OOB,修改了flash的内容后想烧写回去,这个冗余区怎么处理,TH58BVG2S3HTA00 每2048个字节有64字节的OOB,这个区的定义哪里可以找到,如何修改呢

 

附件增加了样本,每512字节有13字节的纠错码,最大纠错8个bit,符合BCH特征,但是从网上拿到的算法计算结果不一致。
图片描述


[CTF入门培训]顶尖高校博士及硕士团队亲授《30小时教你玩转CTF》,视频+靶场+题目!助力进入CTF世界

最后于 2021-5-18 15:43 被茅山小僧编辑 ,原因:
上传的附件:
收藏
点赞0
打赏
分享
最新回复 (9)
雪    币: 991
活跃值: (1662)
能力值: ( LV5,RANK:75 )
在线值:
发帖
回帖
粉丝
茅山小僧 2021-5-10 09:54
2
0
256 byte pagesize
~~~~~~~~~~~~~~~~~

======== ================== ===================================================
Offset   Content            Comment
======== ================== ===================================================
0x00     ECC byte 0         Error correction code byte 0
0x01     ECC byte 1         Error correction code byte 1
0x02     ECC byte 2         Error correction code byte 2
0x03     Autoplace 0
0x04     Autoplace 1
0x05     Bad block marker   If any bit in this byte is zero, then this
                           block is bad. This applies only to the first
                           page in a block. In the remaining pages this
                           byte is reserved
0x06     Autoplace 2
0x07     Autoplace 3
======== ================== ===================================================

512 byte pagesize
~~~~~~~~~~~~~~~~~


============= ================== ==============================================
Offset        Content            Comment
============= ================== ==============================================
0x00          ECC byte 0         Error correction code byte 0 of the lower
                                256 Byte data in this page
0x01          ECC byte 1         Error correction code byte 1 of the lower
                                256 Bytes of data in this page
0x02          ECC byte 2         Error correction code byte 2 of the lower
                                256 Bytes of data in this page
0x03          ECC byte 3         Error correction code byte 0 of the upper
                                256 Bytes of data in this page
0x04          reserved           reserved
0x05          Bad block marker   If any bit in this byte is zero, then this
                                block is bad. This applies only to the first
                                page in a block. In the remaining pages this
                                byte is reserved
0x06          ECC byte 4         Error correction code byte 1 of the upper
                                256 Bytes of data in this page
0x07          ECC byte 5         Error correction code byte 2 of the upper
                                256 Bytes of data in this page
0x08 - 0x0F   Autoplace 0 - 7
============= ================== ==============================================

2048 byte pagesize
~~~~~~~~~~~~~~~~~~

=========== ================== ================================================
Offset      Content            Comment
=========== ================== ================================================
0x00        Bad block marker   If any bit in this byte is zero, then this block
                              is bad. This applies only to the first page in a
                              block. In the remaining pages this byte is
                              reserved
0x01        Reserved           Reserved
0x02-0x27   Autoplace 0 - 37
0x28        ECC byte 0         Error correction code byte 0 of the first
                              256 Byte data in this page
0x29        ECC byte 1         Error correction code byte 1 of the first
                              256 Bytes of data in this page
0x2A        ECC byte 2         Error correction code byte 2 of the first
                              256 Bytes data in this page
0x2B        ECC byte 3         Error correction code byte 0 of the second
                              256 Bytes of data in this page
0x2C        ECC byte 4         Error correction code byte 1 of the second
                              256 Bytes of data in this page
0x2D        ECC byte 5         Error correction code byte 2 of the second
                              256 Bytes of data in this page
0x2E        ECC byte 6         Error correction code byte 0 of the third
                              256 Bytes of data in this page
0x2F        ECC byte 7         Error correction code byte 1 of the third
                              256 Bytes of data in this page
0x30        ECC byte 8         Error correction code byte 2 of the third
                              256 Bytes of data in this page
0x31        ECC byte 9         Error correction code byte 0 of the fourth
                              256 Bytes of data in this page
0x32        ECC byte 10        Error correction code byte 1 of the fourth
                              256 Bytes of data in this page
0x33        ECC byte 11        Error correction code byte 2 of the fourth
                              256 Bytes of data in this page
0x34        ECC byte 12        Error correction code byte 0 of the fifth
                              256 Bytes of data in this page
0x35        ECC byte 13        Error correction code byte 1 of the fifth
                              256 Bytes of data in this page
0x36        ECC byte 14        Error correction code byte 2 of the fifth
                              256 Bytes of data in this page
0x37        ECC byte 15        Error correction code byte 0 of the sixth
                              256 Bytes of data in this page
0x38        ECC byte 16        Error correction code byte 1 of the sixth
                              256 Bytes of data in this page
0x39        ECC byte 17        Error correction code byte 2 of the sixth
                              256 Bytes of data in this page
0x3A        ECC byte 18        Error correction code byte 0 of the seventh
                              256 Bytes of data in this page
0x3B        ECC byte 19        Error correction code byte 1 of the seventh
                              256 Bytes of data in this page
0x3C        ECC byte 20        Error correction code byte 2 of the seventh
                              256 Bytes of data in this page
0x3D        ECC byte 21        Error correction code byte 0 of the eighth
                              256 Bytes of data in this page
0x3E        ECC byte 22        Error correction code byte 1 of the eighth
                              256 Bytes of data in this page
0x3F        ECC byte 23        Error correction code byte 2 of the eighth
                              256 Bytes of data in this page
=========== ================== ================================================
雪    币: 5733
活跃值: (3530)
能力值: ( LV10,RANK:163 )
在线值:
发帖
回帖
粉丝
yimingqpa 1 2021-5-10 11:55
3
0
这个区域不好弄!!!
汉明码、RS、LDPC、BCH、ECC中的某一种,实际用到的算法有可能变种。
雪    币: 1772
活跃值: (2703)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
拍拖 2 2021-5-12 15:49
4
0
我的机顶盒就是因为OOB校验算不对,导致修改后起不来了,我又没备份固件。
最后扔了半年多后重新捡起来发现居然华为机顶盒有第二个备份的系统分区(估计用于更新固件用),调整uboot命令设置到第二个系统分区后解决。
雪    币: 7072
活跃值: (3462)
能力值: ( LV12,RANK:340 )
在线值:
发帖
回帖
粉丝
bxc 6 2021-5-12 16:31
5
0
我一般读取都是without oob区域的,写入时也是不带oob区域,一直都正常。
雪    币: 991
活跃值: (1662)
能力值: ( LV5,RANK:75 )
在线值:
发帖
回帖
粉丝
茅山小僧 2021-5-18 14:44
6
0

    11

最后于 2021-5-18 14:45 被茅山小僧编辑 ,原因:
雪    币: 991
活跃值: (1662)
能力值: ( LV5,RANK:75 )
在线值:
发帖
回帖
粉丝
茅山小僧 2021-5-18 14:45
7
0
yimingqpa 这个区域不好弄!!! 汉明码、RS、LDPC、BCH、ECC中的某一种,实际用到的算法有可能变种。
大佬也研究过这个固件吗,能否交流一下,搞了几天,没啥进展
雪    币: 1408
活跃值: (977)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
Frida_re 2022-2-10 15:37
8
0

1

最后于 2023-2-11 09:35 被Frida_re编辑 ,原因: ....
雪    币: 9254
活跃值: (3181)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
Lightal 2 2022-2-10 16:29
9
0
看看snander吧  https://github.com/McMCCRU/SNANDer
准备一个不带OOB数据的固件,然后snander -w写入就可以了,他写入的时候会自己计算OOB区域,不过这个工具支持的芯片还不多
雪    币: 614
活跃值: (1097)
能力值: ( LV2,RANK:15 )
在线值:
发帖
回帖
粉丝
qqwawzymu 2022-2-14 17:37
10
0
bxc 我一般读取都是without oob区域的,写入时也是不带oob区域,一直都正常。
vbgood
游客
登录 | 注册 方可回帖
返回