+def IsFspHeaderValid (binfile):\r
+ fd = open (binfile, "rb")\r
+ bindat = fd.read(0x200)\r
+ fd.close()\r
+ HeaderList = ['FSPH' , 'FSPP' , 'FSPE']\r
+ OffsetList = []\r
+ for each in HeaderList:\r
+ if each in bindat:\r
+ idx = bindat.index(each)\r
+ else:\r
+ idx = 0\r
+ OffsetList.append(idx)\r
+ if not OffsetList[0] or not OffsetList[1]:\r
+ return False\r
+ Revision = ord(bindat[OffsetList[0] + 0x0B])\r
+ if Revision > 1 and not OffsetList[2]:\r
+ return False\r
+ return True\r
+\r