diff --git a/README.md b/README.md index e7f1d27..336ade4 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | AFE2 | | [`patterns/afe2.hexpat`](patterns/afe2.hexpat) | Nintendo Switch Atmosphère CFW Fatal Error log | | ANI | `application/x-navi-animation` | [`patterns/ani.hexpat`](patterns/ani.hexpat) | Windows Animated Cursor file | | AR | `application/x-archive` | [`patterns/ar.hexpat`](patterns/ar.hexpat) | Static library archive files | +| ARC | | [`patterns/arc.hexpat`(patterns/arc.hexpat) | Minecraft Legacy Console Edition ARC files | | ARIA2 | | [`patterns/aria2.hexpat`](patterns/aria2.hexpat) | ARIA2 Download Manager Control files | | ARM VTOR | | [`patterns/arm_cm_vtor.hexpat`](patterns/arm_cm_vtor.hexpat) | ARM Cortex M Vector Table Layout | | Bastion | | [`patterns/bastion/*`](https://gitlab.com/EvelynTSMG/imhex-bastion-pats) | Various [Bastion](https://en.wikipedia.org/wiki/Bastion_(video_game)) files | diff --git a/patterns/arc.hexpat b/patterns/arc.hexpat new file mode 100644 index 0000000..02b89f4 --- /dev/null +++ b/patterns/arc.hexpat @@ -0,0 +1,26 @@ +#pragma author DexrnZacAttack +#pragma description Minecraft LCE ARC File +#pragma endian big + +import std.string; +#ifdef __IMHEX__ + import hex.core; +#endif + +struct Table { + u16 nameSize; + char fileName[nameSize]; + u32 offset; + u32 size; + u8 file[size] @ offset; + #ifdef __IMHEX__ + hex::core::add_virtual_file(fileName, file); + #endif +} [[name(std::string::to_string(fileName))]]; + +struct ARC { + u32 count; + Table table[count]; +}; + +ARC arc @ 0x00; diff --git a/tests/patterns/test_data/arc.hexpat.arc b/tests/patterns/test_data/arc.hexpat.arc new file mode 100644 index 0000000..6678ee6 Binary files /dev/null and b/tests/patterns/test_data/arc.hexpat.arc differ