|
|
#81 | ||
|
Member
![]() Join Date: Dec 2008
Posts: 30
Likes: 0
Liked 8 Times in 6 Posts
Mentioned: 3 Post(s)
Tagged: 0 Thread(s)
|
I've tried both with decrypted klicensee (obtained using SELF algo), and with the dev_klic extracted bruteforcing the eboot ![]() Is the CMAC algo you mentioned the same used for this?
Last edited by jester; 12-11-2011 at 11:25 AM. |
||
|
|
|
|
|
#82 |
|
Member
![]() Join Date: Oct 2011
Posts: 83
Likes: 31
Liked 50 Times in 9 Posts
Mentioned: 15 Post(s)
Tagged: 0 Thread(s)
|
We have decrypt edat, trying to re-encrypt it for free. What to do with 0x90-0xAF ?
Last edited by Octopus; 12-11-2011 at 02:54 PM. |
|
|
|
|
|
#83 |
|
Homebrew Developer
![]() Join Date: Oct 2011
Posts: 20
Likes: 11
Liked 368 Times in 19 Posts
Mentioned: 68 Post(s)
Tagged: 0 Thread(s)
|
First of all, here is an implementation of the algorithm. It is not fully tested (for example with ISO.BIN.EDAT it validates but fails when decrypting) and is missing the decompression algorithm (I tried deflate but is does not work if someone identifies the algorithm please post it. Blocks start with 0x05). Also keys have been eliminated. On previous port you have the SHA1.
http://pastebin.com/SuAukd8B About compression: Instead of having metadatasections of 0x10 byes the new section is 0x20 bytes long. Code:
struct compressMetadataSection {
uint8_t hash[0x10];
uint64_t fileOffset;
uint32_t len;
uint32_t isEndOfCompression;
}
@jester You probably forgot to decrypt the key. The result of syscall471 must be decrypted using EDATKEY and RIVKEY. @Octopus to make free files. - Create a memory image of the file. - Decrypt the data, so you have a memory copy of the file decrypted (for compressed no need to decompress) - Modify NPD to make if free (0x03 instead of 0x02). Recalculate hashes using devlikc (that why we need it). - Recrypt each block using the devklic as base to calculate blocks keys (wich will then be transformed again as does the appldr for that type). - Once recrypted, recalculate the hashes of the sections so they matched the new value for the encrypted data. -If compressed recalculate the offset and len on the metadatasection -Using the new metadatasection recalculate data 0x90-0x9F. -Using the new NPD header + new metadatasectionHash calculate hash and place it at 0xA0-0xAF. -Write file to disk (Remember, that file is function of filename, you must overwrite (not recommend while testing) or remember to rename it properly). Done |
|
|
|
|
Likes: (12) |
|
|
#84 |
|
Senior Member
![]() Join Date: Sep 2010
Location: /dev/random
Posts: 1,687
Likes: 425
Liked 271 Times in 171 Posts
Mentioned: 14 Post(s)
Tagged: 0 Thread(s)
|
Finally a good thread on here, most of what is said is history, but it’s a nice reminder to the functions and their sources.
__________________
US 4USB ports OFW 3.15 PS Ubuntu
EU 4USB ports CFW 4.21.1 REX There is only one OS; AmigaOS, the rest are just [l]imitations. |
|
|
|
|
|
#85 |
|
Apprentice
![]() Join Date: Oct 2011
Posts: 14
Likes: 1
Liked 2 Times in 2 Posts
Mentioned: 22 Post(s)
Tagged: 0 Thread(s)
|
Thanks a lot for new info.
So we finally can re-encrypt local licensed edats to free license (except compressed ones). Have you any progress on sdat? Last edited by EXE.trim.ALL; 12-12-2011 at 02:35 PM. |
|
|
|
|
|
#88 |
|
Homebrew Developer
![]() |
jaun, was wondering if there was an easier way to contact you?
|
|
|
|
|
|
#89 |
|
Homebrew Developer
![]() Join Date: Oct 2011
Posts: 20
Likes: 11
Liked 368 Times in 19 Posts
Mentioned: 68 Post(s)
Tagged: 0 Thread(s)
|
The code I posted already implements SDAT. You just need the SDATKEY.
The SHA1 is ED2A015EEB1BD0CE06D0447F1A22AF4C1C401E4A However you won't find it by bruteforce as it is coded as a series of inmediate values. If you check routine sub_5529C at graf_chokolo's dump_lv2 you'll see the routine that checks the edat/sdat header. Few lines below at address 5543C you'll see those inmediate values that are xored with the hash of the NPD to create the fake rifkey (the first 0x100 bytes of the npd are loaded starting at sp + 0x110) About compression: We don´t know the algorithm but if we decrypt the data and modify the NPD so it looks like a debug you can use make_edata_npdrm to decompress it |
|
|
|
|
Likes: (13) |
|
|
#90 | |
|
Member
![]() Join Date: Nov 2011
Posts: 66
Likes: 16
Liked 28 Times in 16 Posts
Mentioned: 8 Post(s)
Tagged: 0 Thread(s)
|
__________________
![]() |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|