summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crodump.py42
1 files changed, 38 insertions, 4 deletions
diff --git a/crodump.py b/crodump.py
index 77f00e9..d0cd67c 100644
--- a/crodump.py
+++ b/crodump.py
@@ -243,6 +243,28 @@ def decode_field(data):
243 else: 243 else:
244 print("Type: %2d %2d %d,%d - '%s'" % (typ, idx1, unk1, unk2, name)) 244 print("Type: %2d %2d %d,%d - '%s'" % (typ, idx1, unk1, unk2, name))
245 245
246"""
247 2 Base000 - 000001 050001 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f0010000000000000000010000000000000000
248 1 Base000 - 000001 050002 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000
249 1 Base000 - 000001 050007 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f0010000000000000000020000000000000000ffffffff
250 1 Base000 - 00000200050001 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f0010000000000000000020000000000000000ffffffff
2511859 Base000 - 00000300050001 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
252 37 Base000 - 00000300050002 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
253 12 Base000 - 00000300050003 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
254 6 Base000 - 00000300050004 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
255 6 Base000 - 00000300050005 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
256 6 Base000 - 00000300050006 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
257 10 Base000 - 00000300050007 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
258 6 Base000 - 00000300050008 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
259 3 Base000 - 00000300050009 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
260 4 Base000 - 0000030005000a 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
261 2 Base000 - 0000030005000b 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
262 2 Base000 - 0000030005000d 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
263 1 Base000 - 0000030005000e 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
264 1 Base000 - 00000300050012 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
265 1 Base000 - 0000030005001c 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff
266 2 Base000 - 00000300090102000000000000000000000005d4e0e9ebfb02464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000060000000000000000ffffffffffffffffffffffffffffffffffffffff1700000003ffffffffffffffffffffffff06000000010000000000
267"""
246 268
247def destruct_base_definition(args, data): 269def destruct_base_definition(args, data):
248 """ 270 """
@@ -250,15 +272,27 @@ def destruct_base_definition(args, data):
250 """ 272 """
251 rd = ByteReader(data) 273 rd = ByteReader(data)
252 274
253 unk123 = [rd.readword() for _ in range(3)] 275 unk1 = rd.readword()
254 unk45 = [rd.readdword() for _ in range(2)] 276 version = rd.readbyte()
277 if version > 1:
278 _ = rd.readbyte() # always 0 anyway
279 unk2 = rd.readbyte() # if this is not 5 (but 9), there's another 4 bytes inserted
280 unk3 = rd.readbyte()
281
282 if unk2 > 5: # seen only 5 and 9 for now with 9 implying an extra dword
283 _ = rd.readdword()
284
285 unk4 = rd.readdword()
286 unk5 = rd.readdword()
287
255 tablename = rd.readname() 288 tablename = rd.readname()
256 unkname = rd.readname() 289 abbrev = rd.readname()
257 unk7 = rd.readdword() 290 unk7 = rd.readdword()
258 nrfields = rd.readdword() 291 nrfields = rd.readdword()
292
259 if args.verbose: 293 if args.verbose:
260 print("table: %s" % tohex(data[:rd.o])) 294 print("table: %s" % tohex(data[:rd.o]))
261 print("%d,%d,%d,%d,%d %d,%d '%s' '%s'" % (*unk123, *unk45, unk7, nrfields, tablename, unkname)) 295 print("%d,%d,%d,%d,%d,%d %d,%d '%s' '%s'" % (unk1, version, unk2, unk3, unk4, unk5, unk7, nrfields, tablename, abbrev))
262 296
263 fields = [] 297 fields = []
264 for _ in range(nrfields): 298 for _ in range(nrfields):