UtikReader

Discussion in 'Wii U - Hacking & Backup Loaders' started by BigPanda, Nov 17, 2016.

  1. BigPanda
    OP

    BigPanda Advanced Member

    Newcomer
    93
    47
    Jul 18, 2016
    Belgium
    Hello everyone, I just wrote a small application that extract important information from a WiiU tik file.

    Enjoy if you were looking to export your Title Key from eshop tickets.

    UtikReader (2016-11-16)
    --------------------------------

    Small application to read the Title ID, Title Key and Console ID from a WiiU tik file.
    This tool does not check if the opened tik is valid. It only return value from specific offset of the file.

    If the Console ID line is not filled with zeroes, it's means that the ticket include your console identifier.
     

    Attached Files:

    Last edited by BigPanda, Nov 17, 2016
    zeldaism, DaBlackDeath, iAqua and 6 others like this.
  2. Irastris

    Irastris Just another fag with a suggestive avatar

    Member
    1,005
    570
    May 3, 2015
    United States
    -snip-

    Lovely program!
     
  3. BigPanda
    OP

    BigPanda Advanced Member

    Newcomer
    93
    47
    Jul 18, 2016
    Belgium
    After additional analysis, this will only work for the first ticket inside the .tik

    It seems that it happens that the WiiU put multiple tiks inside a singe file. This is not always the case but it happens.

    I will probably just rewrite the application to scan all files inside a folder/subfolders and store the information in a single txt file.

    That version can be useful however.
     
  4. shin-gori

    shin-gori Member

    Newcomer
    18
    1
    Oct 7, 2008
    Cote d'Ivoire
    Works for virtual console .tik??
     
  5. Antonio Ricardo

    Antonio Ricardo GBAtemp Fan

    Member
    359
    230
    Apr 29, 2013
    Brazil
    Rio de Janeiro
    With this i can know what game is it?
     
  6. Irastris

    Irastris Just another fag with a suggestive avatar

    Member
    1,005
    570
    May 3, 2015
    United States
    Sort of. It will show you the title ID which you can then search on the WiiUBrew title ID database.
     
    Antonio Ricardo likes this.
  7. oji

    oji GBAtemp Regular

    Member
    274
    62
    Sep 1, 2012
    Russia
    In Soviet Russia you're the Location
    Check out my PoSh script, which is able to parse a multi-ticket files. Feel free to reuse it's algorithm in your project.

    Code:
    $atom = 694
    
    function Export-WiiUTik ($data, $start) {
    ($start + 476)..($start + 483) | % {$title+= "{0:X2} " -f $data[$_]}
    $title = ([string]$title -replace " ", "").ToLower()
    ($start + 447)..($start + 462) | % {$key+= "{0:X2} " -f $data[$_]}
    $key = ([string]$key -replace " ", "").ToLower()
    return $title + " " + $key
    }
    
    
    function Parse-WiiUTik ($path) {
    $file = get-content $path -Encoding Byte
    $cnt = 0
    $sw = 0
    do {
    switch ($sw) {
    0 {if ($file[$cnt] -eq 0) {$sw = $sw -bor 1}}
    1 {if ($file[$cnt] -eq 1) {$sw = $sw -bor 2} else {$sw = 0}}
    3 {if ($file[$cnt] -eq 0) {$sw = $sw -bor 4} else {$sw = 0}}
    7 {if ($file[$cnt] -eq 4) {Export-WiiUTik $file ($cnt - 3); $cnt += $atom - 4; $sw = 0} else {$sw = 0}}
    }
    $cnt++
    } while ($file.count -gt ($cnt + $atom - 4))
    }
    
    Get-ChildItem *.tik -recurse | % {Parse-WiiUTik $_.fullname}
     
    BigPanda likes this.
  8. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    18,710
    9,009
    Oct 27, 2002
    France
    Engine room, learning
    I didn't know a tik could have multiple ticket info.
    Which game uses this format, and why?
     
  9. DaBlackDeath

    DaBlackDeath .::[ lone wolf ]::.

    Member
    326
    310
    Dec 22, 2007
    Germany
    I have also made some "fun project" like this, but I guess it's not the right place to share it because this thread is for OP's tool.
    Maybe a hint for OP, what he could add (check preview) :)
    preview
     
    Last edited by DaBlackDeath, Nov 17, 2016
    BigPanda likes this.
  10. oji

    oji GBAtemp Regular

    Member
    274
    62
    Sep 1, 2012
    Russia
    In Soviet Russia you're the Location
    Some tik files have a merged tickets, but I don't know what a reason make it happens. For example, there's the tik in my system which is contained a Sega All-star Racing update, a Tokyo Mirage Session DLC & an eShop title, all are in the one file.
     
  11. Irastris

    Irastris Just another fag with a suggestive avatar

    Member
    1,005
    570
    May 3, 2015
    United States
    You need to take that picture down, or change it out with a censored one.

    It's not allowed to show title keys on this forum.
     
    DaBlackDeath likes this.
  12. BigPanda
    OP

    BigPanda Advanced Member

    Newcomer
    93
    47
    Jul 18, 2016
    Belgium
    Yes, I wanted to extract my tickets so I could have a backup copies of the installable titles locally. However, I was missing many many Virtual Console titles when I was looking with my application. At some point, I digged and saw that some tickets are 1kb and some are 2kb.

    The 2kb ones are merged and includes more than one. Don't know how many tickets can be merged on the same file however.
     
    Last edited by BigPanda, Nov 17, 2016
    oji likes this.
  13. nexusmtz

    nexusmtz GBAtemp Maniac

    Member
    1,273
    441
    Feb 17, 2016
    United States
    The ticket directory looks like a hash table, possibly to cut down on the number of files. If that's the case, any identifier that hashes to the same value would end up in the same file. The identifier is probably just the title ID.

    We'll have to do some comparisons to confirm that a given title will end up in the same tik on everyone's consoles, but I'd suspect that to be the case. With enough tickets, it may be obvious what the algorithm is.
     
    Cyan likes this.
  14. AboodXD

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,705
    1,429
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    There's a thread full of title keys...

    IIRC one ticket is 0x02A3 bytes long, that means taking the length of a tik file and dividing it on 0x02A3 should determine how many tickets are in a single tik file.

    I'm still not sure.
     
  15. Irastris

    Irastris Just another fag with a suggestive avatar

    Member
    1,005
    570
    May 3, 2015
    United States
    Uh, no there isn't? If anything, there's a thread full of title IDs. The only thread on here that ever attempted to share title keys got shut down within one post.
     
  16. AboodXD

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,705
    1,429
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    It was a thread with a list of WUDs (not download links) and title keys...

    I can't remember the name of the thread, hopefully someone still remembers... :P
     
  17. Irastris

    Irastris Just another fag with a suggestive avatar

    Member
    1,005
    570
    May 3, 2015
    United States
    Well, it's long gone now then.
     
  18. AboodXD

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,705
    1,429
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    I don't know, I remember seeing it not too long ago.

    Maybe a newbie mod deleted because he didn't like?

    But seriously, IIRC that thread was on GBATemp for more than a year.
     
  19. JohnathanMonkey

    JohnathanMonkey GBAtemp Advanced Fan

    Member
    583
    186
    Apr 26, 2013
    United States
    Yea I got a lot of title keys from there back in the day when I used Uwizard. There was an excel document too.
     
  20. AboodXD

    AboodXD I hack NSMB games, and other shiz.

    Member
    2,705
    1,429
    Oct 11, 2014
    United Arab Emirates
    Not under a rock.
    I still have a link to that document.