ROM Hack Can you make a ROM hack load automatically?

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,728
Trophies
2
XP
8,533
Country
Tuvalu
mac comes with python, you don't even need the xcode command line tools i think :) but yeah i don't know what's going wrong on your end sorry.


and, it would be neatest to base your patch on the 1.1 update, or include that in your own update files. then you can play online etc.
 

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
you could try installing it with brew. what syntax errors do you get? my script uses 3.5.
Oh wait, it actually worked with 3.5 but I'm getting a 404 error:

./cdndownload.py 0004000e00030700
- downloading cetk
Traceback (most recent call last):
File "./cdndownload.py", line 140, in <module>
ticket = download(base + "/cetk")
File "./cdndownload.py", line 94, in download
cn = urlopen(url)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 162, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 471, in open
response = meth(req, response)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 581, in http_response
'http', request, response, code, msg, hdrs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 509, in error
return self._call_chain(*args)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 443, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 589, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

I'm guessing the title ID isn't right as if I enter random shit as the title ID I get the same error. Interestingly, if I capitalise the letters in the title ID I get:

! missing titlekey
cdndownload.py <titleid> [titlekey]
- titlekey is only used for non-system titles
But I have no idea what the title key is.
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,838
Country
United States
Oh wait, it actually worked with 3.5 but I'm getting a 404 error:

./cdndownload.py 0004000e00030700
- downloading cetk
Traceback (most recent call last):
File "./cdndownload.py", line 140, in <module>
ticket = download(base + "/cetk")
File "./cdndownload.py", line 94, in download
cn = urlopen(url)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 162, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 471, in open
response = meth(req, response)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 581, in http_response
'http', request, response, code, msg, hdrs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 509, in error
return self._call_chain(*args)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 443, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 589, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

I'm guessing the title ID isn't right as if I enter random shit as the title ID I get the same error. Interestingly, if I capitalise the letters in the title ID I get:


But I have no idea what the title key is.
look on Google "3ds titlekey". you will find a site that has tons of them. find the one for that title ID and use the encrypted one.
 
Last edited by ihaveahax,

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
look on Google "3ds titlekey". you will find a site that has tons of them. find the one for that title ID and use the encrypted one.
Ahh! Got it. Thanks. I've downloaded the CIA for the update now. Now I'll decrypt/extract it, make the changes, and re-pack it. I assume after that I just install using FBI?
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,838
Country
United States
Ahh! Got it. Thanks. I've downloaded the CIA for the update now. Now I'll decrypt/extract it, make the changes, and re-pack it. I assume after that I just install using FBI?
yes that should work.

--------------------- MERGED ---------------------------

@mashers I updated the script to fix the issue with casing of the title ID, if you want to get that (0004000E == 0004000e, etc)
 

gamesquest1

Nabnut
Former Staff
Joined
Sep 23, 2013
Messages
15,153
Trophies
2
XP
12,247
not sure if it's already been mentioned, but the title update titleID would be 0004000E*rest of titleID*

so for EU MK7 it would be 0004000E00030700 if you forget about the E you will end up with the full game
 

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
Ok, progress! I've decrypted the CIA and extracted the certs, contents, ticket and tmd. I didn't get the meta because I've got the version of ctrtool which is bugged and gets the contents instead. Do I need it? If so, I'll compile ctrtool myself.

Then, I extracted the exefs, romfs, and exheader from the contents and saved the first 512 bytes of the contents file as the ncchheader (was that the right file to get it from?)

Assuming I've got everything right so far, I'll make the changes in the romfs folder and then get to work rebuilding it.

@gamesquest1
Yes, I'm using the title ID with the E which was 5.5MB, so definitely an update not the full game :)
 
  • Like
Reactions: gamesquest1

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,838
Country
United States
Ok, progress! I've decrypted the CIA and extracted the certs, contents, ticket and tmd. I didn't get the meta because I've got the version of ctrtool which is bugged and gets the contents instead. Do I need it? If so, I'll compile ctrtool myself.
nothing but contents actually matters in this case (or most cases really).
Then, I extracted the exefs, romfs, and exheader from the contents and saved the first 512 bytes of the contents file as the ncchheader (was that the right file to get it from?)
if it says "NCCH" at offset 0x100 then it's fine.
 

DarkSynopsis

Well-Known Member
Member
Joined
Oct 15, 2014
Messages
483
Trophies
0
Age
33
Location
New Zealand
Website
ninjasfate.com
XP
2,604
Country
New Zealand
Can't say I've seen many "custom" updates, I think I read about people doing it with Pokemon Hacks? that was about it, never heard about the Monster Hunter one and only recently dabbled with it myself when rebuilding an update for the latest Taiko game since they decided to overwrite some base files.

Anyway... I've found 3DSTool more useful when it comes to dealing with NCCH Headers and such so if you don't have much luck with CTRTool I would suggest giving that a shot.

