CPS2 and CPS3 IC decapsulation progress

Όλα σχετικά με τον αγαπημένο μας emulator.

Συντονιστές: Nemo, Maddog, Whacker, BraiNKilleR

Άβαταρ μέλους
pepinos
Emulation King
Emulation King
Δημοσιεύσεις: 1228
Εγγραφή: 11 Μάιος 2004 01:48

CPS2 and CPS3 IC decapsulation progress

Δημοσίευση από pepinos »

Hi all,
Latest update on decapsulation of CPS2 and CPS3 ICs.

CPS2 game "cartridge":

DL-1525 (SPA). 208 pin plastic QFP. Die marking is E38M with moto copyright.

This is a Motorola gate array, with a massive standard cell of a 68k plopped down in one corner of it (takes up around a quarter of the die). All the interconnects from this standard cell to the rest of the array are clearly visible (looks like they just took a 68k die mask, and dropped it onto the asic mask). Should be within realms of possibility to work out at least the more direct connections from the 68k to the ASIC i/o pads.

CPS3 motherboard:

DL-2729 (PPU). 304 pins plastic QFP. No visible die markings. Due to the package marking style, I believe this to be a Toshiba asic based design.
This is a massive die, that appears to be the main graphics processor.

DL-2829 (CCU). 208 pins plastic QFP. Toshiba die marking. No ID number.
This appears to be a typical Toshiba full custom ASIC.

DL-3329 (SSU). 144 pins plastic QFP. Toshiba die marking. No ID number.
This appears to be a typical Toshiba full custom ASIC.


That's all for now.

Cheers,

Pete
http://www.mame.net/cgi-bin/wwwthreads/ ... Post201131
Κάποτε οι μαθητές του είχαν ρωτήσει το Αριστοτέλη για το ποιό είναι το αγριότερο ζώο. Και εκείνος αποκρίθει : Από τα οικόσιτα ο ΚΟΛΑΚΑΣ και από τα ελεύθερα ο ΣΥΚΟΦΑΝΤΗΣ.
Άβαταρ μέλους
Maddog
Master Modelator
Master Modelator
Δημοσιεύσεις: 3768
Εγγραφή: 26 Μάιος 2004 14:44
Τοποθεσία: Κάποιο beach bar στο Ντουμπάι
Επικοινωνία:

Δημοσίευση από Maddog »

http://mamelife.blogspot.com/

Φρέσκα νέα από τον "πατέρα" του ΜΑΜΕ.
Το κείμενο είναι μάλλον ακατανόητο, αλλά πιστεύω ότι αφού το έπιασε αυτός θα δούμε σημαντική πρόοδο σύντομα! :D
Παππού όλος ο κόσμος ανησυχεί μήπως η σχέση σου με την πιτσιρίκα αποβεί μοιραία.
-Τι να κάνουμε παιδί μου...αν πεθάνει - πέθανε...
Άβαταρ μέλους
Maddog
Master Modelator
Master Modelator
Δημοσιεύσεις: 3768
Εγγραφή: 26 Μάιος 2004 14:44
Τοποθεσία: Κάποιο beach bar στο Ντουμπάι
Επικοινωνία:

Δημοσίευση από Maddog »

Ξανακοιτάχτε το παραπάνω link, ο αλγόριθμος του CPS2 encryption φαίνεται να σπάει!!! :shock:
Η΄τουλάχιστον τρίζει... ;)
So, given the strong evidence Andy has found, it really looks like the algorithm is a 4-round Feistel network.
Andy has published his program but is reporting some problems in recreating the original tables--the values generated by his program are XORed with a constant value when compared with the original table.

I have just verified that this doesn't happen to me, so I presume this is due to a different method we used to reconstruct the Feistel function for the first two rounds.
Φυσικά τα μαθηματικά που δείχνει είναι τελείως hardcore, αλλά έχω την εντύπωση ότι όσοι (βιαστικοί!) κατεβάσατε τα πρόσφατα CHD των CPS2 games θα το μετανιώσετε σύντομα...ίσως και στην επόμενη u version! :twisted:
Παππού όλος ο κόσμος ανησυχεί μήπως η σχέση σου με την πιτσιρίκα αποβεί μοιραία.
-Τι να κάνουμε παιδί μου...αν πεθάνει - πέθανε...
Άβαταρ μέλους
GigaBac28
Black Tiger
Black Tiger
Δημοσιεύσεις: 98
Εγγραφή: 01 Φεβ 2006 18:27
Τοποθεσία: ΑΙΓΙΟ ΑΧΑ'Ι'ΑΣ
Επικοινωνία:

