diff --git a/README.md b/README.md index aa4ce90..5feb680 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | NBT | | [`patterns/nbt.hexpat`](patterns/nbt.hexpat) | Minecraft NBT format | | NE | | [`patterns/ne.hexpat`](patterns/ne.hexpat) | NE header and Standard NE fields | | nes | | [`patterns/nes.hexpat`](patterns/nes.hexpat) | .nes file format | +| NotepadWindowState | | [`patterns/notepad-windowstate.hexpat`](patterns/notepad-windowstate.hexpat) | Windows 11 Notepad - Window State .bin file | | NRO | | [`patterns/nro.hexpat`](patterns/nro.hexpat) | Nintendo Switch NRO files | | NTAG | | [`patterns/ntag.hexpat`](patterns/ntag.hexpat) | NTAG213/NTAG215/NTAG216, NFC Forum Type 2 Tag compliant IC | | OGG | `audio/ogg` | [`patterns/ogg.hexpat`](patterns/ogg.hexpat) | OGG Audio format | diff --git a/patterns/notepadwindowstate.hexpat b/patterns/notepadwindowstate.hexpat new file mode 100644 index 0000000..14ec9d1 --- /dev/null +++ b/patterns/notepadwindowstate.hexpat @@ -0,0 +1,50 @@ +#pragma author ogmini https://github.com/ogmini +#pragma description Windows 11 Notepad Window State file %localappdata%\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\LocalState\WindowState + +#include +#include +#include +#include + +using ul = type::uLEB128; +using int = u32; + +struct Tab +{ + u128 GUID; +}; + +struct WindowState +{ + char HeaderIdentifier[2]; // NP + ul SequenceNumber; + ul BytesToCRC32; + u8 Delim[1]; + ul NumberTabs; + + Tab Tabs[NumberTabs]; + + ul ActiveTab; + + int CoordTopLeftX; + int CoordTopLeftY; + + int CoordBottomRightX; + int CoordBottomRightY; + + int WindowSizeWidth; + int WindowSizeHeight; + + u8 Delim2[1]; + + int CRC32; + + u8 SlackSpace[while(!std::mem::eof())]; +}; + + + + +// -- Declaration -- + +WindowState state @ 0x0; diff --git a/tests/patterns/test_data/notepad-windowstate.hexpat.bin b/tests/patterns/test_data/notepad-windowstate.hexpat.bin new file mode 100644 index 0000000..d2b12a5 Binary files /dev/null and b/tests/patterns/test_data/notepad-windowstate.hexpat.bin differ