Add verbose structure output.

This commit is contained in:
Markus Birth 2018-12-10 03:00:51 +01:00
parent 28480970c4
commit 4988fc7b63
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

@ -79,6 +79,13 @@ class Gcd:
tlv_length += tlv.length
last_tlv = tlv.type_id
def print_struct_full(self):
"""
Prints the structure of the parsed GCD file
"""
for i, tlv in enumerate(self.struct):
print("#{:03d}: {}".format(i, tlv))
def validate(self, print_stats: bool=False):
"""
Checks and verifies all checksums in the GCD.
@ -122,7 +129,7 @@ class Gcd:
def write_dump_block(self, f, name):
f.write("\n[BLOCK_{}]\n".format(name))
def write_dump_param(self, f, key, value, comment=None):
if comment is not None:
f.write("# {}\n".format(comment))