- ret = fread(&hdr, 1, sizeof(hdr), infile);
- if (ret != sizeof(hdr)) {
- fprintf(stderr, "Corrupt input file (not fwcutter output)\n");
- goto err_close;
- }
- if (hdr.type != 'u') {
- fprintf(stderr, "Corrupt input file. Not a microcode image.\n");
- goto err_close;
- }
- if (hdr.ver != 1) {
- fprintf(stderr, "Invalid input file header version.\n");
- goto err_close;
+ if (!cmdargs.no_header) {
+ ret = fread(&hdr, 1, sizeof(hdr), infile);
+ if (ret != sizeof(hdr)) {
+ fprintf(stderr, "Corrupt input file (not fwcutter output)\n");
+ goto err_close;
+ }
+ if (hdr.type != FW_TYPE_UCODE) {
+ fprintf(stderr, "Corrupt input file. Not a microcode image.\n");
+ goto err_close;
+ }
+ if (hdr.ver != FW_HDR_VER) {
+ fprintf(stderr, "Invalid input file header version.\n");
+ goto err_close;
+ }