Δημοσίευση από GigaBac28 »

Θα το έκανα, αλλά ας είναι καλά ο ΒΚ που με σταμάτησε... :wink:

Άλλωστε στο Mame32 Plus που χρησιμοποιώ δεν χρειάζονται αυτά τα τεράστια CHDs, παρά μόνον τα μικρά XORs...Έτσι δεν αντιμετώπισα ποτέ σοβαρά τέτοια προβλήματα με τα CHDs. 8)
Mame και ξερό ψωμί!!!
Άβαταρ μέλους
pepinos
Emulation King
Emulation King
Δημοσιεύσεις: 1228
Εγγραφή: 11 Μάιος 2004 01:48

Δημοσίευση από pepinos »

εχει ραγισει...ο νικολας μαλλον το εχει ανακαλυψει
Today I realised why I was having problems with the correlations between subkey bits, where some bits had to be derived from the others not only using XOR, but also AND and OR.

The reason was again in the s-boxes that only have 4 or 5 data inputs instead of the full 6. Those boxes contain 2 or 4 subtables, and the order of the subtables inside the box or the order of the bits inside each subtable isn't particularly important when decrypting a single address, because they can always be compensated by appropriate bits in the subkey.

However, when putting all subkeys together, those things became important. E.g. I could be finding that when using subtable #3 in a box, then two of the inputs had to be inverted. To fix this, I had to rearrange the subtables inside the s-boxes to make everything in sync.

The result was excellent. Previously, some of the correlations among the 96 bits were overly complex, taking up to 4 bits at once. Now every bit is directly correlated to another. The only exception is the bits that correspond to the "empty" inputs of s-boxes that take only 4 or 5 data inputs. What this means is that all 6 inputs of all s-boxes always receive the XOR of three sources: either a data bit, a key seed bit, and a global key bit; or two key seed bits, and a global key bit.


That's only the beginning of the good news, though. After fixing the s-boxes, I could attack again the first part on the algorithm on the assumption it was a 4-round Feistel network, and indeed it was.

So the algorithm turns out to be like this:


1. Take the 16-bit address and a 96-bit key and run them through the first Feistel network, to produce a 16-bit subkey.

2. Take the 16-bit ciphertext, 16-bit subkey, and another 96-bit key and run them through the second Feistel network, to produce the 16-bit plaintext



So now, for the first time, I would be able to produce a program that algorithmically decrypts one of the game for which we have full tables, without using any table.

It's not yet time to celebrate, though: the s-boxes for the first Feistel network still have to be properly determined, and this might require having access to some more games.

Once that is done, producing keys for games that we have complete tables for will be quite simple.

Finding keys for games for which we don't have full tables, however, is an entirely different matter. As said above, we are potentially dealing with a 192-bit key here; it's possible that the key is smaller and the bits are reused, however since we don't know how they would be, we have to treat it like a 192-bit one. For a key of that size, obviously brute force is out of the question; and while the XOR tables do provide some information, it's probably not the kind of information that would allow to use the differential cryptanalysis techniques we'd need.
http://mamelife.blogspot.com/
Κάποτε οι μαθητές του είχαν ρωτήσει το Αριστοτέλη για το ποιό είναι το αγριότερο ζώο. Και εκείνος αποκρίθει : Από τα οικόσιτα ο ΚΟΛΑΚΑΣ και από τα ελεύθερα ο ΣΥΚΟΦΑΝΤΗΣ.
Άβαταρ μέλους
grip
Emu Chief
Emu Chief
Δημοσιεύσεις: 2092
Εγγραφή: 21 Νοέμ 2005 21:45
Τοποθεσία: Τρίκαλα

Δημοσίευση από grip »

