cubinator / ext4

Reading Ext4 volumes
GNU General Public License v3.0
38 stars 17 forks source link

external xattr crash #14

Open superr opened 4 years ago

superr commented 4 years ago

Hello,

This module has been wonderful. Thank you for all your hard work on this :)

It seems there is an issue when an external xattr is encountered. This line: xattr_inode = self.volume.get_inode(xattr.e_value_inum)

produces: NameError: name 'xattr' is not defined"

I have been using this module for a long time, but I guess I never ran into the external xattr until now. I hope you are staying safe out there, and thanks again :)

mooseIre commented 4 years ago

I had the same problem when I extracted andorid 11 image,

                # external xattr
                xattr_inode = self.volume.get_inode(xattr.e_value_inum)

                if not self.volume.ignore_flags and (xattr_inode.inode.i_flags & ext4_inode.EXT4_EA_INODE_FL) != 0:
                    raise Ext4Error(f"Inode {xattr_inode.inode_idx:d} associated with the extended attribute {xattr_name!r:s} of inode {self.inode_idx:d} is not marked as large extended attribute value.")

                # TODO Use xattr_entry.e_value_size or xattr_inode.inode.i_size?
                xattr_value = xattr_inode.open_read().read()

It looks like it's not finished yet

this is image download url: miui_UMI_20.6.28_a5e0d69c19_11.0.zip

an external xattr is encountered on vendor.img