Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/pbpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def dump(self):
for i, entry in enumerate(self.table_entries, start=1):
print(' %u: Offset %u Length %u CRC 0x%x' % (i, entry.offset, entry.length, entry.crc))

def __init__(self, is_system):
def __init__(self, is_system=True):
self.table_size = 512 if is_system else 256
self.content_start = self.MANIFEST_SIZE_BYTES + self.table_size * self.TABLE_ENTRY_SIZE_BYTES

Expand Down
6 changes: 5 additions & 1 deletion tools/unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@
def main():
parser = argparse.ArgumentParser(description=
'Unpack pbpacked data to recover original file content.')

parser.add_argument('pbpack', type=str, help='app_resources.pbpack file to unpack')
parser.add_argument('--app', default=False, action='store_true',
help='Indicate this pbpack is an app pbpack')

args = parser.parse_args()

if os.path.exists(args.pbpack):
resource_pack = ResourcePack().deserialize(open(args.pbpack,'rb'))
resource_pack = ResourcePack().deserialize(open(args.pbpack,'rb'), is_system=not args.app)
for idx, resource_data in enumerate(resource_pack.contents):
with open(str(idx) + '.dat','wb') as outfile:
outfile.write(resource_data)
Expand Down