mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
patterns/includes: More misc cleanups (#353)
* patterns/zip: simplify find_sequence_in_range check
hex(340282366920938463463374607431768211455) =
0xffffffffffffffffffffffffffffffff
* patterns/7z: use Magic<> for signature, add pragma
* patterns/{nro, ogg}: use Magic<> for signature
* patterns/ttf: refactor, check magic
Use the "Field field @ position;" syntax instead of saving and restoring
the cursor position.
* readme: fix copy-paste error in pattern listing
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import std.core;
|
||||
import std.mem;
|
||||
import type.magic;
|
||||
|
||||
bitfield HeaderType {
|
||||
Continuation : 1;
|
||||
@@ -17,7 +18,7 @@ struct SegmentData {
|
||||
};
|
||||
|
||||
struct Ogg {
|
||||
char capturePattern[4];
|
||||
type::Magic<"OggS"> capturePattern;
|
||||
u8 version;
|
||||
HeaderType headerType;
|
||||
u64 granulePosition;
|
||||
@@ -29,4 +30,4 @@ struct Ogg {
|
||||
SegmentData data[pageSegments];
|
||||
};
|
||||
|
||||
Ogg ogg[while(!std::mem::eof())] @ 0x00;
|
||||
Ogg ogg[while(!std::mem::eof())] @ 0x00;
|
||||
|
||||
Reference in New Issue
Block a user