Skip to content

Commit 8d38a19

Browse files
added & updated binary templates
1 parent ab9150c commit 8d38a19

4 files changed

Lines changed: 69 additions & 7 deletions

File tree

BinaryTemplates/NierA_FTB.bt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
struct Header
22
{
3-
char magic[118];
3+
char magic[4];
4+
uint32 two;
5+
char uuid[36];
6+
ubyte null;
7+
char fileName[32];
8+
char fontName[32]<comment="SHIFT-JIS">;
9+
ubyte unknown[9];
410
uint16 textures_count;
511
uint16 unknown<format=hex>;
612
uint16 chars_count;

BinaryTemplates/NierA_MCD.bt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Order of tables (not all in header) (no byte alignment):
55
// <name>, <zero terminator>
66
// 0. Header
7-
// 1. Letters, [0x0000]
7+
// 1. Letters, [0x0000] or [0x00000000] (4 byte alignment)
88
// 2. Messages, [0x00000000]
99
// 3. Paragraphs, [0x00000000]
1010
// 4. Lines, [0x00000000]
@@ -32,9 +32,6 @@ struct Line;
3232
struct Letter {
3333
uint16 code;
3434
short idx;
35-
36-
if (code >= 0x8000 && code != 0x8001 && !(code == 0x8020 && (idx == 9 || idx == 121)))
37-
Printf("Letter: code = %04X, idx = %d\n", code, idx);
3835
};
3936
struct Message {
4037
uint32 paragraphsOffset<format=hex>;
@@ -76,7 +73,7 @@ struct Line {
7673

7774
local int letCount = (lettersCount - 1) / 2;
7875
if (letCount > 0)
79-
Letter letters[letCount]<read=readLetter, optimize=false>;
76+
Letter letters[letCount]<read=readLetter2>;
8077
uint16 terminator<format=hex>;
8178

8279
FSeek(pos);
@@ -128,7 +125,7 @@ struct {
128125
uint16 terminator<format=hex>;
129126
continue;
130127
}
131-
Letter letter<read=readLetter>;
128+
Letter letter<read=readLetter2>;
132129
}
133130
} letters;
134131

@@ -211,6 +208,12 @@ wstring readLetter(Letter &let) {
211208
}
212209
return s;
213210
}
211+
string readLetter2(Letter &let) {
212+
string s = L"";
213+
SPrintf(s, "%s (%d)", readLetter(let), let.idx);
214+
wstring s2 = s;
215+
return s2;
216+
}
214217
wstring readLine(Line &str) {
215218
wstring s = L"";
216219
int i = 0;

BinaryTemplates/NierA_MTG.bt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
struct Header
3+
{
4+
uint32 count;
5+
uint32 u1;
6+
} header;
7+
8+
struct Entry
9+
{
10+
uint32 index;
11+
uint32 typeHash; // example: core_pc_key
12+
uint32 nameHash; // examples: btn_000, key_036
13+
};
14+
15+
Entry entries[header.count];

BinaryTemplates/NierA_UVD.bt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
struct Header {
3+
uint32 ui_1;
4+
uint32 entriesCount;
5+
uint32 entriesOffset;
6+
uint32 texturesOffset;
7+
};
8+
9+
struct Entry {
10+
char name[32];
11+
ubyte null[32];
12+
uint32 idMaybe<format=hex>;
13+
uint32 textureId<format=hex>;
14+
float x;
15+
float y;
16+
float width;
17+
float height;
18+
uint32 u1;
19+
uint32 u2;
20+
};
21+
22+
struct Texture
23+
{
24+
char name[32];
25+
uint32 id<format=hex>;
26+
};
27+
28+
29+
Header header;
30+
31+
FSeek(header.entriesOffset);
32+
Entry entries[header.entriesCount];
33+
34+
FSeek(header.texturesOffset);
35+
struct {
36+
while (FTell() < FileSize())
37+
Texture t;
38+
} textures;

0 commit comments

Comments
 (0)