[Question] Parsing binaries of unknown size
Hi, I'm currently working with some custom physics data and I've been using [https://www.carvesystems.com/news/parsing-binaries-with-kaitai-struct/](url) as a reference, but I don't know exactly where the footer is located.

Currently, we've just commented out the bits where we actually deal with the footer and just read the footer in as another event, but then we cut out the last event in the function to graph the data since it's really the footer.

Struct definition

      seq:

      - id: file_header
        type: pixie4e_header

      - id: events
        type: event
        repeat: eos
        # repeat: until
        # repeat-until: _.header.evt_info == 0x0100

      # - id: file_footer
      #   type: pixie_eor

Event Definition

    event:

    seq:

      - id: header
        type: channel_header

      - id: data    
        type: u2
        repeat: expr
        repeat-expr: header.num_trace_blks * _root.file_header.blk_size

Footer Definition

    # pixie_eor:

    #   seq:

    #     - id: evt_pattern
    #       type: u2

    #     - id: evt_info
    #       type: u2

    #     - id: num_trace_blks
    #       type: u2

    #     - id: num_trace_blks_prev
    #       type: u2

    #     - id: reserved
    #       type: u2
    #       repeat: expr
    #       repeat-expr: 0x1C

Is there a way I can test each byte to check if it's really an event (has all of the identifiers of an event) and then if it doesn't, and it's near the end of the file, read it as the footer?

Otherwise, can I tell it to stop reading events "this many bits" before the end of the file and read the rest as the footer?

Thanks!

Edit: added code
