Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minecraft LCE LOC file #311

Merged
merged 2 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
| ISO | | [`patterns/iso.hexpat`](patterns/iso.hexpat) | ISO 9660 file system |
| Java Class | `application/x-java-applet` | [`patterns/java_class.hexpat`](patterns/java_class.hexpat) | Java Class files |
| JPEG | `image/jpeg` | [`patterns/jpeg.hexpat`](patterns/jpeg.hexpat) | JPEG Image Format |
| LOC | | [`patterns/loc.hexpat`](patterns/loc.hexpat) | Minecraft Legacy Console Edition Language file |
| Lua 5.1 | | [`patterns/lua51.hexpat`](patterns/lua51.hexpat) | Lua 5.1 bytecode |
| Lua 5.2 | | [`patterns/lua52.hexpat`](patterns/lua52.hexpat) | Lua 5.2 bytecode |
| Lua 5.3 | | [`patterns/lua53.hexpat`](patterns/lua53.hexpat) | Lua 5.3 bytecode |
Expand Down
46 changes: 46 additions & 0 deletions patterns/loc.hexpat
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#pragma author DexrnZacAttack
#pragma description Minecraft LCE LOC file

#pragma endian big
#pragma array_limit 739845729834
#pragma pattern_limit 34893726894

import std.string;

struct Keys {
bool useUniqueIDs;
u32 count;
u32 key[count];
};

struct LangIds {
u16 len;
char id[len];
u32 unk;
} [[name(id)]];

struct LocString {
u16 keySize;
char key[keySize];
} [[name(std::string::to_string(key))]];

struct Language {
u32 read;
if (read > 0)
u8 unk;
u16 len;
char id[len];
u32 count;
LocString strings[count];
} [[name(id)]];

struct Loc {
u32 version;
u32 count;
if (version == 2)
Keys keys;
LangIds ids[count];
Language language[count];
};

Loc loc @ 0x00;
Loading