File tree 3 files changed +38
-0
lines changed
3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
105
105
| MBR & GPT | | [ ` patterns/partition_table.hexpat ` ] ( patterns/partition_table.hexpat ) | Partition tables with primary focus on GPT |
106
106
| MIDI | ` audio/midi ` | [ ` patterns/midi.hexpat ` ] ( patterns/midi.hexpat ) | MIDI header, event fields provided |
107
107
| MiniDump | ` application/x-dmp ` | [ ` patterns/minidump.hexpat ` ] ( patterns/minidump.hexpat ) | Windows MiniDump files |
108
+ | MO | | [ ` patterns/mo.hexpat ` ] ( patterns/mo.hexpat ) | GNU Machine Object (MO) files containing translations for gettext |
108
109
| mp4 | ` video/mp4 ` | [ ` patterns/mp4.hexpat ` ] ( patterns/mp4.hexpat ) | MPEG-4 Part 14 digital multimedia container format |
109
110
| msgpack | ` application/x-msgpack ` | [ ` patterns/msgpack.hexpat ` ] ( patterns/msgpack.hexpat ) | MessagePack binary serialization format |
110
111
| MSSCMP | | [ ` patterns/msscmp.hexpat ` ] ( patterns/msscmp.hexpat ) | Miles Sound System Compressed Archive |
Original file line number Diff line number Diff line change
1
+ #pragma author dvob
2
+ #pragma description GNU Machine Object (MO) files containing translations for gettext
3
+
4
+ // https://www.gnu.org/software/gettext/manual/html_node/MO-Files.html
5
+
6
+ import std.core;
7
+ import std.io;
8
+
9
+ struct strPtr {
10
+ u32 length;
11
+ u32 offset;
12
+ char string[length] @ offset;
13
+ };
14
+
15
+ struct file {
16
+ be u32 magic;
17
+ if ( magic == 0x950412de )
18
+ std::core::set_endian(std::mem::Endian::Big);
19
+ else if ( magic == 0xde120495)
20
+ std::core::set_endian(std::mem::Endian::Little);
21
+ else
22
+ std::error("Invalid MO Magic!");
23
+
24
+ u16 majorVersion;
25
+ u16 minorVersion;
26
+ u32 count;
27
+ u32 msgIdOffset;
28
+ u32 msgStrOffset;
29
+ u32 hashSize;
30
+ u32 hashOffset;
31
+
32
+ u32 hashTable[hashSize] @ hashOffset;
33
+ strPtr msgIDTable[count] @ msgIdOffset;
34
+ strPtr msgStrTable[count] @ msgStrOffset;
35
+ };
36
+
37
+ file moFile @ 0x0;
You can’t perform that action at this time.
0 commit comments