diff --git a/NeoBoot/ubi_reader/ubi_reader_arm/ubifs/output.py b/NeoBoot/ubi_reader/ubi_reader_arm/ubifs/output.py deleted file mode 100644 index dd3f4f4..0000000 --- a/NeoBoot/ubi_reader/ubi_reader_arm/ubifs/output.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/python -import os -import struct -from ubifs.defines import * -from ubifs.misc import decompress - -def dents(ubifs, inodes, dent_node, path = '', perms = False): - inode = inodes[dent_node.inum] - dent_path = os.path.join(path, dent_node.name) - if dent_node.type == UBIFS_ITYPE_DIR: - try: - if not os.path.exists(dent_path): - os.mkdir(dent_path) - if perms: - set_file_perms(dent_path, inode) - except Exception as e: - ubifs.log.write('DIR Fail: %s' % e) - - if 'dent' in inode: - for dnode in inode['dent']: - dents(ubifs, inodes, dnode, dent_path, perms) - - elif dent_node.type == UBIFS_ITYPE_REG: - try: - if inode['ino'].nlink > 1: - if 'hlink' not in inode: - inode['hlink'] = dent_path - buf = process_reg_file(ubifs, inode, dent_path) - write_reg_file(dent_path, buf) - else: - os.link(inode['hlink'], dent_path) - else: - buf = process_reg_file(ubifs, inode, dent_path) - write_reg_file(dent_path, buf) - if perms: - set_file_perms(dent_path, inode) - except Exception as e: - ubifs.log.write('FILE Fail: %s' % e) - - elif dent_node.type == UBIFS_ITYPE_LNK: - try: - os.symlink('%s' % inode['ino'].data, dent_path) - except Exception as e: - ubifs.log.write('SYMLINK Fail: %s : %s' % (inode['ino'].data, dent_path)) - - elif dent_node.type in [UBIFS_ITYPE_BLK, UBIFS_ITYPE_CHR]: - try: - dev = struct.unpack(' len(buf): - buf += '\x00' * (inode['ino'].size - len(buf)) - return buf \ No newline at end of file