How to get Title ID from a CIA

Discussion in '3DS - Homebrew Development and Emulators' started by DD2XAlpha, Feb 8, 2019.

  1. DD2XAlpha
    OP

    DD2XAlpha Member

    Newcomer
    2
    Apr 26, 2016
    Mexico
    Hello, I am the creator of PC FBI Server and I am looking a wat to extract the ID of a CIA because I want to try something new, but I don't know how to get it, currrently if there is a solution based on C# or Python 3 please let me know. Thanks

    Also if possible I want to know the game ID of a CIA (something like in Wii like [RSPE01])
     
    Last edited by DD2XAlpha, Feb 8, 2019
  2. PokeNev

    PokeNev GBAtemp Regular

    Member
    3
    Nov 11, 2018
    United States
    Maybe get into programming a bit and then experiment I know you want the easy way out, but sometimes you have to do it yourself
     
    DD2XAlpha likes this.
  3. AmandaRose

    AmandaRose Do what I do. Hold tight and pretend it’s a plan

    Member
    15
    Aug 19, 2015
    United Kingdom
    Glasgow
    Copy the cia to your 3ds sd card. Insert it into 3ds and switch on. Goto fbi then select sd. Find your cia and the title ID will be displayed on screen.
     
    DD2XAlpha likes this.
  4. ThoD

    ThoD GBATemp Addict (apparently), but more like "bored"

    Member
    11
    Sep 8, 2017
    Greece
    If you simply are talking about the ID as an identifier for games and stuff, you should have just gone with Google or looked around the forum, not hard to find an answer. For games use this http://www.3dsdb.com/ and for homebrews/custom CIAs (eg: Forwarders) do what Amanda suggested above, simple.
     
    DD2XAlpha and AmandaRose like this.
  5. 8BitWonder

    8BitWonder Small Homebrew Dev

    Member
    11
    Jan 23, 2016
    United States
    47 4F 54 20 45 45 4D
    Folks I think they're wanting to know how to directly extract the TID from a .CIA for an application, not just look it up and hard code it.

    Information on 3DBrew outlines the location of the title ID and other .CIA content if you're interested:
    https://www.3dbrew.org/wiki/CIA

    Should be as easy as writing a script to look at those locations and grabbing the TID.
     
    Last edited by 8BitWonder, Feb 9, 2019
    DD2XAlpha likes this.
  6. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    16
    Apr 20, 2015
    United States
    Usually the ticket is at 0x2A40, so you could probably get away with hardcoding the offset (in practice, the contents before it don't change in size). The Title ID is stored at 0x9C relative to the ticket, so the Title ID is at 0x2ADC relative to the CIA header. https://www.3dbrew.org/wiki/Ticket

    Or you can use the CIA header to get the offset of the ticket, then read the Title ID from it. Or use the Title Metadata, but both should be identical. Remember that offsets are aligned in 64-byte (0x40) blocks. https://www.3dbrew.org/wiki/CIA

    The "Game ID"/Product Code is stored in the NCCH at 0x150, in the first content of most CIAs. Most game CIAs are encrypted, so don't bother unless you plan on including decryption code. https://www.3dbrew.org/wiki/NCCH#NCCH_Header
     
    DD2XAlpha likes this.
  7. DD2XAlpha
    OP

    DD2XAlpha Member

    Newcomer
    2
    Apr 26, 2016
    Mexico
    Thanks everyone, I got it running a Python 2 Script that I translated to Python 3. The thing was to be able to get the TMD or ID to compare it on a XML Database saved ina folder, but everything from the computer, so when you select a CIA file it will recognize what game you selected and show it's titleID, name and region.

    I used the next script (Python 3)

    Warning: Spoilers inside!

    This will be used for the new version of PC FBI Server that may be ready in a week or so.

    Also the code is open source so it will be avaliable when I finish PC FBI Server update
     
    Last edited by DD2XAlpha, Feb 10, 2019
  8. Badda

    Badda GBAtemp Regular

    Member
    5
    Feb 26, 2016
    Tokelau
    Nirvana
    Sorry to wake up this old thread, but is there a way to find out my own TID from within the homebrew program? I was going through the Application Manager Service interface already, but cannot find anything suitable.
    AM_GetCiaFileInfo() gets me the TID only if I have the .cia file. And AM_GetTitleList() gets me the list of all installed titles on the medium but how am I to find out which one is me?
    Any help is appreciated!
     
Quick Reply
Draft saved Draft deleted
Loading...