ads

mercredi 30 septembre 2015

[Q] how to directly edit a ubifs system image



Hi,

I have searched the forums and still haven't found any useful information.

I've been trying to edit a ubifs image (system.img) for a generic mediatek tablet.

These are the many things I have tried:

1) Edit the boot.img so that ro.secure=0 etc to see if I can get root. Unfortunately selinux is enabled and I don't even have busybox on the system (something called toolbox)

2) Work out what nand flash is being used (in my case its - SanDisk SDTNRGAMA 64G 3.3V 8-bit). And emulate the nand by using nandsim on a linux computer, but it causes a segmentation fault:


Code:


sudo modprobe nanDsim id_bytes=0x45,0xde,0x94,0x93,0x76,0x50 cache_file=./test.img

Note - I have included a spelling mistake (nanDsim should be nandsim) because I dont' want anyone to just cut and paste this command - it causes a segmentation fault on Ubuntu and Debian and I have found that if you are running on an ssd system it will hard lock your pc! (You have been warned).

3) Use ubireader (github.com/jrspruitt/ubi_reader).


Code:


$ ubireader_display_info ./system.img
UBI File
---------------------
    Min I/O: 16384
    LEB Size: 4161536
    PEB Size: 4194304
    Total Block Count: 122
    Data Block Count: 120
    Layout Block Count: 2
    Internal Volume Block Count: 0
    Unknown Block Count: 0
    First UBI PEB Number: 0

    Image: 1101756791
    ---------------------
        Image Sequence Num: 1101756791
        Volume Name:system
        PEB Range: 0 - 121

        Volume: system
        ---------------------
            Vol ID: 0
            Name: system
            Block Count: 120

            Volume Record
            ---------------------
                alignment: 1
                crc: 3336263623
                data_pad: 0
                errors:
                flags: autoresize
                name: system
                name_len: 6
                padding:
                rec_index: 0
                reserved_pebs: 248
                upd_marker: 0
                vol_type: dynamic


but when I run 'ubireader_extract_files' I get all the files, but they are all corrupted.

I'm currently trying to use the information in the ubireader_display_info to create a blank ubifs image and using 'linux dd' to try and read the image that I have.

Has anyone got any tips on how to progress, your help and advice would be appreciated.



Aucun commentaire:

Enregistrer un commentaire