mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-04-01 21:17:43 -05:00
patterns: Added Ogg pattern
This commit is contained in:
@@ -35,6 +35,7 @@ Hex patterns, include patterns and magic files for the use with the ImHex Hex Ed
|
|||||||
| File System | | `patterns/fs.hexpat` | Drive File System |
|
| File System | | `patterns/fs.hexpat` | Drive File System |
|
||||||
| Bencode | `application/x-bittorrent` | `patterns/bencode.hexpat` | Bencode encoding, used by Torrent files |
|
| Bencode | `application/x-bittorrent` | `patterns/bencode.hexpat` | Bencode encoding, used by Torrent files |
|
||||||
| Protobuf | | `patterns/protobuf.hexpat` | Google Protobuf encoding |
|
| Protobuf | | `patterns/protobuf.hexpat` | Google Protobuf encoding |
|
||||||
|
| Ogg | | `patterns/ogg.hexpat` | Ogg Audio format |
|
||||||
|
|
||||||
### Scripts
|
### Scripts
|
||||||
|
|
||||||
|
|||||||
29
patterns/ogg.hexpat
Normal file
29
patterns/ogg.hexpat
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#pragma MIME audio/ogg
|
||||||
|
|
||||||
|
#include <std/core.pat>
|
||||||
|
#include <std/mem.pat>
|
||||||
|
|
||||||
|
bitfield HeaderType {
|
||||||
|
Continuation : 1;
|
||||||
|
BeginOfStream : 1;
|
||||||
|
EndOfStream : 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SegmentData {
|
||||||
|
u8 data[parent.segmentTable[std::core::array_index()]];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Ogg {
|
||||||
|
char capturePattern[4];
|
||||||
|
u8 version;
|
||||||
|
HeaderType headerType;
|
||||||
|
u64 granulePosition;
|
||||||
|
u32 bitstreamSerialNumber;
|
||||||
|
u32 pageSequenceNumber;
|
||||||
|
u32 checksum;
|
||||||
|
u8 pageSegments;
|
||||||
|
u8 segmentTable[pageSegments];
|
||||||
|
SegmentData data[pageSegments];
|
||||||
|
};
|
||||||
|
|
||||||
|
Ogg ogg[while(!std::mem::eof())] @ 0x00;
|
||||||
Reference in New Issue
Block a user