Homebrew Decompling NSPS

DaniPoo

Well-Known Member
Member
Joined
Jan 2, 2013
Messages
925
Trophies
1
Age
35
XP
2,293
Country
Is there a way to decompile nsp such as youtube for example

Why would you ever want to decompile it? It would be easier to write your own YouTube app than decompiling and then recompiling the existing one.

I think if you start with explaining what you actually want rather than what you THINK you need, we might actually be able to help you.

decompilation project usually take a lot of time and effort and are rarely started for products that are still around. It’s more common in cases where the source code is thought to be lost forever.
 
  • Like
Reactions: Slluxx

NotErista

Well-Known Member
OP
Member
Joined
Dec 21, 2020
Messages
107
Trophies
0
Location
Amazon
Website
amazon.com
XP
284
Country
United Kingdom
Why would you ever want to decompile it? It would be easier to write your own YouTube app than decompiling and then recompiling the existing one.

I think if you start with explaining what you actually want rather than what you THINK you need, we might actually be able to help you.

decompilation project usually take a lot of time and effort and are rarely started for products that are still around. It’s more common in cases where the source code is thought to be lost forever.
iam not going to recompile it when did i say that

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

iam not going to recompile it when did i say that
Iam only wanting it code?

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

decompilation project usually take a lot of time and effort and are rarely started for products that are still around. It’s more common in cases where the source code is thought to be lost forever.
thanks for the info
 
  • Like
Reactions: Saviouz
Joined
Sep 9, 2019
Messages
904
Trophies
1
Location
Switch scene
Website
github.com
XP
2,663
Country
Korea, North
You can use hactool but the exact command lines arguments you need will depend on what you want. https://github.com/SciresM/hactool . If you can give a bit more info I'll try to help but there's plenty of guides for using it. When you say decompile what do you mean? Do you want the binaries? You'll need to dump the exefs. Want assets? You'll need the romfs. Iirc meta data and icons have their own file system but I don't remember the name.
 
Last edited by CompSciOrBust,

DaniPoo

Well-Known Member
Member
Joined
Jan 2, 2013
Messages
925
Trophies
1
Age
35
XP
2,293
Country
You can use hactool but the exact command lines arguments you need will depend on what you want. https://github.com/SciresM/hactool . If you can give a bit more info I'll try to help but there's plenty of guides for using it. When you say decompile what do you mean? Do you want the binaries? You'll need to dump the exefs. Want assets? You'll need the romfs. Iirc meta data and icons have their own file system but I don't remember the name.

when someone says decopile I guess they want an actuall compilable sourcecode that is readable.
 
Joined
Sep 9, 2019
Messages
904
Trophies
1
Location
Switch scene
Website
github.com
XP
2,663
Country
Korea, North
when someone says decopile I guess they want an actuall compilable sourcecode that is readable.
I considered that too but they said they don't want to recompile it. If they don't want to recompile it I don't know why they would want to get the source code. I thought maybe they were planning on doing asset mods or hex editing the raw binary.
 

NotErista

Well-Known Member
OP
Member
Joined
Dec 21, 2020
Messages
107
Trophies
0
Location
Amazon
Website
amazon.com
XP
284
Country
United Kingdom
You can use hactool but the exact command lines arguments you need will depend on what you want. https://github.com/SciresM/hactool . If you can give a bit more info I'll try to help but there's plenty of guides for using it. When you say decompile what do you mean? Do you want the binaries? You'll need to dump the exefs. Want assets? You'll need the romfs. Iirc meta data and icons have their own file system but I don't remember the name.

Yea I did want the srouce code
But i may use this in the future

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

What I did find tho is the in the intellectual property Notices was google had the srouce I think I have not checked yet but here is the link cobalt.googlesource.com/cobalt
 

Slluxx

GBATemp Mayor
Developer
Joined
Jul 17, 2019
Messages
607
Trophies
0
XP
2,148
Country
Germany
AFAIK there is a ghidra plugin for NSPs but im not sure if its usecase is to reverse engineer code. And even if it would be, you'd see a language you wont understand on the left and gibberish decompiled code that doesnt make sense at all to you on the right. And you also wouldnt be able to copy paste that gibberish code even if you wanted to, because you would need to reverse engineer and adapt it so you could use it with libnx.

So to answer your question "Is there a way to decompile nsp such as youtube for example": yeah, there might actually be one.
But the real question should be "would it make sense to decompile an existing app to learn from or re-use its code" and the answer is: no.
 
Last edited by Slluxx,

NotErista

Well-Known Member
OP
Member
Joined
Dec 21, 2020
Messages
107
Trophies
0
Location
Amazon
Website
amazon.com
XP
284
Country
United Kingdom
AFAIK there is a ghidra plugin for NSPs but im not sure if its usecase is to reverse engineer code. And even if it would be, you'd see a language you wont understand on the left and gibberish decompiled code that doesnt make sense at all to you on the right. And you also wouldnt be able to copy paste that gibberish code even if you wanted to, because you would need to reverse engineer and adapt it so you could use it with libnx.

