Editing ISO.BIN.EDAT

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 430: Line 430:
* broken github: https://github.com/euss/psp_edat_decryptor (git'ed by euss for convenience)
* broken github: https://github.com/euss/psp_edat_decryptor (git'ed by euss for convenience)
* broken mirrors: [http://mir.cr/0XXBT99Z], [http://mir.cr/1SNVEH2D], [http://mir.cr/ZKZJFPET]
* broken mirrors: [http://mir.cr/0XXBT99Z], [http://mir.cr/1SNVEH2D], [http://mir.cr/ZKZJFPET]
=== Generate the subchannel blob ===
Python code to generate the subchannel blob:
<pre>
def generate_subchannels(magic_word):
    def generate_subchannel(sector, is_corrupt):
        def bcd(i):
            return int(i % 10) + 16 * (int(i / 10) % 10)
        sc = bytearray(12)
        s = sector - 150
        struct.pack_into('<I', sc, 0, s)
        struct.pack_into('<B', sc, 4, 1)
        struct.pack_into('<B', sc, 5, 1)
        if is_corrupt:
            s = s - 1
        struct.pack_into('<B', sc, 8, bcd(s % 75))
        s = s - (s % 75)
        s = int(s / 75)
        struct.pack_into('<B', sc, 7, bcd(s % 60))
        struct.pack_into('<B', sc, 6, bcd(int(s / 60)))
        s = sector
        if is_corrupt:
            s = s - 1
        struct.pack_into('<B', sc, 11, bcd(s % 75))
        s = s - (s % 75)
        s = int(s / 75)
        struct.pack_into('<B', sc, 10, bcd(s % 60))
        struct.pack_into('<B', sc, 9, bcd(int(s / 60)))
        return sc
    sector_pairs = {
        15: [14105,14110],
        14: [14231,14236],
        13: [14485,14490],
        12: [14579,14584],
        11: [14649,14654],
        10: [14899,14904],
        9: [15056,15061],
        8: [15130,15135],
        7: [15242,15247],
        6: [15312,15317],
        5: [15378,15383],
        4: [15628,15633],
        3: [15919,15924],
        2: [16031,16036],
        1: [16101,16106],
        0: [16167,16172]
        }
    scd = bytes(0)
    scd = scd + bytes([0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff])
    for i in range(15, -1, -1):
        scd = scd + generate_subchannel(sector_pairs[i][0], magic_word & (1<<i))
        scd = scd + generate_subchannel(sector_pairs[i][1], magic_word & (1<<i))
    scd = scd + bytes([0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff])
    print('Generate subchannel data for 0x%04x' % magic_word)
    s = scd
    while s:
        print(struct.unpack_from('<I', s, 0)[0], s[:12].hex())
        s = s[12:]
    return scd
</pre>


==About PS2 Classics==
==About PS2 Classics==
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)