Would be nice if Luma managed to have a feature like the layeredFS of NTR CFW, use it so much when messing with game files, pain to start each boot though :P
 
  • Like
Reactions: ihaveahax

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,838
Country
United States
Can't say I've seen many "custom" updates, I think I read about people doing it with Pokemon Hacks? that was about it, never heard about the Monster Hunter one and only recently dabbled with it myself when rebuilding an update for the latest Taiko game since they decided to overwrite some base files.

Anyway... I've found 3DSTool more useful when it comes to dealing with NCCH Headers and such so if you don't have much luck with CTRTool I would suggest giving that a shot.

Would be nice if Luma managed to have a feature like the layeredFS of NTR CFW, use it so much when messing with game files, pain to start each boot though :P
3dstool and ctrtool are good when used together, but they don't do everything the same (3dstool doesn't deal with CIAs but can deal with the contents, ctrtool doesn't extract some headers)
 

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
nothing but contents actually matters in this case (or most cases really).
Ahh ok, saves me a job ;)

if it says "NCCH" at offset 0x100 then it's fine.
Great! It does :) Ok, I've put the changed files in the appropriate folders in the 'Patch' directory within the romfs directory. I'm about to encrypt the NCCH header and then try to repack the CIA. I suppose I should back up my sysNAND as well just in case I brick it :P
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,838
Country
United States
Great! It does :) Ok, I've put the changed files in the appropriate folders in the 'Patch' directory within the romfs directory. I'm about to encrypt the NCCH header and then try to repack the CIA. I suppose I should back up my sysNAND as well just in case I brick it :P
encrypting doesn't matter for this, you can rebuild and install as-is (decrypted). encrypting only matters if you're installing to NAND, which game updates don't. (also you would do the encryption after rebuilding the CIA)
 

night_hawk

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
573
Trophies
0
XP
1,586
Country
Italy
I did custom updates to bundle them with hack roms, for example Pokémon hacks like star sapphire or rutile ruby. There is a thead and a guide by asia81 with a handy tool that will let you extract and rebuild the update
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,838
Country
United States
I did custom updates to bundle them with hack roms, for example Pokémon hacks like star sapphire or rutile ruby. There is a thead and a guide by asia81 with a handy tool that will let you extract and rebuild the update
this tool only works on windows as far as I know, while doing everything yourself (using ctrtool/makerom/3dstool etc) works on other OSes too. it's also Pokémon-oriented I thought, this is Mario Kart 7.
 

night_hawk

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
573
Trophies
0
XP
1,586
Country
Italy
this tool only works on windows as far as I know, while doing everything yourself (using ctrtool/makerom/3dstool etc) works on other OSes too. it's also Pokémon-oriented I thought, this is Mario Kart 7.
The "Pokémon oriented" is just when it explains how to merge hacked files in cirrect structure, otherwise it applies for all games, extract and rebuild in a click. But yes if you dont have windows do it manually
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,838
Country
United States
The "Pokémon oriented" is just when it explains how to merge hacked files in cirrect structure, otherwise it applies for all games, extract and rebuild in a click. But yes if you dont have windows do it manually
generally I would recommend doing everything for this via terminal/cmd because you would learn how it works, and be easier to figure out why something went wrong. also I think their toolkits use outdated binaries of things like ctrtool.
 

night_hawk

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
573
Trophies
0
XP
1,586
Country
Italy
generally I would recommend doing everything for this via terminal/cmd because you would learn how it works, and be easier to figure out why something went wrong. also I think their toolkits use outdated binaries of things like ctrtool.
Sure it is, but if anyone reading this wish to have an easy way, well i think it's worth to mention it. As for ctrtool not sure, the pack was updated the last month i think, not sure really
 

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
encrypting doesn't matter for this, you can rebuild and install as-is (decrypted). encrypting only matters if you're installing to NAND, which game updates don't. (also you would do the encryption after rebuilding the CIA)
Ahh ok, thanks. I'm trying to rebuilt the CIA and I'm getting this error with 3dstool:

./3dstool -cvtf exefs exefs.bin --exefs-dir exefs/ --header exheader.bin

load: exheader.bin
load: exefs//code.bin
INFO: unknown entry name $
ERROR: open file exefs//$.bin failed

INFO: unknown entry name 4
ERROR: open file exefs//4.bin failed

INFO: unknown entry name &
ERROR: open file exefs//&.bin failed

INFO: unknown entry name
ERROR: open file exefs//.bin failed

ERROR: create file failed

Any ideas what this means? I have the exefs directory with code.bin, icon.bin, logo.bin and also exheader.bin in the same directory as the 3dstool binary...
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,838
Country
United States
Ahh ok, thanks. I'm trying to rebuilt the CIA and I'm getting this error with 3dstool:



Any ideas what this means? I have the exefs directory with code.bin, icon.bin, logo.bin and also exheader.bin in the same directory as the 3dstool binary...
exheader ("extended header") is not the same as exefsheader.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    The Real Jdbye @ The Real Jdbye: ballcock