So to answer your question "Is there a way to decompile nsp such as youtube for example": yeah, there might actually be one.
But the real question should be "would it make sense to decompile an existing app to learn from or re-use its code" and the answer is: no.
K Thanks alot
 

qbdp

Well-Known Member
Newcomer
Joined
Aug 23, 2020
Messages
46
Trophies
0
Age
40
XP
384
Country
United States
Ok, how about this? Farsight Studios makes The Pinball Arcade for Nintendo Switch as well as PC. I've noticed that some of the tables on PC are missing on the Switch. I'd like to pull apart the Farsight Studios Pinball Arcade NSP so I can see the tables and assets involved with them. Perhaps I can find a way to import the tables from PC over to the Switch. But I don't know how to view the assets in a Nintendo NSP file.
 

Imancol

Otak Productions
Member
Joined
Jun 29, 2017
Messages
1,376
Trophies
0
XP
2,766
Country
Colombia
Perhaps the decompilation, and later compilation, serve to change the path of the servers of the Free to Play games, instead of the CDNs. By those of the game server itself directly, just like its other versions on other devices (Not consoles)
 

Slluxx

GBATemp Mayor
Developer
Joined
Jul 17, 2019
Messages
607
Trophies
0
XP
2,148
Country
Germany
Ok, how about this? Farsight Studios makes The Pinball Arcade for Nintendo Switch as well as PC. I've noticed that some of the tables on PC are missing on the Switch. I'd like to pull apart the Farsight Studios Pinball Arcade NSP so I can see the tables and assets involved with them. Perhaps I can find a way to import the tables from PC over to the Switch. But I don't know how to view the assets in a Nintendo NSP file.

Perhaps the decompilation, and later compilation, serve to change the path of the servers of the Free to Play games, instead of the CDNs. By those of the game server itself directly, just like its other versions on other devices (Not consoles)

you two will probably have more luck with dumping the RomFS section of the game and poke in those files.
 
  • Like
Reactions: Impossible_Igntiz

CMDreamer

Well-Known Member
Member
Joined
Oct 29, 2014
Messages
1,697
Trophies
1
Age
39
XP
3,511
Country
Mexico
Yea I did want the srouce code
But i may use this in the future

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

What I did find tho is the in the intellectual property Notices was google had the srouce I think I have not checked yet but here is the link cobalt.googlesource.com/cobalt

Just as has been said, decompilation takes a lot of time and effort, and unless you can recompile it and obtain a 1:1 compilation compared to the original, then the decompilation will be wrong.

Having the source code of a recent product (aka, software) not owned by you, and using it on your own projects, will get you in court facing thievery for sure.

That's the main reason why all those recent source code leaks can't be used for improving other software in a direct manner.
 
Last edited by CMDreamer,
  • Like
Reactions: NotErista

Imancol

Otak Productions
Member
Joined
Jun 29, 2017
Messages
1,376
Trophies
0
XP
2,766
Country
Colombia
Just as has been said, decompilation takes a lot of time and effort, and unless you can recompile it and obtain a 1:1 compilation compared to the original, then the decompilation will be wrong.

Having the source code of a recent product (aka, software) not owned by you, and using it on your own projects, will get you in court facing thievery for sure.

That's the main reason why all those recent source code leaks can't be used for improving other software in a direct manner.
I know that perfectly well. Talking about what you want to achieve does not mean that it can be done. But it is not an impediment to discuss it.
 
  • Like
Reactions: NotErista

Slluxx

GBATemp Mayor
Developer
Joined
Jul 17, 2019
Messages
607
Trophies
0
XP
2,148
Country
Germany
and you no more than decompose the thread.
the fuck is your problem dude? its not my problem that you dont know a thing about how this works. I gave a real and valid hint on how you would go about to "change the path of the servers of the Free to Play games, instead of the CDNs.".

Ways to reach your goal where you know it cant be done are useless to discuss. So why not focus on alternative ways? One way beeing to poke in the RomFS section.

If you cant handle someone telling you that something you say (because you clearly have no idea of what the fuck you are talking about) is impossible, you shouldnt be on the internet.
 
  • Like
Reactions: NotErista

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
Do this:

hactool -t pfs0 -k keys.dat file.nsp --pfs0dir=extract
hactool -k keys.dat --exefsdir=exefs --romfsdir=romfs extract/largest.nca
hactool -t nso0 -k keys.dat exefs/main --uncompressed=mainDec

Use google to find nxo64.py - put that into IDA loaders folder.

Mod the mainDec file, then Do this: (apparently):

In order to make the executable accepted when it's launched, the NSO0 header has to be modified where the ".text" part hash is located (see https://switchbrew.org/wiki/NSO for further details).
 
  • Like
Reactions: Imancol

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: https://m.youtube.com/watch?v=3xQO7neBmy0&pp=ygUXU2hvd2VyIHNjZW5lIEhhbGYgYmFrZWQ%3D