Skip to content

Commit b04b1bd

Browse files
committed
Fixed: Handling of 0x00 blocks at start of file.
1 parent 920fe54 commit b04b1bd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from setuptools import setup, find_packages
44

5-
version = '0.7.2'
5+
version = '0.8.0'
66

77
setup(
88
name='ubi_reader',

ubireader/ubifs/output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ def _write_reg_file(path, data):
166166
def _process_reg_file(ubifs, inode, path):
167167
try:
168168
buf = bytearray()
169+
start_key = 0x00 | (UBIFS_DATA_KEY << UBIFS_S_KEY_BLOCK_BITS)
169170
if 'data' in inode:
170171
compr_type = 0
171172
sorted_data = sorted(inode['data'], key=lambda x: x.key['khash'])
172-
last_khash = sorted_data[0].key['khash']-1
173+
last_khash = start_key - 1
173174

174175
for data in sorted_data:
175-
176176
# If data nodes are missing in sequence, fill in blanks
177177
# with \x00 * UBIFS_BLOCK_SIZE
178178
if data.key['khash'] - last_khash != 1:

0 commit comments

Comments
 (0)