Files
ImHex-Patterns/patterns/ips.hexpat
gmestanley 0d8bd76c2c patterns: Improvements to NES & IPS, add SNES, NSF, NSFe (#455)
* Add credit to ne.hexpat

* Add many changes to nes.hexpat

* Fixing dependance on variables declared in if statement

* Added mappers and inline to NES 2.0 header, removed needless parenthesises

* Add files via upload

* Add files via upload

* Create nsf.hexpat

* Used full name of the SNES on description

* Add SNES, NSF & NSFe, new description for NES

* Removing erroneous condition in ips.hexpat's truncatedSize

* Removing unnecessary std.string import in ips.hexpat

* Added both locations for sections in PE, clearer variable names, reorganized DOS stub

* Delete patterns/nsfe.hexpat

* Delete patterns/nsfmetadata.hexpat

* Added chunks from NSFe to NSF

* Added NSFe

* Fix size of truncatedSize in ips.hexpat

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2025-12-05 21:15:50 +01:00

29 lines
589 B
Rust

#pragma author gmestanley
#pragma description IPS (International Patching System)
#pragma magic [ 50 41 54 43 48 ] @ 0x00
#pragma endian big
import std.string;
struct Hunk {
u24 offset;
u16 length;
if (!length) {
u16 runCount;
u8 payload;
}
else {
u8 payload[length];
}
};
struct IPS {
char signature[5];
Hunk hunks[while($ < std::mem::size() - (3 + 3 * (std::mem::read_string(std::mem::size()-3, 3) != "EOF")))];
char eof[3];
u24 truncatedSize[std::mem::read_string(std::mem::size()-3, 3) != "EOF"];
};
IPS ips @ 0x00;