onekey-sec / ubi_reader

Collection of Python scripts for reading information about and extracting data from UBI and UBIFS images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to extract file

pixelbuildlab opened this issue · comments

When Tried to extract ubi file on Ubuntu 14 it shows this error.
extract_files Error: 'module' object has no attribute 'commonpath'
but the same ubi file or later version is working.
and more the file size is increased some how after repacking on later version, if I use same compression on one file and the other

Hi pixelbuildlab,

commonpath is only available in Python 3.5 and newer. This was part of a security fix for ubi_reader to prevent path traversal during file extraction. I believe this is the commit you'll need to check out for Python < 3.5 b04b1bd

As for the differences in rebuilding a UBI image, I really don't know why that would happen.

-Jason

Thank you I extracted ubi with that commit

Just an FYI the latest commit fixes Python 2, both the commonpath issue, and possibly another if you've been trying to extract a NAND dump.

-Jason