Yes.cs
http://svn.code.sf.net/p/vgmtoolbox/code/format/VGMToolbox/format/iso/NintendoWiiUOpticalDisc.cs
What scene releases and Cemu call a
"title key" should actually be a "disc key." It's unique to the disc the title was dumped from, not to the title.
For tickets:
http://www.3dbrew.org/wiki/Ticket (applies to Wii U)
So, you decrypt the title key using the common key and the title ID padded at the end with 0000000000000000 as the IV using AES-CBC.
Then for decrypting .app files, use the decrypted title key and the cIDX padded at the end with 0000000000000000000000000000 as the IV using AES-CBC.
The cIDX is obtained from the TMD; at 0xB04 are the content entries, each 0x30 bytes. The first 4 bytes are the content ID, essentially the filenames of the .app files. The next 2 are cIDX (content index.)