SHA1 hash in a TMD

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

Apr 17, 2009

SHA1 hash in a TMD by Scarfish at 8:21 AM (1,047 Views / 0 Likes) 3 replies

  1. Scarfish
    OP

    Member Scarfish GBAtemp Regular

    Joined:
    Jan 5, 2009
    Messages:
    101
    Country:
    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

    Member tueidj I R Expert

    Joined:
    Jan 8, 2009
    Messages:
    2,569
    Country:
    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

    Member Scarfish GBAtemp Regular

    Joined:
    Jan 5, 2009
    Messages:
    101
    Country:
    Netherlands
    Thanks, that clear things up [​IMG]
     
  4. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,745
    Country:
    United Kingdom

Share This Page