Converting serial types with the type_helper() function

The type_helper() function is responsible for extracting the payload based on the types of values in the data. While consisting of many lines of code, it's really no more than a series of conditional statements that, if one is True, dictates how the data is processed:

298 def type_helper(types, data):299     """300     The type_helper function decodes the serial type of the301     Varints in the WAL file.302     :param types: The processed values of the Varints.303     :param data: The raw data in the cell that needs to be304     properly decoded via its varint values.305     :return: cell_data, a list of the processed data.306     """

On lines 307 and 308, we create the list that will store the extracted payload data ...

Get Learning Python for Forensics - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.