ROM Hack [Question] Modifying Exefs

thane98

Well-Known Member
OP
Member
Joined
Apr 23, 2016
Messages
617
Trophies
0
XP
1,533
Country
United States
I'm aware of the processes for creating and running modifications to a game's romfs, but I haven't done anything with the exefs. I haven't been able to find answers to some questions I have about modifying it, so I thought that I'd go ahead and ask here.

Is is possible to run exefs modifications through an NTR plugin? I know that HANS offers a method for running code.bin changes, but I'd like to avoid dealing with HANS if possible. If nothing can be done using NTR, is there an alternative for running exefs (or at the least, code.bin) changes?

I also have some questions about the file structure of the code.bin in exefs if anyone has experience working with that kind of file. Obviously, code will vary greatly from game to game, but I'm wondering if there's any sort of defined structure to the compiled code. Knowing about that before trying to make changes could save a lot of headaches. Also, if I wanted to add bytes to the file, what steps would I need to take in order to have the code still load correctly? Do I need to make changes elsewhere if I expand the file size?

Apologies for all of the questions. Any information on making edits to an exefs would be very helpful.
 

Ningyoplug

Well-Known Member
Member
Joined
Mar 10, 2016
Messages
257
Trophies
0
Age
29
Location
Gayland
Website
ningyo.tumblr.com
XP
363
Country
Italy
Seconding all your questions. I'd like to know more (especially about the code.bin structure) as well, but no one ever seems to talk about it...
It would be nice if someone could shed some light on the exefs.

PS: I'd like to add one more question: does anyone know where the info on S supports being locked to 1 person only is situated in the code.bin? It would help me greatly.
 

thane98

Well-Known Member
OP
Member
Joined
Apr 23, 2016
Messages
617
Trophies
0
XP
1,533
Country
United States
SaltySD just uses Luma3DS's code override. Just modify the code.bin and stick it at /luma/code_sections/<TID>.bin. I usually end up testing by shipping all my patches as a bunch of w32s over RPC anyhow though.
Thank you, that sounds like exactly what I was looking for. I didn't know that Luma offered that sort of functionality. Do you know if that method allows for expanded code.bin files? That'd be my only other concern.
 

shinyquagsire23

SALT/Sm4sh Leak Guy
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
Thank you, that sounds like exactly what I was looking for. I didn't know that Luma offered that sort of functionality. Do you know if that method allows for expanded code.bin files? That'd be my only other concern.
Don't think so, but I also don't think that would work anyhow since code.bin is the .text, .rodata and .data lumped into one blob, and that's how they are in memory. Best bet is finding unused code tbh. Sm4sh has an entire libpng library imported which is never used.
 

thane98

Well-Known Member
OP
Member
Joined
Apr 23, 2016
Messages
617
Trophies
0
XP
1,533
Country
United States
Don't think so, but I also don't think that would work anyhow since code.bin is the .text, .rodata and .data lumped into one blob, and that's how they are in memory. Best bet is finding unused code tbh. Sm4sh has an entire libpng library imported which is never used.
Yeah, that might be a better option - I guess that I might as well jump in and see what can be done. Thank you for your help!
 

thane98

Well-Known Member
OP
Member
Joined
Apr 23, 2016
Messages
617
Trophies
0
XP
1,533
Country
United States
SaltySD just uses Luma3DS's code override. Just modify the code.bin and stick it at /luma/code_sections/<TID>.bin.
Sorry to bug you again - I'm having some trouble getting my modified code.bin to load. I took a decompressed code.bin, modified it, renamed it to use the Fates Special Edition TID (0004000000179800), and left it on my SD card using the path sd:/luma/code_sections/0004000000179800.bin. However, I'm noticing no changes in game - it looks like Luma's not loading the modified code at all. I went ahead and updated luma to the latest hourly build to make sure that wasn't the issue, though that didn't fix things. Is there some step that I'm missing here?
 

shinyquagsire23

SALT/Sm4sh Leak Guy
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
Sorry to bug you again - I'm having some trouble getting my modified code.bin to load. I took a decompressed code.bin, modified it, renamed it to use the Fates Special Edition TID (0004000000179800), and left it on my SD card using the path sd:/luma/code_sections/0004000000179800.bin. However, I'm noticing no changes in game - it looks like Luma's not loading the modified code at all. I went ahead and updated luma to the latest hourly build to make sure that wasn't the issue, though that didn't fix things. Is there some step that I'm missing here?
It could possibly be using the update TID, if there's a game update installed.

EDIT: Actually it doesn't seem that's the case, not sure what it could be then.
 
Last edited by shinyquagsire23,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    AncientBoi @ AncientBoi: I just Luv having CEX :)