ROM Hack [Release] EditTMD - edit tmd files.

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,721
Trophies
2
XP
8,468
Country
Tuvalu
Here is just a simple python tool that I created. I could have kept it for myself, but I added some nice error checking to make it more friendly.

It can change the version and title id stored in tmd files.

You can do this: python EditTMD.py inputtmd -versionH FFFF
and that will set the title version to the maximum it can be.
You could do the same if you want in decimal: python EditTMD.py inputtmd -versionD 65535
You cannot try to set a new version using both versionH and versionD options, the program will not let you.

You can also set a new title id, like: python EditTMD.py inputtmd -title 0123456789ABCDEF
The title id must be 16 hexadecimal characters long.

You can make the tool apply the values for a whole directory of tmd files. (The tool looks for files that end in 'tmd', and files that end in 'tmd.out') The folder is searched recursively, so it will go into sub folders, and their subfolders, etc etc, looking for tmd files and setting the values you specify.
To do this, instead of giving the tool a path to a file, simply give it a path to a folder.

Code:
usage: edittmd.py [-h] [-title TITLE]
                  [-versionH VERSIONH | -versionD VERSIOND]
                  inputfile
 
positional arguments:
  inputfile          Input a TMD file, or a directory that will be
                      recursively searched for TMD files with filenames ending
                      in 'tmd' and 'tmd.out'
 
optional arguments:
  -h, --help          show this help message and exit
  -title TITLE        Enter a new Title ID, which must be 16 hexadecimal
                      characters long
  -versionH VERSIONH  Enter a new version number in hex. 0 to FFFF/0x0 to
                      0xFFFF
  -versionD VERSIOND  Enter a new version number in decimal. 0 to 65535

Let me know if there are problems, etc.
This is version 1.0, I can maybe update it if needed, like editing more values etc. At the moment I only added what I personally wanted.
 

Attachments

  • EditTMD.zip
    1.3 KB · Views: 672

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,721
Trophies
2
XP
8,468
Country
Tuvalu
-- just for the record, one or two people told me they got some errors using this on some tmds on windows, i tried the tmds they used and it worked perfectly for me on mac. no idea what went wrong...
if you can see something weird in my code etc, let me know!
 

Raugo

Well-Known Member
Member
Joined
Nov 22, 2014
Messages
630
Trophies
0
XP
2,450
Country
Spain
Hi, I am trying to edit a tmd of a system module downloaded with UpdateCDN but does nothing, only showed me "Is this really a (decrypted) tmd file?"

Thank You
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,721
Trophies
2
XP
8,468
Country
Tuvalu
UpdateCDN loads it directly from Nintendo and doesn't decrypt it!

TMD Editor works only for decrypted .tmd.
tmds are decrypted when you get them from CDN.
This is the problem, on my mac it works fine but people said not always on windows. I'll see what I can do.
 

Raugo

Well-Known Member
Member
Joined
Nov 22, 2014
Messages
630
Trophies
0
XP
2,450
Country
Spain
Ok, I tested the application on Linux and it works fine, the problem is that the cia make with this tmd fails when installing with devmenu
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,721
Trophies
2
XP
8,468
Country
Tuvalu
Ok, I tested the application on Linux and it works fine, the problem is that the cia make with this tmd fails when installing with devmenu

everything i have tested from this tool installs fine, the tmd can be edited, it will install (at least using GW), but the signature will not be valid so it will not run without gw's patches


-so, what 3ds fw are you on, are you using gw or the 4.5 cfw, what cia... etc :)
 

Raugo

Well-Known Member
Member
Joined
Nov 22, 2014
Messages
630
Trophies
0
XP
2,450
Country
Spain
I tried in CFW and GW emunand. I tried to install a modified System Modules but when I install this cia with devmenu I get the error 0xD8808040.
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,721
Trophies
2
XP
8,468
Country
Tuvalu
what is the full title id?
sorry, i didn't realize this was about changing the title id, yes... maybe devmenu does not install them. the version can be edited, but i guess because the title id does not match up to the title id in the contents/in the ticket, etc etc, then that is why you are getting problems.
change the title id in every instance of the contents (you will need to decrypt them fully), in the exheader (little endian) - when you rebuild it, provided it is done correctly, i guess it should work. :)
 

Rhapsody

Well-Known Member
Member
Joined
Jan 4, 2016
Messages
252
Trophies
0
Age
27
Location
United States
Website
www.google.com
XP
837
Country
United States
I've decrypted the spider browser with Decrypt9 and ctrtools, and I have the files now, including the TMD file. I'm trying to change the TitleID of this to the TitleID of the skater browser, but EditTMD throws out an error, saying "Is this really a (decrypted) tmd file?".

Is there anything I can do about this?
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,721
Trophies
2
XP
8,468
Country
Tuvalu
I've decrypted the spider browser with Decrypt9 and ctrtools, and I have the files now, including the TMD file. I'm trying to change the TitleID of this to the TitleID of the skater browser, but EditTMD throws out an error, saying "Is this really a (decrypted) tmd file?".

Is there anything I can do about this?
weird, i'm not sure why but there is a lot more to changing the title id that the one in the tmd :(
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,721
Trophies
2
XP
8,468
Country
Tuvalu
If you want to go over it and try to solve this (I'm by no means an expert in anything, though), I'm hanging out in the #3dshacks IRC on Rizon, if you want to chat.
well some people did have some weird errors on windows but i couldn't really debug because on my mac it worked fine
but anyway, what i mean is that fixing this bit for you still would not give you the result you want because the title id is stored in many areas of the contents, at least in the exheader as well :)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • LeoTCK @ LeoTCK:
    SUPPORT LOCAL PRODUCTS, MAKE REVOLUTION
  • LeoTCK @ LeoTCK:
    THEY KEEP REMOVING LOCAL SHIt AND REPLACING WItH INFERIOR CHINESE CRAP
  • LeoTCK @ LeoTCK:
    THATS WHY MY PARTNER CANT GET A GOOTWEAR HIS SIZE ANYMORE
  • LeoTCK @ LeoTCK:
    HE HAS BIG FOOT AND BIG DUCK
  • LeoTCK @ LeoTCK:
    d*ck i mean*
  • LeoTCK @ LeoTCK:
    lol
  • Veho @ Veho:
    Mkay.
  • Veho @ Veho:
    I just ordered another package from China just to spite you.
  • SylverReZ @ SylverReZ:
    Communism lol
  • SylverReZ @ SylverReZ:
    OUR products
  • The Real Jdbye @ The Real Jdbye:
    @LeoTCK actually good quality products are dying out because they can't compete with dropshipped chinese crap
    +2
  • BakerMan @ BakerMan:
    @LeoTCK is your partner the sascrotch or smth?
  • Xdqwerty @ Xdqwerty:
    Good morning
  • Xdqwerty @ Xdqwerty:
    Out of nowhere I got several scars on my forearm and part of my arm and it really itches.
  • AdRoz78 @ AdRoz78:
    Hey, I bought a modchip today and it says "New 2040plus" in the top left corner. Is this a legit chip or was I scammed?
  • Veho @ Veho:
    @AdRoz78 start a thread and post a photo of the chip.
    +2
  • Xdqwerty @ Xdqwerty:
    Yawn
  • S @ salazarcosplay:
    and good morning everyone
    +1
  • K3Nv2 @ K3Nv2:
    @BakerMan, his partner is Luke
  • Sicklyboy @ Sicklyboy:
    Sup nerds
    +1
  • Flame @ Flame:
    oh hi, Sickly
  • K3Nv2 @ K3Nv2:
    Oh hi flame
    K3Nv2 @ K3Nv2: Oh hi flame