ROM Hack Had anyone tried to extract the limited release Fire Emblem: Shadow Dragon & the Blade of Light NSP?

iRonOfficial

New Member
OP
Newbie
Joined
Feb 2, 2021
Messages
3
Trophies
0
XP
55
Country
Philippines
Hi! I had a few experience extracting contents of the Switch games that I owned. But just recently, I bought Fire Emblem: Shadow Dragon and the Blade of Light (for those who don't know, it was the first Fire Emblem game on the Famicom except it was English localized).

But anyways, I bought it, and like usual, I decide to extract it and see if there is some .nes file that runs it (like from the NES Switch Online). I extracted it, and this one, is very interesting (and not fun). (See attachement below).

This is not like any NSPs that usually is inside. This one has no .tik file (which was commonly useful to fully see the contents).

I tried digging in to see if there were any things that can extract the game contents, and nothing.

Even the Switch emulators we used (that can dump RomFS), can't be able to do it.

So, is there a way that this can be extracted in any way? (I don't know if there were any threads for this btw.)

Thanks.
 

Attachments

  • FireEmblemNSPExtracted.PNG
    FireEmblemNSPExtracted.PNG
    14.3 KB · Views: 330

cucholix

00000780 00000438
Member
Joined
Jan 17, 2017
Messages
3,246
Trophies
1
Age
44
XP
6,273
Country
Chile
Idk but the game could only have exefs? I wasn’t able to find romfs with nxdumptool from my copy either
 
Last edited by cucholix,

MrVtR

Well-Known Member
Member
Joined
Sep 30, 2017
Messages
311
Trophies
0
Age
23
XP
1,915
Country
Brazil
Hey, have you made any progress? I was wondering if it's possible to extract this game, since there isn't romfs to extract
 

Worldblender

Well-Known Member
Member
Joined
May 27, 2019
Messages
326
Trophies
0
Age
27
XP
2,240
Country
United States
I caught notice of this thread, so I decided to jump in. Continuing from where the original author left off, I used the NSZ tool (from https://github.com/nicoboss/nsz) and hactool (from https://github.com/SciresM/hactool) in order to complete the extraction part. The title keys need to be extracted as part of this process.
The file to perform the extraction process on is 3e1d6097fa7d9cc0dd0675bf3d2eb654.nca, since it is the largest of the NCA files, likely containing the bulk of the game data. Extract the contents of the exefs preferably into a directory (called 'main' in the screenshot below). The other files that may appear are not needed here.
Screenshot_20210515_014133.png


Navigate to the directory with the contents of the exefs. Its contents should look like in the next screenshot below:
Screenshot_20210515_014105.png

At first, I was struggling like the OP to find a .nes file that can be reused in emulators, but gained hope using a hex editor (KDE's Okteta). In the end, I made the following significant observations and conclusions:
  • 'main' contains almost all of the translated English text (scrolling required to see them, and some text may look broken), starting at offset 000B:4990. A search in UTF-8/string mode for 'Marth' (case-sensitive) brings multiple results, proving that the translated text really does reside in the program itself. I determined that translation is done on-the-fly, as done with Super Mario 64 (Shindou ROM Pack) included in Super Mario 3D All-Stars.
  • The actual ROM file is likely to be embedded in one of the files in the screenshot above. To determine which file has this ROM image, I will need to know the size of the original release of
    Fire Emblem: Shadow Dragon & the Blade of Light.
After making these conclusions, I made another larger one: This localization is likely neither reuse-friendly nor mod-friendly, due to the program being designed in a way that stops people from easily extracting a ROM file and using it in an emulator. Instead, it's likely the original release in Japanese shipping with on-the-fly English translation patches, which, as a side effect, makes piracy of this localization harder, but not impossible. Should other people successfully extract the translated text, and create a fan-made localization on top of the original release of Fire Emblem: Shadow Dragon & the Blade of Light using this text, it may be possible to effectively port it for appearing in emulators and less likely real hardware.
Sorry if I let anyone down with these observations, but reuse of anything useful from this localization and any kind of modding for it is a lot harder then we thought. There is also no ROM file in easy sight; it requires a more thorough search than what I'm willing to do for now.
 

MrVtR

Well-Known Member
Member
Joined
Sep 30, 2017
Messages
311
Trophies
0
Age
23
XP
1,915
Country
Brazil
I caught notice of this thread, so I decided to jump in. Continuing from where the original author left off, I used the NSZ tool (from https://github.com/nicoboss/nsz) and hactool (from https://github.com/SciresM/hactool) in order to complete the extraction part. The title keys need to be extracted as part of this process.
The file to perform the extraction process on is 3e1d6097fa7d9cc0dd0675bf3d2eb654.nca, since it is the largest of the NCA files, likely containing the bulk of the game data. Extract the contents of the exefs preferably into a directory (called 'main' in the screenshot below). The other files that may appear are not needed here.
View attachment 262979

Navigate to the directory with the contents of the exefs. Its contents should look like in the next screenshot below:
View attachment 262980
At first, I was struggling like the OP to find a .nes file that can be reused in emulators, but gained hope using a hex editor (KDE's Okteta). In the end, I made the following significant observations and conclusions:
  • 'main' contains almost all of the translated English text (scrolling required to see them, and some text may look broken), starting at offset 000B:4990. A search in UTF-8/string mode for 'Marth' (case-sensitive) brings multiple results, proving that the translated text really does reside in the program itself. I determined that translation is done on-the-fly, as done with Super Mario 64 (Shindou ROM Pack) included in Super Mario 3D All-Stars.
  • The actual ROM file is likely to be embedded in one of the files in the screenshot above. To determine which file has this ROM image, I will need to know the size of the original release of
    Fire Emblem: Shadow Dragon & the Blade of Light.
After making these conclusions, I made another larger one: This localization is likely neither reuse-friendly nor mod-friendly, due to the program being designed in a way that stops people from easily extracting a ROM file and using it in an emulator. Instead, it's likely the original release in Japanese shipping with on-the-fly English translation patches, which, as a side effect, makes piracy of this localization harder, but not impossible. Should other people successfully extract the translated text, and create a fan-made localization on top of the original release of Fire Emblem: Shadow Dragon & the Blade of Light using this text, it may be possible to effectively port it for appearing in emulators and less likely real hardware.
Sorry if I let anyone down with these observations, but reuse of anything useful from this localization and any kind of modding for it is a lot harder then we thought. There is also no ROM file in easy sight; it requires a more thorough search than what I'm willing to do for now.
Normally I work with Kruptar7 app to make fan-made translations here, which requires the game pointers to map the texts and remap the pointers on the app when I change the number of letters on the text.
I made some texts with this game last month and I had the same conclusions that you observed. I tried to modify only one letter on the text and the game recognized the text, but when I add one more letter than normal on an phrase, the game returns me to an error screen, almost 100% sure that this is some pointer issue
If you or someone find the pointer table on these files, I can make some file here on Kruptar and attach here for other users translate to their languages too
 

Worldblender

Well-Known Member
Member
Joined
May 27, 2019
Messages
326
Trophies
0
Age
27
XP
2,240
Country
United States
Normally I work with Kruptar7 app to make fan-made translations here, which requires the game pointers to map the texts and remap the pointers on the app when I change the number of letters on the text.
I made some texts with this game last month and I had the same conclusions that you observed. I tried to modify only one letter on the text and the game recognized the text, but when I add one more letter than normal on an phrase, the game returns me to an error screen, almost 100% sure that this is some pointer issue
If you or someone find the pointer table on these files, I can make some file here on Kruptar and attach here for other users translate to their languages too
Where can I find the Kruptar translation program? If it's open-source, where is its source code repository? How did you make your text changes, I wonder?
I may take me a long time to dig out anything beyond what I have already noted, as my focus is on other games. I wonder if it's even possible to extract the ROM image from the files I listed (likely for use in emulators), that could possibly include the QOL improvements.
 

MrVtR

Well-Known Member
Member
Joined
Sep 30, 2017
Messages
311
Trophies
0
Age
23
XP
1,915
Country
Brazil
Where can I find the Kruptar translation program? If it's open-source, where is its source code repository? How did you make your text changes, I wonder?
I may take me a long time to dig out anything beyond what I have already noted, as my focus is on other games. I wonder if it's even possible to extract the ROM image from the files I listed (likely for use in emulators), that could possibly include the QOL improvements.
Kruptar7 is an Russian translation app made on 2009-2011 with some Russian and Brazilian teams, the predecessor(Kruptar6) was made in 2003-2005, it's an universal editor for games, the user can map any kind of game if you have the pointers/offsets to go to the text line, you can find it here. This app have english/portuguese/russian language.
For the documentation, you can find here only in an russian PDF or here an quick tutorial for dummies made by the app creator
As for the source code, here the repo, it was made in Delphi

The text changes I made on an hex editor, I just located the string "New Game" and changed to "Bew Game", it's supposed to work this change, cuz the text didn't move on the byte address, if you add one extra char, the game doesn't open anymore, like "BBew Game", this is an normal issue with pointer, you have to recalculate the pointers (And that's what Kruptar7 can do with just one button, besides supplies an interface to edit texts)

It's possible that you can extract the ROM too and change it, if it's running on an NES emulator, somewhere in the code you'll have the ROM I guess
 
Last edited by MrVtR,

Worldblender

Well-Known Member
Member
Joined
May 27, 2019
Messages
326
Trophies
0
Age
27
XP
2,240
Country
United States
It's possible that you can extract the ROM too and change it, if it's running on an NES emulator, somewhere in the code you'll have the ROM I guess
That part of finding exactly where the ROM image is in the files, is hard for me. I'm sure that an NES/Famicom emulator (likely the same one used in the NES Mini and then Nintendo Switch Online NES games). I'm not too good at doing things like this by myself, unless you can tell me if other people have already done the extraction process of this game.

Main reason why I came here is to see if it's possible to play this localization elsewhere other than a Nintendo Switch; preferably an emulator on other platforms, PC included. It's possible I may give up should this become too difficult.
 

MrVtR

Well-Known Member
Member
Joined
Sep 30, 2017
Messages
311
Trophies
0
Age
23
XP
1,915
Country
Brazil
That part of finding exactly where the ROM image is in the files, is hard for me. I'm sure that an NES/Famicom emulator (likely the same one used in the NES Mini and then Nintendo Switch Online NES games). I'm not too good at doing things like this by myself, unless you can tell me if other people have already done the extraction process of this game.

Main reason why I came here is to see if it's possible to play this localization elsewhere other than a Nintendo Switch; preferably an emulator on other platforms, PC included. It's possible I may give up should this become too difficult.
I guess no one extracted the game yet to change the ROM on it, I think that could be the same process of Mario all-stars3D(that's a big maybe)
 

Worldblender

Well-Known Member
Member
Joined
May 27, 2019
Messages
326
Trophies
0
Age
27
XP
2,240
Country
United States
I guess no one extracted the game yet to change the ROM on it, I think that could be the same process of Mario all-stars3D(that's a big maybe)
Can you remind me of the process used with Super Mario 3D All-Stars? I tuned in at some point, but lost interest when some people said that that game compilation was designed to be mod-hostile (for example swapping the original ROM images for other ones for other games). I'm open to learning the kinds of internals, even if I may not have interest in playing a certain game at a certain time.
 

TheRealMorganTubeHD

Active Member
Newcomer
Joined
Mar 24, 2019
Messages
27
Trophies
0
Age
21
Location
California, USA
XP
224
Country
United States
I caught notice of this thread, so I decided to jump in. Continuing from where the original author left off, I used the NSZ tool (from https://github.com/nicoboss/nsz) and hactool (from https://github.com/SciresM/hactool) in order to complete the extraction part. The title keys need to be extracted as part of this process.
The file to perform the extraction process on is 3e1d6097fa7d9cc0dd0675bf3d2eb654.nca, since it is the largest of the NCA files, likely containing the bulk of the game data. Extract the contents of the exefs preferably into a directory (called 'main' in the screenshot below). The other files that may appear are not needed here.
View attachment 262979

Navigate to the directory with the contents of the exefs. Its contents should look like in the next screenshot below:
View attachment 262980
At first, I was struggling like the OP to find a .nes file that can be reused in emulators, but gained hope using a hex editor (KDE's Okteta). In the end, I made the following significant observations and conclusions:
  • 'main' contains almost all of the translated English text (scrolling required to see them, and some text may look broken), starting at offset 000B:4990. A search in UTF-8/string mode for 'Marth' (case-sensitive) brings multiple results, proving that the translated text really does reside in the program itself. I determined that translation is done on-the-fly, as done with Super Mario 64 (Shindou ROM Pack) included in Super Mario 3D All-Stars.
  • The actual ROM file is likely to be embedded in one of the files in the screenshot above. To determine which file has this ROM image, I will need to know the size of the original release of
    Fire Emblem: Shadow Dragon & the Blade of Light.
After making these conclusions, I made another larger one: This localization is likely neither reuse-friendly nor mod-friendly, due to the program being designed in a way that stops people from easily extracting a ROM file and using it in an emulator. Instead, it's likely the original release in Japanese shipping with on-the-fly English translation patches, which, as a side effect, makes piracy of this localization harder, but not impossible. Should other people successfully extract the translated text, and create a fan-made localization on top of the original release of Fire Emblem: Shadow Dragon & the Blade of Light using this text, it may be possible to effectively port it for appearing in emulators and less likely real hardware.
Sorry if I let anyone down with these observations, but reuse of anything useful from this localization and any kind of modding for it is a lot harder then we thought. There is also no ROM file in easy sight; it requires a more thorough search than what I'm willing to do for now.
I know this is a Couple of Years too late, but the Original Game is around 384KB. I Hope We get this Project finished Soon, If not, Eventually.
 

Worldblender

Well-Known Member
Member
Joined
May 27, 2019
Messages
326
Trophies
0
Age
27
XP
2,240
Country
United States
I know this is a Couple of Years too late, but the Original Game is around 384KB. I Hope We get this Project finished Soon, If not, Eventually.
That's good to hear. At this point, my focus has shifted away from here, especially since it's not being sold on the Nintendo eShop anymore, and likely having been superseded by Fire Emblem Engage. This is the game we were supposed to get for the 30th anniversary of Fire Emblem, but COVID-19 delayed this game like with many others around 2020 or 2021.
 

MrVtR

Well-Known Member
Member
Joined
Sep 30, 2017
Messages
311
Trophies
0
Age
23
XP
1,915
Country
Brazil
I know this is a Couple of Years too late, but the Original Game is around 384KB. I Hope We get this Project finished Soon, If not, Eventually.
But did you manage to extract the texts and edit them properly?
The max I did was translate some texts without change the string length, because I didn't find the offsets to update it
 

MrVtR

Well-Known Member
Member
Joined
Sep 30, 2017
Messages
311
Trophies
0
Age
23
XP
1,915
Country
Brazil
Is there any hope for this? I’m still praying to play an official translation for the NES.
Very low chance, since we have no clue where the game offsets are to extract the text without any issue
The only way you can translate the game is without increase any word length at the moment
Post automatically merged:

Just a question - Did you decompress main before edit it?
This isn't necessary, in fact, if you decompress it, you can lose a lot of information of it, since the nx2elf can corrupt some file sections.
IDA pro have a plugin to open the main file without decompress it
 
Last edited by MrVtR,

SerpensIgnis

New Member
Newbie
Joined
Jan 30, 2024
Messages
2
Trophies
0
Age
23
XP
45
Country
Brazil
Hey hey people. I'm very interested in seeing this done.

I've started reversing the NSP for this game and already managed to find most (if not all) of the translated text. I've yet to find the font and translated graphics it uses, however.

First of all, the game indeed only features exefs, no romfs. The executable only has one binary blob of interest, which contains the japanese FE rom, the NSO's famicom emulator and the necessary data for patching the game.

My first idea was to try and get a RAM dump of the game during execution, to check if the switch applied the whole translation to the ROM at once. That would be the dream scenario, but it's not the case. It's not merely applying something like an IPS patch on the fly. Rather, individual translations are applied during execution. For instance, when the famicom wants to draw text to the screen, the switch takes over with its own text parser in order to process the translated text.

The translated text is in plain ASCII. Having Ghidra track these down for me yielded 505 entries. I can't say it's everything without matching the text with the original ROM's entries, but it's safe to say we already have most of it.

Using YY-CHR, binwalk and other pattern matching/data visualization techniques, I was unable to find any embedded graphics or fonts used for translating. They're most certainly not in 2BPP Famicom format. It's possible that the game generates the font tiles on the fly from vector graphics, and it's possible that this takes place not in the main blob but in the SDK somewhere.

Frankly, I can't tell. This is my first experience with hacking anything switch related and it was difficult finding documentation about the SDK or the NSO's emulators. It seems there's very little interest in hacking these emulators, as most of the library is already playable using ROMs elsewhere. Fire Emblem is the only notable exception I know of. If anyone knows where to find resources related to this, please let me know.

I have yet to start poking around the original japanese ROM, but, in my experience, it's typically easy to find a pointer table for text data. It would only be a problem if it's split into multiple, sparse tables, or if the text is directly referenced by the code itself, in which case you'd have to fix the instructions one by one. Graphics are not compressed, which means that insertion should be trivial. Ideally, we'd also use a VWF rendering engine for drawing the text, but this would involve adding CHR-RAM to the cartridge and heavily modifying the related assembly code.

Sadly, this isn't a priority for me right now, as I'm already involved in a few other translation hack projects. But as I said, I really want to see this done, so if anyone here has considerable romhacking experience and is interested in creating this port, feel free to get in touch with me. I'll happily provide more details on what I've already found, and we can even partner up.
 

MrVtR

Well-Known Member
Member
Joined
Sep 30, 2017
Messages
311
Trophies
0
Age
23
XP
1,915
Country
Brazil
Hey hey people. I'm very interested in seeing this done.

I've started reversing the NSP for this game and already managed to find most (if not all) of the translated text. I've yet to find the font and translated graphics it uses, however.

First of all, the game indeed only features exefs, no romfs. The executable only has one binary blob of interest, which contains the japanese FE rom, the NSO's famicom emulator and the necessary data for patching the game.

My first idea was to try and get a RAM dump of the game during execution, to check if the switch applied the whole translation to the ROM at once. That would be the dream scenario, but it's not the case. It's not merely applying something like an IPS patch on the fly. Rather, individual translations are applied during execution. For instance, when the famicom wants to draw text to the screen, the switch takes over with its own text parser in order to process the translated text.

The translated text is in plain ASCII. Having Ghidra track these down for me yielded 505 entries. I can't say it's everything without matching the text with the original ROM's entries, but it's safe to say we already have most of it.

Using YY-CHR, binwalk and other pattern matching/data visualization techniques, I was unable to find any embedded graphics or fonts used for translating. They're most certainly not in 2BPP Famicom format. It's possible that the game generates the font tiles on the fly from vector graphics, and it's possible that this takes place not in the main blob but in the SDK somewhere.

Frankly, I can't tell. This is my first experience with hacking anything switch related and it was difficult finding documentation about the SDK or the NSO's emulators. It seems there's very little interest in hacking these emulators, as most of the library is already playable using ROMs elsewhere. Fire Emblem is the only notable exception I know of. If anyone knows where to find resources related to this, please let me know.

I have yet to start poking around the original japanese ROM, but, in my experience, it's typically easy to find a pointer table for text data. It would only be a problem if it's split into multiple, sparse tables, or if the text is directly referenced by the code itself, in which case you'd have to fix the instructions one by one. Graphics are not compressed, which means that insertion should be trivial. Ideally, we'd also use a VWF rendering engine for drawing the text, but this would involve adding CHR-RAM to the cartridge and heavily modifying the related assembly code.

Sadly, this isn't a priority for me right now, as I'm already involved in a few other translation hack projects. But as I said, I really want to see this done, so if anyone here has considerable romhacking experience and is interested in creating this port, feel free to get in touch with me. I'll happily provide more details on what I've already found, and we can even partner up.
I don't have experience in the texture extraction part, but regarding text pointers, even using Ghidra and IDA, I didn't find it. Furthermore, talking to an Exefs modder on the Atmosphere discord server a while ago, he told me reported that the most common way to make mods for this would be using something called Skyline, as there is no way to make modifications directly in Ghidra/IDA and load it on the switch: https://github.com/skyline-dev/skyline

But other than that, I had no luck making any changes, without the pointer table, it ends up being impossible to translate the game without increasing the size of the texts
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Watching the fallout series it is pretty decent