From 85f554135063ca765c56e6224cac856a3eeff296 Mon Sep 17 00:00:00 2001 From: Dexrn ZacAttack <60078656+DexrnZacAttack@users.noreply.github.com> Date: Sun, 17 Nov 2024 04:58:02 -0800 Subject: [PATCH] patterns: Added Minecraft LCE ARC file format (#307) * Create arc.hexpat * add test file * mention arc * abide by contributing.md * use virtual filesystem * brainfart * ifdefs to fix github actions moment #2 --- README.md | 1 + patterns/arc.hexpat | 26 ++++++++++++++++++++++++ tests/patterns/test_data/arc.hexpat.arc | Bin 0 -> 7480 bytes 3 files changed, 27 insertions(+) create mode 100644 patterns/arc.hexpat create mode 100644 tests/patterns/test_data/arc.hexpat.arc diff --git a/README.md b/README.md index e7f1d277..336ade46 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 00000000..02b89f43 --- /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 0000000000000000000000000000000000000000..6678ee6313caebd077e205b5727afa43afef31cd GIT binary patch literal 7480 zcmbVxXEdBq*Y;ot(fjCwQKOCCV;E)hPIRM3i|CzEV)T{-qxXm?K?u=>km#Z(!bI;R zqJ>YM=l$0A{{GHd*V%htXYcDi>t5^rajy#i0N??LT%9~TyoLON`~Uy|;tt#Zk^rZt z!A|zR!9q^|VZ8wWW(xvclE5L=qm?M|r?Wua?(Q6Z!NuV|gYI&^;+?!G+7oqaSw$o7{< z>b#|UZqr3kVy#8?XDUw@@!YaPk-unxj3{2sjEPR8(S-F@X=&RRdr=iA@3!9(xYz(X zdz4|@ezSA9l*nzrQ_s_9ZW>Kdv&>kn$Q%MRJw9`hGLesXylal&S^(Rwp! zpm?G+cd@U>jP37!vOn?hMPX$21@_duD(4*%m`pf(zdwaN_&bMge6rMiIJn5CZJ8Z+ z@WJ9phQJUgiS6)cIm5-aj-50YdBhZ*>u~dh4^Zk=!apxdD$A&Z7xQ)BOaTyhYQU-X zsa?ib-31mqrj7X+N>9N_(~ru%P#k1TMEGn9dvqBr41m(u?Nnjz;&|%c$%`zv#_M^%4w5> zIo-eY=C;TD4o)z%r7>S%EX8#tLJ9VoUirdJrNYybs z5Qbs#o8)QLM$SW7t;mvRY{3L`fxK#5-IswO+Uoe-zfaW<&)3y_2YyW@&2lt58}tOn z2$D9Qxw24@AT1|kqJeQEDkiHVQG6VY{Q9<$fdwxyOl{*gL*5)cLlFm^>HT{d4BVDR z`X6OgTuMeWrqw}pq=##C%<0kAI7D_Fi*6;{Q8-NUvF^pz#l%5d`AS?UU3~*M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