PS4 News on Facebook! PS4 News on Twitter! PS4 News on YouTube! PS4 News RSS Feed!

Home PS4 News - Latest PlayStation 4 and PS3 News

March 15, 2013 // 8:50 pm - Following up on the previous updates, today PlayStation 3 developer Flat_z has revealed the Sony PlayStation 2 (PS2) Classics algorithm with details below.

Download: Sony PlayStation 2 (PS2) Classics Algorithm

To quote: Ok, guys. Unfortunately I forced to admit that I have no more time to work on PS3 stuff because I'm very busy lately. So I decided to publish all information related to PS2 classics as JuanNadie did with the NPDRM algorithm one year ago.

Firstly I wanted to say that he was the first who started reverse-engineering on this subject and when he left the scene I decided to continue his work to keep it from going to waste. And so I would like to thank JuanNadie for his amazing contribution to the PS3 scene. Besides that, he gave me some piece of information on the subject.

[Register or Login to view code]

All PS2 classics runs within the ps2_netemu.self which represents a different kernel for execution these PS2 games but before it started the VSH module loads your individual data for PSN/SEN (such as act.dat and .rif file for your game). It is absolutely the same process as used for usual PSN games and the goal of it is getting the key used for decryption of PS2 content which includes an optional CONFIG file, ISO.BIN.EDAT and ISO.BIN.ENC.

The latest one is the actual encrypted disc image of the game. All mentioned files are encrypted with the same key (called klicensee) which is stored in encrypted form inside .rif file for your game and it decrypted with the specified key from key table stored in act.dat. When you get this key you can decrypt ISO.BIN.EDAT and see if it contains a game title (for example, SLUS-20062 for GTA 3). This will mean that key is correct. Since almost all the information regarding EDATs is known (see ps3devwiki.com/wiki/Talk:EDAT_files and ps3devwiki.com/wiki/Talk:NPDRM_Selfs) I will not going to explain it again.

Well, now there are two another formats along with EDAT. Let's call the first one as ENC (it represents the actual disc image) and the second as VME (encrypted virtual memory cards). They are encrypted using different algorithms. The ENC format is similar to EDAT and the VME format have a simple encryption layer.

As I said before, ENC file is similar to EDAT and it have the header like in EDAT (but with different magic) and composed of segments of 16384 bytes each (you can see it at the header). I just remind you that file header consists of file magic (PS2\x00), version number (major and minor: 01.01), license type (it always 0x02), application type (0x01), content id, QA digest (seems like to be a SHA-1 hash of the non-finalized file generated using the tool from SDK), CID-FN hash (an AES CMAC hash of concatenation of content id and file name using the third NPDRM OMAC key as CMAC key), header hash (an AES CMAC hash of the 0x60 bytes from the beginning of file using xored bytes of the first NPDRM OMAC key and the second NPDRM OMAC key as CMAC key), time information which includes start and end time of the validity period (they are usually zeroed, base ticks = 62135596800000000), file flags (always zeros), segment size (16384 bytes), data size of the file data, two unknown hashes of 16 bytes each, 40 bytes of unknown data (possible another unknown signature) and pair of an ECDSA signature (40 bytes using the second VSH curve and the VSH public key).

I also remind you that two unknown hashes for EDAT case are known and represents meta data sections hash and extended header hash (an AES CMAC hash of 160 bytes from the beginning of file), both hashes uses the hash key as CMAC key and it depends on the file flags and keys). I don't know exactly what hashes are there for ENC format but when we zeroed them it seems like they are not checked on current firmwares. The file header ends at the offset of 256 bytes.

Segments are divided into two types: a meta data section and a file data section. Each meta data section can include 512 entries (max) of 32 bytes each (16384 / 32 = 512) and associates with a particular file data section. So if we have a meta data section which consists of 512 entries then it will mean that there are 512 file data sections after it and each file data section have size of 16384 bytes.

Besides that, the first meta data segment located at the offset of 16384 bytes. I don't know what data are stored before it but we also tried to zero them (these bytes starting at the offset of 256 bytes and ending at the offset of 16384 bytes) and it works as usual. I guess that it can be the encrypted garbage because the alignment of file data should be equal to the segment size.

Now I will explain what keys are used and how they are obtained. ENC/VME files are decrypted using the ENCDEC device so the decryption process are more faster than at EDAT case. While vSH checks files for their validity period, CMAC hashes and ECDSA signature and obtains the key for decryption from .rif file and it makes a system call #475 to LV2 (on older firmwares it was #471) along with the NPDRM information, klicensee, act.dat key and encrypted rif key. LV2 gets your console ID, encrypts the NPDRM constant using it as a key, decrypts the key from act.dat using the encrypted NPDRM constant and finally decrypts klicensee from .rif using the decrypted key from act.dat. Now we have a klicensee which will be used for later decryption process.

