SHA1 hash in a TMD

Discussion in 'Wii - Hacking' started by Scarfish, Apr 17, 2009.

  1. Scarfish
    OP

    Scarfish GBAtemp Regular

    Member
    101
    0
    Jan 5, 2009
    Netherlands
    At the moment I'm playing around a bit with title downloads and for an overview of a tmd file I use this page on WiiBrew TMD.
    Here it states that the content int the tmd exists of an ID, an Index, a Type, a Size and a SHA-1 Hash. The problem is that when I compute the SHA-1 hash of the downloaded content it doesn't match with the Hash that was in the content of the tmd file.

    Anybody knows exactly where the SHA-1 hash of the content in the tmd file comes from? It doesn't look like its the hash of the downloaded content or could it be the way I get the hash of the downloaded file? I use the SHA1 class from .Net:

    CODEbyte[] content = ;
    byte[] originalHash = ;

    SHA1 sha1Instance = SHA1.Create();
    byte[] hash = sha1Instance.ComputeHash(content)

    return hash == originalHash;
     
  2. tueidj

    tueidj I R Expert

    Member
    2,569
    820
    Jan 8, 2009
    It's the SHA1 hash of the decrypted content. You need to get the title key by decrypting the key in the ticket (using the common key and the title ID as the IV) then use that to decrypt the content (use the index as the IV).
     
  3. Scarfish
    OP

    Scarfish GBAtemp Regular

    Member
    101
    0
    Jan 5, 2009
    Netherlands
    Thanks, that clear things up [​IMG]
     
  4. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,716
    9,587
    Nov 21, 2005
    United Kingdom