From 07a020d9dd72f758e4e0d0323a9c13a0ac5f1848 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 13 Jul 2021 02:08:56 +0200 Subject: Support more table definition layout versions found in test data and bigdump databses --- crodump.py | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/crodump.py b/crodump.py index 1b2540f..d668915 100644 --- a/crodump.py +++ b/crodump.py @@ -226,6 +226,28 @@ def decode_field(data): else: print("Type: %d %2d %d,%d - '%s'" % (typ, idx1, unk1, unk2, name)) +""" + 2 Base000 - 000001 050001 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f0010000000000000000010000000000000000 + 1 Base000 - 000001 050002 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000 + 1 Base000 - 000001 050007 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f0010000000000000000020000000000000000ffffffff + 1 Base000 - 00000200050001 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f0010000000000000000020000000000000000ffffffff +1859 Base000 - 00000300050001 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 37 Base000 - 00000300050002 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 12 Base000 - 00000300050003 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 6 Base000 - 00000300050004 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 6 Base000 - 00000300050005 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 6 Base000 - 00000300050006 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 10 Base000 - 00000300050007 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 6 Base000 - 00000300050008 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 3 Base000 - 00000300050009 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 4 Base000 - 0000030005000a 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 2 Base000 - 0000030005000b 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 2 Base000 - 0000030005000d 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 1 Base000 - 0000030005000e 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 1 Base000 - 00000300050012 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 1 Base000 - 0000030005001c 000000000000000546696c657302464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000020000000000000000ffffffff + 2 Base000 - 00000300090102000000000000000000000005d4e0e9ebfb02464c01000000010000001b000000000000000fd1e8f1f2e5ecedfbe920edeeece5f001000000000000000000000000060000000000000000ffffffffffffffffffffffffffffffffffffffff1700000003ffffffffffffffffffffffff06000000010000000000 +""" def destruct_base_definition(args, data): """ @@ -233,13 +255,24 @@ def destruct_base_definition(args, data): """ rd = ByteReader(data) - unk123 = [rd.readword() for _ in range(3)] - unk45 = [rd.readdword() for _ in range(2)] + unk1 = rd.readword() + version = rd.readbyte() + if version > 1: + _ = rd.readbyte() # always 0 anyway + unk2 = rd.readbyte() # if this is not 5 (but 9), there's another 4 bytes inserted + unk3 = rd.readbyte() + + if unk2 > 5: # seen only 5 and 9 for now with 9 implying an extra dword + _ = rd.readdword() + + unk4 = rd.readdword() + unk5 = rd.readdword() + tablename = rd.readname() - unkname = rd.readname() + abbrev = rd.readname() unk7 = rd.readdword() nrfields = rd.readdword() - print("%d,%d,%d,%d,%d %d,%d '%s' '%s'" % (*unk123, *unk45, unk7, nrfields, tablename, unkname)) + print("%d,%d,%d,%d,%d,%d %d,%d '%s' '%s'" % (unk1, version, unk2, unk3, unk4, unk5, unk7, nrfields, tablename, abbrev)) fields = [] for _ in range(nrfields): l = rd.readword() -- cgit v1.2.3