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:
@@ -4,6 +4,7 @@
|
||||
|
||||
import std.io;
|
||||
import std.sys;
|
||||
import type.magic;
|
||||
|
||||
struct MOD0 {
|
||||
char magic[4];
|
||||
@@ -27,7 +28,7 @@ struct SegmentHeader {
|
||||
};
|
||||
|
||||
struct Header {
|
||||
char magic[4];
|
||||
type::Magic<"NRO0"> magic;
|
||||
u32 version;
|
||||
u32 file_size;
|
||||
u32 flags;
|
||||
@@ -67,7 +68,6 @@ fn is_homebrew() {
|
||||
|
||||
Start start @ 0x00;
|
||||
Header header @ $;
|
||||
std::assert(header.magic == "NRO0", "Invalid NRO File!");
|
||||
|
||||
AssetHeader assets @ header.file_size;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user