For EDAT case we can use free EDATs without .rif but for PS2 classics we should always use paid content and .rif file. So if you want to resign the game you need to generate .rif for the account on your console (I call this process as "personalization"). Don't forget that .rif file should be created for your act.dat (because it shares the account id) and console ID. Let's move on. When the PS3 gets the final decryption key it send a packet to the system manager inside LV1 which sets the inter-lpar parameter of type 3.

This parameter contains a version information and the klicensee. A system manager catches this packet and sends a request to the storage manager inside SS server #1 which then configures ENCDEC keys used for later decryption. It should be kept in mind that keys for decryption differs between CEX and DEX consoles so the storage manager checks the device type and uses different key slots for ENCDEC.

The configuration process started with running isolated SPU SB module which creates the final keys using klicensee as a key seed and send them back to the PPU which then send them to the device directly during the secure session. There are three types of keys: meta key, data key and vmc key and they are configured separately. The process of making keys consists of applying an AES 128 algorithm on the klicensee while using three different keys.

There are SHA-1 hashes of each of three keys (you should decrypt sb_iso_spu_module.self from 4.xx FW and find each of 16 bytes key by its SHA-1 hash):

For CEX mode:

[Register or Login to view code]

For DEX mode (you actually don't need it but anyways):

[Register or Login to view code]

Now we have all keys which are required to decrypt all files. So what we should also know?

ENC encryption uses an AES algorithm in CBC mode and the initialization vector of all zeros. The actual process of decryption of CONFIG and ISO.BIN.ENC started at seeking to the offset of 16384 bytes. There is a first meta data section so we should use the meta key as key for AES and decrypt the entire segment of 16384 bytes. As I said before each meta data sections contains of some entries and each entry have a size of 32 bytes. Each entry contains a SHA-1 hash (20 bytes) of the corresponding entire encrypted file data section and all these sections are located after this meta data section. After the SHA-1 hash we can see the section index of the corresponding file data section (4 bytes).

The rest is padded of zeros. After decryption of the meta data section we can decrypt all file data sections after it. Now we should use the data key! Before the actual decryption we can check the SHA-1 hash of each encrypted file data section and see if they matched to the hashes at entry table of the meta data section. If the actual file size of the disc image is not a multiple of 16834 bytes then we have less entries inside the latest meta data section.

After we finished the decryption of first 512 file data sections we can started decryption of the second meta data section and set of 512 file data sections after it and so on. I recommend to write decrypted meta data entries to another file than in the same file as file data section. It will make a process more easier. After decryption you should truncate your actual file to the data size specified at the header. Now you got an UDF disc image and you can mount it on your PC, for example.

So what is the next step? The next step is the decryption of encrypted virtual memory cards. Each PS2 classics package contains two empty encrypted virtual memory cards which located at SCEVMC0.VME and SCEVMC1.VME. As far I see they are identical for all games so we can use templates for all new virtual memory cards but only encrypts them with the new klicensee. To decrypt virtual memory cards you need to read an each segment of 16384 bytes and apply an AES encryption in CBC mode too but for this case you should use the VMC key. After decryption you should see Sony PS2 Memory Card Format 1.2.0.0 at the top of file.

Well, I attached a draft script for decryption of ENC/VME files. It was written for Python 2.7 and requires CryptoPlus (can be downloaded from: http://repo.or.cz/w/python-cryptoplus.git) and "ecdsa" (use EasyInstall or another package manager) libraries. I intentionally left all keys as SHA-1 hashes because of legal issues but you can find all keys by yourself using my hints. My script uses CONFIG/ISO.BIN.ENC/SCEVM0.VME/SCEVM1.VME file and klicensee file as input parameters. I hope that someone will create tools for that.

To use the script you need to create a file with name vsh.curves and put the contents of the curve table from VSH (get it from ps3devwiki.com/wiki/Keys at vsh pub + curvetable) and replace all hashes of keys by their real values (see FIXME comments). Also replace three NPDRM OMAC keys and VSH public key by their values from ps3devwiki.com/wiki/Keys.

I think that creation of PS2 remastering tool can lead us to getting the fully working games on our consoles but it requires testing. I recommend to create a static klicensee which can be used to encrypt all images in the same manner (static klicensee can also be implemented by patching VSH/LV2 at runtime, for example). After generating a klicensee you should create all keys based on it.

To build an encrypted disc image you should dump the original disc image and then append zero bytes to the end to make it multiple of 16384 bytes. Then you need to encrypt each of 512 segments using the generated data key. Then you should calculate SHA-1 hashes of each encrypted segment and generate meta data section for each pair of segment hash and segment index. After this you need to encrypt meta data section and so on. At the end you need to write an original disc image size to the header, write a content id for it and generate hashes at the file header.

After building ISO.BIN.ENC file you should create a file with the title id and pad it with zero bytes from the right side to get 12 bytes total. Then you need to create an EDAT container for this file. Hint: you can see a correct title id when mounting a disc image on your PC and looking at SYSTEM.CNF of it.

Unfortunately, I hadn't time to see what the CONFIG file does so I will skip this step. I only know that this file is optional or can be empty inside (after decryption). You are not required (and you simply can't do it) to generate a valid ECDSA signature for files because all custom firmwares are patched to skip the ECDSA check. Will be nice to be able to generate a game package for your PS2 game too if everything will works fine. Remember, that some flags at PS2 pkg format can be different.

Credits to: graf_chokolo, fail0verflow, JuanNadie, ps3dev.net, glevand and all my friends (you know who you are).

Finally, from zecoxao: i found the meta key and data key for cex, as for the vmc key, no clue where it is, the two are both in my previous post. you can check the sha1 of those in any site or with any program that supports it. somebody may post those on the wiki, if they want.

i'm happy... this is good and concise info time to search for more #poop

meta (CEX) : https://mega.co.nz/#!gpdQxZZB!ZlZpYj8luKmJ5K892wHlTHvQ6khvtfEGxba5OJM3-Y4

[Register or Login to view code]



data (CEX): https://mega.co.nz/#!B09nwJhQ!TMC3kxaNLKFzYVuSksPs-nEE_AgnAgS2RQ1BzeZBlTM

[Register or Login to view code]



From flatz: It is at sb_iso_spu_module.elf too. First two bytes are 64 E3...

VMC key:

[Register or Login to view code]

kudos to this man


Sony PlayStation 2 (PS2) Classics Algorithm Revealed by Flat_z

Sony PlayStation 2 (PS2) Classics Algorithm Revealed by Flat_z

Sony PlayStation 2 (PS2) Classics Algorithm Revealed by Flat_z

Follow us on Twitter, Facebook and drop by the PS3 Hacks and PS3 CFW forums for the latest PlayStation 3 scene and PS4 Hacks & JailBreak updates with PlayStation 4 homebrew PS4 Downloads.



#1267 - misiozol - 5d ago
misiozol's Avatar
I don't think there is as classics need full CFW and ode is just emulating physical bd drive, better/cheaper option would be getting second hand ps2 and using ESR with FMCB, or getting fat model and adding network adaptor + installing hdd

#1266 - sakran - 6d ago
sakran's Avatar
hello guys.. just wanted to ask if there's anyway to play a ps2 classic on a cobra ode?

i downloaded fatal frame 2 ps2 classic and GOD HAND from PSN stuff along with its rap... if i tried to resign edat file within each game like i did with most of my ps1 games that downloaded from psn stuff will it work?

and if not is there anyway to make it work? i have Superslim 4.53 cobra MCU 2.2

i tried the resigning way with all of ps1 games and it worked awesome without any use of fix or crack so hoping for a ps2 too

#1265 - meudayg1 - May 7, 2015 // 11:08 pm
meudayg1's Avatar
Hi All,

I'm new to PS3 and this forum.

I purchased a PS3 CECH-4208A PS3 (12GB) OFW 4.55 and installed Cobra ODE 5.30A. Red LED is glowing when i power on PS3 and I dont see any cobra ode manager in PS3.

I did only hardware install. do i need to do anything from software end?

I formatted pen drive in NTFS format and created folders as per the guide still no good

Please advice.

Thanks

#1264 - teaynadesh - April 27, 2015 // 12:16 pm
teaynadesh's Avatar
Thank you for Multiman Sir.

#1263 - ktgw11 - April 10, 2015 // 7:02 pm
ktgw11's Avatar
thanks for good soft. all the best.

#1262 - djmakis - March 27, 2015 // 1:58 pm
djmakis's Avatar
thanks for the files, also from MixeryMaxe comes S-DMC, a Selfmade DMC for Cobra ODE users with details below:

Hallo comm

I would like to present an user project from two friends (GamersRS & esprit1711 from psXtools) and me. Around october 2014, a friend asked about the possibility of a microcontroller based project. And i just said "of course" Chipwelt from psXtools had built a "switchmod" as alternative methode to the DMC and GamersRS asked me about a "microcontroller based switchmod".

So the idea from the S-DMC was born

I had built a microcontroller (PIC16F628A) based circuit and had written a software in asm. The prototype looks ugly but it works


And here esprit1711 comes into play. He designed a real "eye candy" PCB and then the big tests began.


After finishing the big tests esprit1711 had kills few bugs on the PCB and i made an optimization the software for the PIC.
The final version was finished.









The S-DMC is for Slim models. The installation is simple, there are just 4 wires to soldering (+ 2 optionale, 1 LED for swap-magic signaling) and one little cut one the power PCB of the PS3. The S-DMC simulate the switch positions from bd-drive so you are able to swap the disc and the PS3 don't get it

Despite of the cuts on the power PCB i was able to preserve the original PS3 eject function. Function of the S-DMC are:

  • 1 click on eject button = normal official disc eject
  • hold eject button(~10sec) = normal official bd-drive reset
  • double-click on eject button = swap-magic for cobra ode

The official release was in early 2015 and until today there are no problems.
The end product works like a charm

More information:

  • First present thread: psxtools.de/index.php/Thread/65463-S-DMC-by-psXtools-f%C3%BCr-CobraODE-UPDATE-02-04-2015/
  • Official support thread: psxtools.de/index.php/Thread/66781-SUPPORT-S-DMC-f%C3%BCr-Slim-PS3s-excl-bei-psXtools-de/
  • Installation instructions: psxtools.de/index.php/Thread/67969-Tutorial-offizielle-Anleitung-f%C3%BCr-S-DMC-by-psXtools-de/

Credits goes to:

  • Chipwelt
  • GamersRS
  • esprit1711

Have fun

Update: Hi, today i received new information from Chipwelt. Ok as i said, i don't have a ODE and i don't use the S-DMC.

It can also be used without ODE to swap psx (and *ps2) backups even on OFW.
e.g. insert an original psx game in the ps3 and wait until the disc icon is appear in xmb, than double-click on eject button (for swap-trick) and now you can insert any psx backup and play again, EVEN on OFW .... crazy that i didn't know that.

*ps2 backups of course only on bc models. But in the same way as with psx games. Ok, at this time the S-DMC is only for slim models but this can be changed if there is a demand

Chipwelt released a video in november 2008 with a switch-mod and show a ps2 swap on a cecha model



#1261 - ori0 - March 24, 2015 // 3:42 am
ori0's Avatar
Thanks for keeping the PS3 going strong!

#1260 - gurpreetbal - March 15, 2015 // 9:45 am
gurpreetbal's Avatar
thanks for uploading

#1259 - PS4 News - March 7, 2015 // 1:41 am
PS4 News's Avatar
7 - 3 - 2015 Cobra ODE News - Update

We are pleased to present the Cobra ODE FW 2.4 wich properly adds support for the Emu USB QSB and addresses a number of small bugs we found in particular with the drive door support for 4k consoles. We have updated the DMC triggering mechanism for enhanced performance.

The game database file has also been updated to include many new titles.

We are unable to fully support FAT PATA consoles with DMC owing to issue with BD recordable media compatibility and a multitude of different bluray drive daughterboards. FAT SATA consoles with BMD-31 will remain supported. If you have purchased DMC for PATA FAT consoles, you may return it to your reseller for a refund.

DMC will be kept fully supported on FAT SATA (BMD-31), 2k/2k1, 2k5 and 3k consoles.






Since we have removed the Hardware Passthrough mode from ODE FW 2.4, we suggest that users use ODE FW 2.2, if they wish to update the OFW of their console to 4.66. ODE FW 2.2, still has the option to enable HW Passthrough mode providing you are using the USB Clip on PCB. After updating the console OFW to 4.66 you can update to ODE fw 2.4 again.

Finally, from coalchamber1022: (DMC + OS 4.7 + CECH-2001A)

Hi Guys, Formalities...

PS3 Type: CECH-2001A
PS3 OS: v4.7
ODE: v4.2
ODE FW: 2.4
DMC: v1.0
Boot Disc: ModNation Racers (BCAS20105)
Swap Disc: Verbatim 25 GB 6x SL (LINK)
SD Burner: Generic from Amazon (LINK)

CFG File:

[Register or Login to view code]

I got things hooked up, loading a game is still a bit of a PIA but it works.

  • After plugging in my HDD with my games on it I plug my PS3 into power then boot it up.
  • I then put in by Boot disc I see the cobra menu and select a game.
  • I then get a what looks to be a video of just the cobra icon at that time I eject my boot disc then just put the boot disc back in. It then loads up the game selected in the XMB
  • I then hit 'x' to start the game the bootdisc then pops out then the ode flashes red/blue so i leave the boot disc and let it suck back in.
  • Then in a few seconds it ejects again then ODE flashes green/blue I then pop in swap and BADABOOM it loads up.




With that many ejects and loads I am anticipating my BD drive to crap out soon. Hopefully cobra team can lower the number of ejects but in any case it works!!

#1258 - Suprising - February 18, 2015 // 11:02 am
Suprising's Avatar
I just upgraded my old Cobra to a newer updateable version today!

On 4.66 it seems Sony are catching and winning the race with ODE's. Anyway, I do have a swap disk which means I am sorted for now...

26 - 2 - 2015 - Cobra ODE News - Information

All Cobra ODE users should avoid updating to OFW 4.70 until Cobra Team has carried out extensive testing.

Some videos on 4.70: