Problems in writing an analyzer for custom TCP-based protocol

Hi all,

I am trying to write a simple analyzer with BinPAC for a custom binary
TCP protocol with the following structure