iso2bin.py 1.0 KB

1234567891011121314151617181920212223242526
  1. #!/usr/bin/python3
  2. # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-130.pdf
  3. # convert MODE1/2048 (iso) to MODE1/2352 (bin)
  4. # each 2352 sector contains in this order:
  5. #
  6. # Sync: 12 bytes ( is always 00 ff ff ff ff ff ff ff ff ff ff 00 )
  7. # Sector Address: 3 bytes, ( first byte is A-MIN, second byte is A-SEC, third time is A-FRAME) (counting the frames since the begining of the of the disc, not including lead-in)
  8. # Mode: 1 byte (always 0x01)
  9. # User Data: 2048 bytes (the iso file, taken in 2048 byte segments)
  10. # EDC: 4 bytes (P(x) = (x**16 + x**15 + x**2 + 1) . (x**16 + x**2 + x + 1))
  11. # Intermediate: 8 bytes (always 8 0x00 bytes)
  12. # P-Parity: 172 bytes
  13. # Q-Parity: 104 Bytes
  14. #
  15. # 12 + 3 + 1 + 2048 + 4 + 8 + 172 + 104 = 2352
  16. # https://github.com/xdotnano/PSXtract/blob/master/Windows/cdrom.h
  17. # vatlv track 1 line 1: 00 ff ff ff ff ff ff ff ff ff ff 00 00 02 00 01
  18. # vatlv track 1 line 99: 00 ff ff ff ff ff ff ff ff ff ff 00 00 02 01 01
  19. # vatlv track 1 line 197: 00 ff ff ff ff ff ff ff ff ff ff 00 00 02 02 01