ROM Hack Question Saving edits to an exefs file

Amethyst-szs

New Member
OP
Newbie
Joined
Jul 7, 2020
Messages
2
Trophies
0
Age
22
XP
26
Country
United States
Hey! I've been doing some work in Ghidra & Ghidra Switch Loader in order to modify a game's exefs file. I've gotten to the point that I have an uncompressed exefs file that I can get the assembly and C code. However, Ghidra Switch Loader doesn't have the ability to export as an exefs main file. I'm able to get a binary but that's something completely different and not very helpful. I've been working on this for ages and it would be really helpful if anybody could help me out. Even if you have a super tedious method, it's better then nothing at all for me.

The image shows my original main file, the decompressed main file, and the not working binary bin file that Ghidra gives me.
Capture.PNG
 

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
8,200
Trophies
1
XP
13,259
Country
United Kingdom
I haven't used ghidra and don't know if there are any more direct methods. If you know what changes you're making to the code in terms of assembly instructions, you can translate them to hex numbers either manually or with some tool, and change the relevant bytes in a copy of the uncompressed main file. Then you can make an IPS patch of the changes, or use the modified main via layeredfs.
 

Amethyst-szs

New Member
OP
Newbie
Joined
Jul 7, 2020
Messages
2
Trophies
0
Age
22
XP
26
Country
United States
I haven't used ghidra and don't know if there are any more direct methods. If you know what changes you're making to the code in terms of assembly instructions, you can translate them to hex numbers either manually or with some tool, and change the relevant bytes in a copy of the uncompressed main file. Then you can make an IPS patch of the changes, or use the modified main via layeredfs.
.
That sounds like it would work. I'm not sure how to find the bytes in a hex editor though. Ghidra has the bytes for an assembly instruction on the side. If you take these into a hex editor, it doesn't find them.
Capture.PNG
Capture2.PNG
 

switcherjoe

Well-Known Member
Newcomer
Joined
Nov 29, 2021
Messages
45
Trophies
0
Age
52
XP
202
Country
Armenia
Hey! I've been doing some work in Ghidra & Ghidra Switch Loader in order to modify a game's exefs file. I've gotten to the point that I have an uncompressed exefs file that I can get the assembly and C code. However, Ghidra Switch Loader doesn't have the ability to export as an exefs main file. I'm able to get a binary but that's something completely different and not very helpful. I've been working on this for ages and it would be really helpful if anybody could help me out. Even if you have a super tedious method, it's better then nothing at all for me.

The image shows my original main file, the decompressed main file, and the not working binary bin file that Ghidra gives me.
View attachment 216481
1) uncompress main with the nx2elf.exe
2) load main.elf in Ghidra
3) patch the main.elf within Ghidra
4) compress the modified main.elf with elf2nso.exe
5) use IPS patches or layered FS

It's far easier though to use EdiZon-SE instead of IPS/layered FS patching, so instead of steps 3-5 you can just use the offset and the ASM code changes as a cheat.
 
General chit-chat
Help Users
    DEMONGreninjaPG @ DEMONGreninjaPG: shut up