Weird problem with arduino
If you want to get a value from PROGMEM you must read it with pgm_read functions. Read the PROGMEM reference.

for (int i = 0; i &lt; 8; i++) {
  Serial.print(pgm_read_byte_near(pat + i),HEX);
}


pat[0] in Serial.print(pat[0],HEX); is an item in a constant array const uint8_t pat[]. it can't change at runtime so the compiler uses the value 0xFF. that is why it is printed ok without pgm_read_byte_near