Jacob Campbell
Jacob Campbell
CC#
Created by Jacob Campbell on 5/28/2025 in #help
Parsing/Deserializing Structured File’s Bytes
Hi all. I have a file that I need to break down and turn into data that I can visualize. I know how the file is structured and know how to convert each byte into its corresponding data type (str, int32/16/8, uint32/16/8, etc). Where I’m struggling is figuring out what the best way to actually sort through the data is. So far my script is a jumbled mess of going byte by byte and decoding each one. What my plan is currently is to store the file header and data (there is a compression on everything after the header) in an object as raw bytes, then decompress, then create methods to convert each chunk of data (each stored with their own headers) in attributes within the file’s object. Does it sound like I’m on the right track of things, or is there a better way to handle the parsing of structured files like this?
16 replies