This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
ACB.bt
151 lines (133 loc) · 4.05 KB
/
ACB.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//------------------------------------------------
//--- 010 Editor v9.0.2 Binary Template
//
// File: ACB.bt
// Authors: TKGP
// Version:
// Purpose: Unknown Dark Souls 2 format, one per map
// Category: Dantelion
// File Mask: *.acb
// ID Bytes: 41 43 42 00
// History:
//------------------------------------------------
#include "Util.bt"
LittleEndian();
if (ReadUInt(0xC) > FileSize())
BigEndian();
//------------------------------------------------
typedef struct {
char magic[4]; Assert(magic == "ACB\0");
byte unk04; Assert(unk04 == 2);
byte unk05; Assert(unk05 == 1);
short unk06 <hidden=true>; Assert(unk06 == 0);
int entryCount;
int offset0C <format=hex>;
} Header <bgcolor=cLtRed>;
typedef struct {
int offsetOffset <format=hex>;
local quad pos <hidden=true> = FTell();
FSeek(offsetOffset);
OffsetString str(0, 1);
int unk04;
FSeek(pos);
} NestedOffsetString <read=ReadNestedOffsetString, optimize=false>;
wstring ReadNestedOffsetString(NestedOffsetString& nos) {
string str;
SPrintf(str, "%i ", nos.unk04);
return str + nos.str.str;
}
typedef struct {
short unk00; //Assert(unk00 == -1);
short stringCount;
int stringsOffset <format=hex>; Assert(stringsOffset == FTell());
if (stringCount > 0) {
NestedOffsetString strings[stringCount];
}
} StringList <bgcolor=cAqua>;
typedef struct {
OffsetString absolutePath(0, 1);
OffsetString relativePath(0, 1);
short type;
if (type == 0) {
short unk0A; Assert(unk0A == 0);
int unk0C; Assert(unk0C == 0);
} else if (type == 1) {
short unk0A; Assert(unk0A == 0);
int unk0C; Assert(unk0C == 0);
} else if (type == 2) {
short unk0A;
int offset0C <format=hex>;
int unk10;
int unk14; Assert(unk14 == 0);
int unk18; Assert(unk18 == 0);
short unk1C;
byte reflectible;
byte unk1F;
int unk20;
byte unk24;
byte disableShadowSource;
byte disableShadowTarget;
byte unk27;
float unk28;
byte unk2C;
byte fixToCamera;
byte unk2E;
byte unk2F;
short unk30;
short unk32;
byte unk34;
byte unk35;
byte unk36;
byte unk37;
int unk38 <hidden=true>; Assert(unk38 == 0);
int unk3C <hidden=true>; Assert(unk3C == 0);
int unk40 <hidden=true>; Assert(unk40 == 0);
int unk44 <hidden=true>; Assert(unk44 == 0);
int unk48 <hidden=true>; Assert(unk48 == 0);
int unk4C <hidden=true>; Assert(unk4C == 0);
if (offset0C != 0) {
FSeek(offset0C);
StringList stringList;
}
} else if (type == 3) {
short unk0A; Assert(unk0A == 0);
int unk0C; Assert(unk0C == 0);
} else if (type == 4) {
short unk0A; Assert(unk0A == 0);
int unk0C; Assert(unk0C == 0);
int unk10;
int unk14;
} else if (type == 5) {
short unk0A; Assert(unk0A == 0);
int unk0C; Assert(unk0C == 0);
} else {
Assert(false, "Unknown type in entry");
}
} Entry <read=ReadEntry, optimize=false>;
wstring ReadEntry(Entry& entry) {
string str;
if (entry.type == 4) {
SPrintf(str, "%i %8X %8X | ", entry.type, entry.unk10, entry.unk14);
} else {
SPrintf(str, "%i | ", entry.type);
}
return str + entry.absolutePath.str + " | " + entry.relativePath.str;
}
//------------------------------------------------
Header header;
struct {
local int i <hidden=true>;
local quad pos <hidden=true>;
for (i = 0; i < header.entryCount; i++) {
int entryOffset <hidden=true>;
pos = FTell();
FSeek(entryOffset);
Entry entries;
FSeek(pos);
}
} entries <bgcolor=cLtGreen>;
// As far as I can tell this is just a big list of offsets
// to every other offset in the file, which seems pretty dubious
FSeek(header.offset0C);
local int indexCount = (FileSize() - FTell()) / 4;
int offsetIndex[indexCount] <format=hex, bgcolor=cBlack, fgcolor=cWhite>;