抽出されたUbi画像からコンテンツを取得する

抽出されたUbi画像からコンテンツを取得する

しばらく前にNANDフラッシュをダンプし、binwalk.Binwalkを使用してSQUASHFSファイルシステムを見つけることができましたが、残念ながらUBIの上にインストールされ、unsquashfsユーティリティやsasquatch特定のタスクを実行する機能が利用できなかったため、データを取得できませんでした。 。

しかし、binwalkUBIミラーも見つけることができます。だから私の次のアプローチは、そのイメージからコンテンツを抽出し、最終的にsquashfsファイルシステムを作成することでした。

そのためにツールを使いたいですubireader(https://github.com/jrspruitt/ubi_reader)。

ubireader_display_info私に次のような結果を与えた:

UBI File
---------------------
Min I/O: 2048
LEB Size: 126976
PEB Size: 131072
Total Block Count: 847
Data Block Count: 377
Layout Block Count: 2
Internal Volume Block Count: 0
Unknown Block Count: 468
First UBI PEB Number: 10

Image: 1681423409
---------------------
    Image Sequence Num: 1681423409
    Volume Name:spare
    Volume Name:data1
    Volume Name:root1
    Volume Name:root0
    Volume Name:data0
    PEB Range: 0 - 855

    Volume: spare
    ---------------------
        Vol ID: 4
        Name: spare
        Block Count: 142

        Volume Record
        ---------------------
            alignment: 1
            crc: '0x743003a9'
            data_pad: 0
            errors: ''
            flags: 0
            name: u'spare'
            name_len: 5
            padding: u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
            rec_index: 4
            reserved_pebs: 386
            upd_marker: 0
            vol_type: 'dynamic'


    Volume: data1
    ---------------------
        Vol ID: 3
        Name: data1
        Block Count: 8

        Volume Record
        ---------------------
            alignment: 1
            crc: '0xefc3e0d'
            data_pad: 0
            errors: ''
            flags: 0
            name: u'data1'
            name_len: 5
            padding: u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
            rec_index: 3
            reserved_pebs: 34
            upd_marker: 0
            vol_type: 'dynamic'


    Volume: root1
    ---------------------
        Vol ID: 1
        Name: root1
        Block Count: 110

        Volume Record
        ---------------------
            alignment: 1
            crc: '0x4a7089bd'
            data_pad: 0
            errors: ''
            flags: 0
            name: u'root1'
            name_len: 5
            padding: u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
            rec_index: 1
            reserved_pebs: 232
            upd_marker: 0
            vol_type: 'dynamic'


    Volume: root0
    ---------------------
        Vol ID: 0
        Name: root0
        Block Count: 108

        Volume Record
        ---------------------
            alignment: 1
            crc: '0x38a2ed27'
            data_pad: 0
            errors: ''
            flags: 0
            name: u'root0'
            name_len: 5
            padding: u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
            rec_index: 0
            reserved_pebs: 232
            upd_marker: 0
            vol_type: 'dynamic'


    Volume: data0
    ---------------------
        Vol ID: 2
        Name: data0
        Block Count: 9

        Volume Record
        ---------------------
            alignment: 1
            crc: '0x7c2e5a97'
            data_pad: 0
            errors: ''
            flags: 0
            name: u'data0'
            name_len: 5
            padding: u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
            rec_index: 2
            reserved_pebs: 34
            upd_marker: 0
            vol_type: 'dynamic'

不明なチャンクがいくつかあります。これが問題かどうかはわかりませんが、次のコマンドを使用してファイルを抽出しようとすると、ubireader_extract_files次のエラーが発生します。

Extracting files to: ubifs-root/1681423409/spare
extract_files Error: No inodes found
Extracting files to: ubifs-root/1681423409/data1
read Error: LEB: 10 is corrupted or has no data.
extract_files Error: 1
UBIFS Fatal: Super block error: Wrong node type.

わかりませんが、UBIイメージ(または完全ダンプ)が何らかの方法で破損している可能性があると思います。

私が使用しているNANDフラッシュには内部ECCが有効になっており、データシートに次のように表示されているため、これは説明できません。

During a READ operation, the page data is read from the array to the cache 
register, where the ECC code is calculated and compared with the ECC code 
value read from the array. If error bits are detected, the error is corrected 
in the cache register. Only corrected data is output on the I/O bus.

このようなデータを取得するために私ができることはありますか?それとも私が何か間違っているのでしょうか?

ベストアンサー1

おすすめ記事