Store historical block hashes in a contract, and modify the BLOCKHASH (0x40) opcode to read this contract.