Οπως ειπε και ο pepinos....O Νικολας μαλλον το εσπασε... :wink:
I've submitted to MAMEDEV the code to replace the 4GB CHDs with 192-bit keys.
The code is here: http://xoomer.alice.it/nicola.salmoria/cps2crpt.zip
It contains all the information needed to understand the algorithm, including the s-boxes.

There is still a lot of uncertainty about the contents of the s-boxes. They do their job, but since they are different from the originals they also affect the key. Using the real s-boxes might make correlations between the key bits more apparent, if they exist (anyway, having only 7 keys to look at, there's not enough data to speculate on any kind of correlation).

I'm hoping that it will be possible to extract the s-boxes contents from photos of the decapped CPS2 chip. That would be an important step forward in the accuracy of the emulation.

Now the next challenge is finding the keys for the other CPS2 games that have XOR files but not full tables. I have some ideas, but it doesn't look simple.
We have a lot of (E,D,k) triplets for those games, but unfortunately not many once you fix k (the 96-bit key used in the second FN), and that would be the most important part.

Note that we don't have to find the whole 192-bit key all at once. Once the second 96-bit was found, then we could easily use brute force to get the 16-bit key seed at every address, and therefore easily find the first 96-bit key.
Aπ οσα καταλαβαινει το μυαλουδακι μου,στην επομενη εκδοση του mame δεν θα υπαρχουν πλεον αυτα τα τερατωδη 20 gb για τα cps2 games,και μαλλον αυτοι που βιαστηκαν να τα κατεβασουν,θα τα προωθησουν προς τον καδο ανακυκλωσης....
Κατι ακουστηκε οτι θα αντικατασταθουν με tables μεγεθους μονο 0.5mb!!!! :shock:
Λετε να το εκανε το θαυμα του ο Νικολακης....? :lol:
Long live the emulator!!!!
[url=http://ubanimator.com][img]http://img288.imageshack.us/img288/2192/userbar517432aj.gif[/img][/url]
Άβαταρ μέλους
Maddog
Master Modelator
Master Modelator
Δημοσιεύσεις: 3768
Εγγραφή: 26 Μάιος 2004 14:44
Τοποθεσία: Κάποιο beach bar στο Ντουμπάι
Επικοινωνία:

Δημοσίευση από Maddog »

Το έκανε!
He's still the god of emulation after all... :D
Παππού όλος ο κόσμος ανησυχεί μήπως η σχέση σου με την πιτσιρίκα αποβεί μοιραία.
-Τι να κάνουμε παιδί μου...αν πεθάνει - πέθανε...
Άβαταρ μέλους
BraiNKilleR
Site Admin
Site Admin
Δημοσιεύσεις: 1106
Εγγραφή: 15 Απρ 2004 02:35
Τοποθεσία: Ελλάδα
Επικοινωνία:

Δημοσίευση από BraiNKilleR »

grip έγραψε:Κατι ακουστηκε οτι θα αντικατασταθουν με tables μεγεθους μονο 0.5mb!!!! :shock:
Στα παιχνίδια που είχαμε τα 8GB/2 tables δεν θα έχει καθόλου extra tables διότι φτάσανε στο μέγεθος που το κλειδί (table) μπορεί απλά να μπεί στο κώδικα γιατί 192bits είναι πολύ απλά 24 bytes και τα έχουν βάλει ήδη στο κώδικα ... Το πρόβλημα είναι με τα παιχνίδια που δεν έχουμε το πλήρες table και οπότε αν δεν βρεθεί τελείως ο αλγόριθμος έστω και για αυτό το κλειδί των 192bits τότε θα πρέπει να ξαναμαζευτούν όλα τα boards για να κάνουν dump το πλήρες table και απο εκεί να βρεθει το κλειδί. Βέβαια υπάρχει και το brute force αλλά ο Nicola φένεται να το απέκλεισε λόγω του χρόνου που θα χρειαστεί για να σπάσει ένα κλειδί τέτοιου μεγέθους. Οσο για τα credits ο Νικόλα τα δίνει στον Andreas Naive.
CPS-2 Encryption

All credit goes to Andreas Naive for breaking the encryption algorithm.
Code by Nicola Salmoria.
BraiNKilleR
http://www.mame.gr
Άβαταρ μέλους
Maddog
Master Modelator
Master Modelator
Δημοσιεύσεις: 3768
Εγγραφή: 26 Μάιος 2004 14:44
Τοποθεσία: Κάποιο beach bar στο Ντουμπάι
Επικοινωνία:

Δημοσίευση από Maddog »

Σωστά, μην ξεχνάμε και τον Andreas Naive! Kudos to him too! :D

Πάντως για το brute force ο Nicola δεν φαίνεται να το αποκλείει στο τελευταίο post του:
Now the next challenge is finding the keys for the other CPS2 games that have XOR files but not full tables. I have some ideas, but it doesn't look simple.
We have a lot of (E,D,k) triplets for those games, but unfortunately not many once you fix k (the 96-bit key used in the second FN), and that would be the most important part.

Note that we don't have to find the whole 192-bit key all at once. Once the second 96-bit was found, then we could easily use brute force to get the 16-bit key seed at every address, and therefore easily find the first 96-bit key.
Θέμα χρόνου πιστεύω είναι για όλα τους...και μετά *ίσως* ανοίξει η όρεξη για το CPS3; :wink:
Παππού όλος ο κόσμος ανησυχεί μήπως η σχέση σου με την πιτσιρίκα αποβεί μοιραία.
-Τι να κάνουμε παιδί μου...αν πεθάνει - πέθανε...
Άβαταρ μέλους
Whacker
Moderator
Moderator
Δημοσιεύσεις: 1608
Εγγραφή: 15 Απρ 2004 22:06
Τοποθεσία: 'δω χάμου
Επικοινωνία:

Δημοσίευση από Whacker »

CPS2, CPS3, chds / decrypted τι σημασία έχει...; Τώρα που βγήκε ο Seagate 400GB στα 140 euros; ΠΟΙΟΣ ΜΑΣ ΠΙΑΝΕΙ!!!! :lol:
αφού σκέπτομαι και για εκείνο το παλιο-tosec-ΡSΡ... :roll:
-Έτοιμο το compile;
-Ναι...
-Σβήσε και ξανάρχισε, βγήκε νέο update!
Άβαταρ μέλους
pepinos
Emulation King
Emulation King
Δημοσιεύσεις: 1228
Εγγραφή: 11 Μάιος 2004 01:48

Δημοσίευση από pepinos »

το system 16 εχει τα παιχνιδια για CPS2, CPS3? η υπαρχει και αλλο link?
Κάποτε οι μαθητές του είχαν ρωτήσει το Αριστοτέλη για το ποιό είναι το αγριότερο ζώο. Και εκείνος αποκρίθει : Από τα οικόσιτα ο ΚΟΛΑΚΑΣ και από τα ελεύθερα ο ΣΥΚΟΦΑΝΤΗΣ.
Άβαταρ μέλους
Maddog
Master Modelator
Master Modelator
Δημοσιεύσεις: 3768
Εγγραφή: 26 Μάιος 2004 14:44
Τοποθεσία: Κάποιο beach bar στο Ντουμπάι
Επικοινωνία:

Δημοσίευση από Maddog »

Παππού όλος ο κόσμος ανησυχεί μήπως η σχέση σου με την πιτσιρίκα αποβεί μοιραία.
-Τι να κάνουμε παιδί μου...αν πεθάνει - πέθανε...
Olorin
Mame Freak
Mame Freak
Δημοσιεύσεις: 325
Εγγραφή: 16 Απρ 2004 02:03
Τοποθεσία: Αθήνα
Επικοινωνία:

Δημοσίευση από Olorin »

Επειδή δεν το έχω παρακολουθήσει από την αρχή το θέμα, οφείλω να ομολογήσω πως έχω μια εντελώς noob-ικη απορία:

Ποιο είναι το (πρακτικό) νόημα όλων αυτών, αφού (σχεδόν) όλα τα παιχνίδια του CPS2 υποστηρίζονται τέλεια εδώ και πάνω από 5-6 χρόνια, τόσο από το ΜΑΜΕ όσο και από άλλους arcade emulators και μάλιστα με ROMs που ζυγίζουν μόλις μερικά ΜΒ??? :roll:

Εντάξει, για το CPS3 να το καταλάβω (αν και αυτό ουσιαστικά έχει μόνο τα 3 SFIII και 1-2 ακόμα παρόμοια beat'em up αν δεν κάνω λάθος...), αλλά στο CPS2 τι ακριβώς έσπασε???

Sorry για το off-topic, προφανώς έχω χάσει επεισόδια και πιθανώς η απάντηση να έχει αναφερθεί αλλού, αλλά ειλικρινά έπιασα τον εαυτό μου να ανοιγοκλείνω τα μάτια μου που δεν καταλάβαινα τον ενθουσιασμό του... "σπασίματος" του CPS2 και νόμιζα ότι είχα ξαφνικά ταξιδέψει στον χρόνο πίσω στο 1997!!! :shock:
[i]Gamer χωρίς παρελθόν, είναι gamer χωρίς μέλλον...[/i]

[img]http://www.zipperfish.com/free/quizimages/nes-award1.jpg[/img]
Άβαταρ μέλους
pepinos
Emulation King
Emulation King
Δημοσιεύσεις: 1228
Εγγραφή: 11 Μάιος 2004 01:48

Δημοσίευση από pepinos »

thanks Maddog

ps:αγοραστε 500ρη σκληρο, διοτι οπως φαινεται τα 250ρια θα ειναι για την πλακα
Κάποτε οι μαθητές του είχαν ρωτήσει το Αριστοτέλη για το ποιό είναι το αγριότερο ζώο. Και εκείνος αποκρίθει : Από τα οικόσιτα ο ΚΟΛΑΚΑΣ και από τα ελεύθερα ο ΣΥΚΟΦΑΝΤΗΣ.
Άβαταρ μέλους
Maddog
Master Modelator
Master Modelator
Δημοσιεύσεις: 3768
Εγγραφή: 26 Μάιος 2004 14:44
Τοποθεσία: Κάποιο beach bar στο Ντουμπάι
Επικοινωνία:

Δημοσίευση από Maddog »

Olorin: Πρακτικά καμμία ιδιαίτερη διαφορά για όσους ενδιαφέρονται μόνο για να παίξουν τα παιχνίδια.
Απλά το hardware είναι πολύ καλύτερα κατανοητό πλέον και έσπασε μια ιδιαίτερα δύσκολη κρυπτογράφηση (κάποτε θεωρούταν αδύνατο να σπάσει πλήρως). Αυτό δίνει ελπίδες ότι και άλλα κρυπτογραφημένα games (CPS3, Gaelco hardware...) μπορεί να σπάσουν μια και αποδεικνύει ότι η "ομάδα" έχει μερικούς από τους καλύτερους decryptors του πλανήτη! Ακόμα, τα XORs ήταν απλώς ένα είδος hack και δεν απεικόνιζαν τον τρόπο με τον οποίο λειτουργεί στην πραγματικότητα το hardware. Χώρια που το "μυστικό" τους το κρατούσε μόνο ο Razoola και το Cps2shock website που ούτε δώσανε ποτέ όλες τις πληροφορίες δημοσίως και βγάλανε και κάμποσα λεφτουδάκια από τις δωρεές κλπ. Τέλος, η πλήρης αποκρυπτογράφηση δίνει ελπίδες στους κατόχους των πραγματικών boards, που ως γνωστόν έχουν suicide battery και είναι εύκολο να καταστραφούν οριστικά αν δεν τις συντηρείς διαρκώς και με ιδιαίτερη προσοχή. Τώρα μάλλον θα μπορούν να κάψουν ένα set με decrypted roms και να ζωντανέψουν ακόμα και τις νεκρές πλακέτες, κάτι μη εφικτό με την μέθοδο των XORs.
Προσωπικά προτιμώ να είναι open source στο MAME για όλους τους παραπάνω λόγους.

Και βέβαια για την αποκατάσταση της "ιστορικής" αλήθειας, το πρώτο CPS2 game έγινε emulated τον Ιανουάριο του 2001 και όχι το 1997. :wink:
Παππού όλος ο κόσμος ανησυχεί μήπως η σχέση σου με την πιτσιρίκα αποβεί μοιραία.
-Τι να κάνουμε παιδί μου...αν πεθάνει - πέθανε...
Απάντηση