+ /* for TRXv2 set bin-header Flags to 0xFF for CRC calculation like CFE does */
+ if (trx_version == 2) {
+ if(cur_len - p->offsets[3] < sizeof(binheader)) {
+ fprintf(stderr, "TRXv2 binheader too small!\n");
+ return EXIT_FAILURE;
+ }
+ memcpy(binheader, buf + p->offsets[3], sizeof(binheader)); /* save header */
+ memset(buf + p->offsets[3] + 22, 0xFF, 8); /* set stable and try1-3 to 0xFF */
+ }
+