Skip to content

Commit

Permalink
Fixed: Handling of 0x00 blocks at start of file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrspruitt committed Apr 28, 2022
1 parent 920fe54 commit b04b1bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup, find_packages

version = '0.7.2'
version = '0.8.0'

setup(
name='ubi_reader',
Expand Down
4 changes: 2 additions & 2 deletions ubireader/ubifs/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ def _write_reg_file(path, data):
def _process_reg_file(ubifs, inode, path):
try:
buf = bytearray()
start_key = 0x00 | (UBIFS_DATA_KEY << UBIFS_S_KEY_BLOCK_BITS)
if 'data' in inode:
compr_type = 0
sorted_data = sorted(inode['data'], key=lambda x: x.key['khash'])
last_khash = sorted_data[0].key['khash']-1
last_khash = start_key - 1

for data in sorted_data:

# If data nodes are missing in sequence, fill in blanks
# with \x00 * UBIFS_BLOCK_SIZE
if data.key['khash'] - last_khash != 1:
Expand Down

0 comments on commit b04b1bd

Please sign in to comment.