mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-28 07:47:02 -05:00
patterns: Added pattern file for Apple PBZX compressed streams (#63)
This is used by Apple for Xcode .xip files (cpio in pbzx in xar), OTA updates of iOS, and other files.
This commit is contained in:
30
patterns/pbzx.hexpat
Normal file
30
patterns/pbzx.hexpat
Normal file
@@ -0,0 +1,30 @@
|
||||
// pbzx compression stream
|
||||
// Used by Apple on .xip files and OTA updates.
|
||||
//
|
||||
// Copyright (c) 2022 Nicolás Alvarez <nicolas.alvarez@gmail.com>
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <std/mem.pat>
|
||||
|
||||
#pragma endian big
|
||||
|
||||
#define SHOW_DATA 0
|
||||
|
||||
struct Chunk {
|
||||
u64 uncompressed_size;
|
||||
u64 compressed_size;
|
||||
if (SHOW_DATA) {
|
||||
u8 data[compressed_size] [[sealed]];
|
||||
} else {
|
||||
padding[compressed_size];
|
||||
}
|
||||
};
|
||||
|
||||
struct PBZX {
|
||||
char magic[4];
|
||||
u64 chunk_size;
|
||||
Chunk chunks[while(!std::mem::eof())];
|
||||
};
|
||||
|
||||
PBZX pbzx @ 0;
|
||||
Reference in New Issue
Block a user