I'm analysing a binary file that can be divided in mainly three sections (Head, body and footer). The head and footer are both 36 bytes long and the body expends its length dynamically, depending on what is stored in the file. Now I want to have a gramma that recognizes how long the body structure is. Also I need to adjust the alignment of the footer structure, so that the last 36 byte of the file are included in this structure element. The length of the file - (36 bytes head + 36 bytes footer) = lengthe of the body structure. I tryed a long time to find a solution for this problem but without a satisfactory success.